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')}
# ONOS Version and onos.tar.gz staging environment
export ONOS_POM_VERSION="1.1.0-SNAPSHOT"
export ONOS_VERSION=${ONOS_VERSION:-1.1.0.$BUILD_NUMBER}
# ONOS production bits (onos.tar.gz & onos.zip) staging environment
export ONOS_BITS=onos-${ONOS_VERSION%~*}
export ONOS_STAGE_ROOT=${ONOS_STAGE_ROOT:-/tmp}
export ONOS_STAGE=$ONOS_STAGE_ROOT/$ONOS_BITS
export ONOS_TAR=$ONOS_STAGE.tar.gz
export ONOS_ZIP=$ONOS_STAGE.zip
# ONOS test bits (onos-test.tar.gz) staging environment
export ONOS_TEST_BITS=onos-test-${ONOS_VERSION%~*}
export ONOS_TEST_STAGE_ROOT=${ONOS_TEST_STAGE_ROOT:-/tmp}
export ONOS_TEST_STAGE=$ONOS_STAGE_ROOT/$ONOS_TEST_BITS
export ONOS_TEST_TAR=$ONOS_TEST_STAGE.tar.gz
# Defaults for ONOS testing using remote machines.
# if [ -n "${ONOS_CELL}" -a -f $ONOS_ROOT/tools/test/cells/${ONOS_CELL} ]; then
# . $ONOS_ROOT/tools/test/cells/${ONOS_CELL}
......
#!/bin/bash
# -----------------------------------------------------------------------------
# Packages ONOS distributable into onos.tar.gz
# Packages ONOS distributable into onos.tar.gz and onos.zip
# -----------------------------------------------------------------------------
[ ! -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
$KARAF_DIST/system/org/onosproject/$artifact/$ONOS_POM_VERSION
done
export ONOS_FEATURES="${ONOS_FEATURES:-webconsole,onos-api,onos-core,onos-cli,onos-rest,onos-gui,onos-openflow,onos-app-fwd,onos-app-foo}"
# ONOS Patching ----------------------------------------------------------------
# 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
$ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg
# Patch the Apache Karaf distribution file to load ONOS features
export ONOS_FEATURES="webconsole,onos-api,onos-core,onos-cli,onos-rest,onos-gui,onos-openflow"
perl -pi.old -e "s|^(featuresBoot=.*)|\1,$ONOS_FEATURES|" \
$ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg
......
#!/bin/bash
# -----------------------------------------------------------------------------
# Packages ONOS test facilities into onos-test.tar.gz
# -----------------------------------------------------------------------------
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
. $ONOS_ROOT/tools/build/envDefaults
# Bail on any errors
set -e
rm -fr $ONOS_TEST_STAGE # Remove this when package script is completed
# Create the stage directory and warp into it
mkdir -p $ONOS_TEST_STAGE/tools/test \
$ONOS_TEST_STAGE/tools/dev \
$ONOS_TEST_STAGE/tools/build \
$ONOS_TEST_STAGE/tools/package/config
cp -r $ONOS_ROOT/tools/test $ONOS_TEST_STAGE/tools
cp $ONOS_ROOT/tools/dev/bash_profile $ONOS_TEST_STAGE/tools/dev
cp $ONOS_ROOT/tools/build/envDefaults $ONOS_TEST_STAGE/tools/build
cd $ONOS_TEST_STAGE_ROOT
# Now package up the ONOS test tools tar file
COPYFILE_DISABLE=1 tar zcf $ONOS_TEST_TAR $ONOS_TEST_BITS
cd $ONOS_TEST_STAGE_ROOT
# rm -r $ONOS_TEST_STAGE
......@@ -8,6 +8,10 @@
remote=$ONOS_USER@${1:-$OCI}
# Customize features
export ONOS_FEATURES="${ONOS_FEATURES:-webconsole,onos-api,onos-core,onos-cli,onos-rest,onos-gui,onos-openflow}"
# Generate a cluster.json from the ON* environment variables
CDEF_FILE=/tmp/${remote}.cluster.json
echo "{ \"ipPrefix\": \"$ONOS_NIC\"," > $CDEF_FILE
......@@ -35,6 +39,10 @@ ssh $remote "
# Suppress Hazelcast multicast joiner warning
echo "log4j.logger.com.hazelcast.cluster.impl.MulticastService= ERROR" \
>> $ONOS_INSTALL_DIR/$KARAF_DIST/etc/org.ops4j.pax.logging.cfg
# Patch the Apache Karaf distribution file to load ONOS features
perl -pi.old -e \"s|^(featuresBoot=.*,management)(,webconsole,.*)|\1,$ONOS_FEATURES|\" \
$ONOS_INSTALL_DIR/$KARAF_DIST/etc/org.apache.karaf.features.cfg
"
# Generate a default tablets.json from the ON* environment variables
......@@ -42,7 +50,6 @@ TDEF_FILE=/tmp/${remote}.tablets.json
onos-gen-partitions $TDEF_FILE
scp -q $TDEF_FILE $remote:$ONOS_INSTALL_DIR/config/tablets.json
# copy tools/package/config/ to remote
scp -qr ${ONOS_ROOT}/tools/package/config/ $remote:$ONOS_INSTALL_DIR/
......
#!/bin/bash
# -----------------------------------------------------------------------------
# Remotely pushes test bits to a remote test machine and unrolls them in /tmp
# -----------------------------------------------------------------------------
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
. $ONOS_ROOT/tools/build/envDefaults
node=${1:-$OCI}
remote=$ONOS_USER@$node
scp -q $ONOS_TEST_TAR $remote:/tmp
ssh $remote "
rm -f /tmp/onos $ONOS_TEST_BITS
cd /tmp && tar zxf $ONOS_TEST_BITS.tar.gz && ln -s $ONOS_TEST_BITS onos
"
# Bare metal cluster
# Use the 10G NIC for cluster communications
export ONOS_NIC="192.168.200.*"
# ONOS Test proxy
export OCT=192.168.200.101
# Use the 1G NICs for external access
export OC1=192.168.200.101
export OC2=192.168.200.102
export OC3=192.168.200.103
export OC4=192.168.200.104
export OC5=192.168.200.105
export OC6=192.168.200.106
export OC7=192.168.200.107
export OCI=${OC1}
export ONOS_FEATURES=webconsole,onos-api,onos-core,onos-cli,onos-rest,onos-null