Thomas Vachuska
Committed by Gerrit Code Review

Fixing onos-package not to be sensitive to cell settings and instead allowing on…

…os-config (used from onos-install) to be fully sensitive to cell settings.
Added onos-package-test and onos-push-test-bits scripts.

Change-Id: Ie3f829f8a6e6d8a419388428feca56b69635ed44
...@@ -20,12 +20,20 @@ export BUILD_NUMBER=${BUILD_NUMBER:-$(id -un)~$(date +'%Y/%m/%d@%H:%M')} ...@@ -20,12 +20,20 @@ export BUILD_NUMBER=${BUILD_NUMBER:-$(id -un)~$(date +'%Y/%m/%d@%H:%M')}
20 # ONOS Version and onos.tar.gz staging environment 20 # ONOS Version and onos.tar.gz staging environment
21 export ONOS_POM_VERSION="1.1.0-SNAPSHOT" 21 export ONOS_POM_VERSION="1.1.0-SNAPSHOT"
22 export ONOS_VERSION=${ONOS_VERSION:-1.1.0.$BUILD_NUMBER} 22 export ONOS_VERSION=${ONOS_VERSION:-1.1.0.$BUILD_NUMBER}
23 +
24 +# ONOS production bits (onos.tar.gz & onos.zip) staging environment
23 export ONOS_BITS=onos-${ONOS_VERSION%~*} 25 export ONOS_BITS=onos-${ONOS_VERSION%~*}
24 export ONOS_STAGE_ROOT=${ONOS_STAGE_ROOT:-/tmp} 26 export ONOS_STAGE_ROOT=${ONOS_STAGE_ROOT:-/tmp}
25 export ONOS_STAGE=$ONOS_STAGE_ROOT/$ONOS_BITS 27 export ONOS_STAGE=$ONOS_STAGE_ROOT/$ONOS_BITS
26 export ONOS_TAR=$ONOS_STAGE.tar.gz 28 export ONOS_TAR=$ONOS_STAGE.tar.gz
27 export ONOS_ZIP=$ONOS_STAGE.zip 29 export ONOS_ZIP=$ONOS_STAGE.zip
28 30
31 +# ONOS test bits (onos-test.tar.gz) staging environment
32 +export ONOS_TEST_BITS=onos-test-${ONOS_VERSION%~*}
33 +export ONOS_TEST_STAGE_ROOT=${ONOS_TEST_STAGE_ROOT:-/tmp}
34 +export ONOS_TEST_STAGE=$ONOS_STAGE_ROOT/$ONOS_TEST_BITS
35 +export ONOS_TEST_TAR=$ONOS_TEST_STAGE.tar.gz
36 +
29 # Defaults for ONOS testing using remote machines. 37 # Defaults for ONOS testing using remote machines.
30 # if [ -n "${ONOS_CELL}" -a -f $ONOS_ROOT/tools/test/cells/${ONOS_CELL} ]; then 38 # if [ -n "${ONOS_CELL}" -a -f $ONOS_ROOT/tools/test/cells/${ONOS_CELL} ]; then
31 # . $ONOS_ROOT/tools/test/cells/${ONOS_CELL} 39 # . $ONOS_ROOT/tools/test/cells/${ONOS_CELL}
......
1 #!/bin/bash 1 #!/bin/bash
2 # ----------------------------------------------------------------------------- 2 # -----------------------------------------------------------------------------
3 -# Packages ONOS distributable into onos.tar.gz 3 +# Packages ONOS distributable into onos.tar.gz and onos.zip
4 # ----------------------------------------------------------------------------- 4 # -----------------------------------------------------------------------------
5 5
6 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 6 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
...@@ -57,8 +57,6 @@ find $M2_REPO/org/onosproject/ -type d -name $ONOS_POM_VERSION | while read line ...@@ -57,8 +57,6 @@ find $M2_REPO/org/onosproject/ -type d -name $ONOS_POM_VERSION | while read line
57 $KARAF_DIST/system/org/onosproject/$artifact/$ONOS_POM_VERSION 57 $KARAF_DIST/system/org/onosproject/$artifact/$ONOS_POM_VERSION
58 done 58 done
59 59
60 -export ONOS_FEATURES="${ONOS_FEATURES:-webconsole,onos-api,onos-core,onos-cli,onos-rest,onos-gui,onos-openflow,onos-app-fwd,onos-app-foo}"
61 -
62 # ONOS Patching ---------------------------------------------------------------- 60 # ONOS Patching ----------------------------------------------------------------
63 61
64 # Patch the Apache Karaf distribution file to add ONOS features repository 62 # Patch the Apache Karaf distribution file to add ONOS features repository
...@@ -66,6 +64,7 @@ perl -pi.old -e "s|^(featuresRepositories=.*)|\1,mvn:org.onosproject/onos-featur ...@@ -66,6 +64,7 @@ perl -pi.old -e "s|^(featuresRepositories=.*)|\1,mvn:org.onosproject/onos-featur
66 $ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg 64 $ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg
67 65
68 # Patch the Apache Karaf distribution file to load ONOS features 66 # Patch the Apache Karaf distribution file to load ONOS features
67 +export ONOS_FEATURES="webconsole,onos-api,onos-core,onos-cli,onos-rest,onos-gui,onos-openflow"
69 perl -pi.old -e "s|^(featuresBoot=.*)|\1,$ONOS_FEATURES|" \ 68 perl -pi.old -e "s|^(featuresBoot=.*)|\1,$ONOS_FEATURES|" \
70 $ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg 69 $ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg
71 70
......
1 +#!/bin/bash
2 +# -----------------------------------------------------------------------------
3 +# Packages ONOS test facilities into onos-test.tar.gz
4 +# -----------------------------------------------------------------------------
5 +
6 +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7 +. $ONOS_ROOT/tools/build/envDefaults
8 +
9 +# Bail on any errors
10 +set -e
11 +
12 +rm -fr $ONOS_TEST_STAGE # Remove this when package script is completed
13 +
14 +# Create the stage directory and warp into it
15 +mkdir -p $ONOS_TEST_STAGE/tools/test \
16 + $ONOS_TEST_STAGE/tools/dev \
17 + $ONOS_TEST_STAGE/tools/build \
18 + $ONOS_TEST_STAGE/tools/package/config
19 +
20 +cp -r $ONOS_ROOT/tools/test $ONOS_TEST_STAGE/tools
21 +cp $ONOS_ROOT/tools/dev/bash_profile $ONOS_TEST_STAGE/tools/dev
22 +cp $ONOS_ROOT/tools/build/envDefaults $ONOS_TEST_STAGE/tools/build
23 +
24 +cd $ONOS_TEST_STAGE_ROOT
25 +
26 +# Now package up the ONOS test tools tar file
27 +COPYFILE_DISABLE=1 tar zcf $ONOS_TEST_TAR $ONOS_TEST_BITS
28 +cd $ONOS_TEST_STAGE_ROOT
29 +# rm -r $ONOS_TEST_STAGE
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
8 8
9 remote=$ONOS_USER@${1:-$OCI} 9 remote=$ONOS_USER@${1:-$OCI}
10 10
11 +# Customize features
12 +export ONOS_FEATURES="${ONOS_FEATURES:-webconsole,onos-api,onos-core,onos-cli,onos-rest,onos-gui,onos-openflow}"
13 +
14 +
11 # Generate a cluster.json from the ON* environment variables 15 # Generate a cluster.json from the ON* environment variables
12 CDEF_FILE=/tmp/${remote}.cluster.json 16 CDEF_FILE=/tmp/${remote}.cluster.json
13 echo "{ \"ipPrefix\": \"$ONOS_NIC\"," > $CDEF_FILE 17 echo "{ \"ipPrefix\": \"$ONOS_NIC\"," > $CDEF_FILE
...@@ -35,6 +39,10 @@ ssh $remote " ...@@ -35,6 +39,10 @@ ssh $remote "
35 # Suppress Hazelcast multicast joiner warning 39 # Suppress Hazelcast multicast joiner warning
36 echo "log4j.logger.com.hazelcast.cluster.impl.MulticastService= ERROR" \ 40 echo "log4j.logger.com.hazelcast.cluster.impl.MulticastService= ERROR" \
37 >> $ONOS_INSTALL_DIR/$KARAF_DIST/etc/org.ops4j.pax.logging.cfg 41 >> $ONOS_INSTALL_DIR/$KARAF_DIST/etc/org.ops4j.pax.logging.cfg
42 +
43 + # Patch the Apache Karaf distribution file to load ONOS features
44 + perl -pi.old -e \"s|^(featuresBoot=.*,management)(,webconsole,.*)|\1,$ONOS_FEATURES|\" \
45 + $ONOS_INSTALL_DIR/$KARAF_DIST/etc/org.apache.karaf.features.cfg
38 " 46 "
39 47
40 # Generate a default tablets.json from the ON* environment variables 48 # Generate a default tablets.json from the ON* environment variables
...@@ -42,7 +50,6 @@ TDEF_FILE=/tmp/${remote}.tablets.json ...@@ -42,7 +50,6 @@ TDEF_FILE=/tmp/${remote}.tablets.json
42 onos-gen-partitions $TDEF_FILE 50 onos-gen-partitions $TDEF_FILE
43 scp -q $TDEF_FILE $remote:$ONOS_INSTALL_DIR/config/tablets.json 51 scp -q $TDEF_FILE $remote:$ONOS_INSTALL_DIR/config/tablets.json
44 52
45 -
46 # copy tools/package/config/ to remote 53 # copy tools/package/config/ to remote
47 scp -qr ${ONOS_ROOT}/tools/package/config/ $remote:$ONOS_INSTALL_DIR/ 54 scp -qr ${ONOS_ROOT}/tools/package/config/ $remote:$ONOS_INSTALL_DIR/
48 55
......
1 +#!/bin/bash
2 +# -----------------------------------------------------------------------------
3 +# Remotely pushes test bits to a remote test machine and unrolls them in /tmp
4 +# -----------------------------------------------------------------------------
5 +
6 +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7 +. $ONOS_ROOT/tools/build/envDefaults
8 +
9 +node=${1:-$OCI}
10 +remote=$ONOS_USER@$node
11 +
12 +scp -q $ONOS_TEST_TAR $remote:/tmp
13 +ssh $remote "
14 + rm -f /tmp/onos $ONOS_TEST_BITS
15 + cd /tmp && tar zxf $ONOS_TEST_BITS.tar.gz && ln -s $ONOS_TEST_BITS onos
16 +"
1 +# Bare metal cluster
2 +
3 +# Use the 10G NIC for cluster communications
4 +export ONOS_NIC="192.168.200.*"
5 +
6 +# ONOS Test proxy
7 +export OCT=192.168.200.101
8 +
9 +# Use the 1G NICs for external access
10 +export OC1=192.168.200.101
11 +export OC2=192.168.200.102
12 +export OC3=192.168.200.103
13 +export OC4=192.168.200.104
14 +export OC5=192.168.200.105
15 +export OC6=192.168.200.106
16 +export OC7=192.168.200.107
17 +
18 +export OCI=${OC1}
19 +
20 +export ONOS_FEATURES=webconsole,onos-api,onos-core,onos-cli,onos-rest,onos-null