Tweaking onos-* test scripts.
diff --git a/tools/build/onos-package b/tools/build/onos-package
index ae78091..d35a48b 100755
--- a/tools/build/onos-package
+++ b/tools/build/onos-package
@@ -50,8 +50,8 @@
$ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg
# Patch the Apache Karaf distribution file to load ONOS features
-perl -pi.old -e 's|^(featuresBoot=.*)|\1,onos-api,onos-core,onos-cli,onos-rest,onos-gui,onos-openflow,onos-app-tvue,onos-app-fwd|' \
- $ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg
+#perl -pi.old -e 's|^(featuresBoot=.*)|\1,onos-api,onos-core,onos-cli,onos-rest,onos-gui,onos-openflow,onos-app-tvue,onos-app-fwd|' \
+# $ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg
# Patch the Apache Karaf distribution with ONOS branding bundle
cp $M2_REPO/org/onlab/onos/onos-branding/$ONOS_VERSION/onos-branding-*.jar \
diff --git a/tools/dev/bash_profile b/tools/dev/bash_profile
index de0ed1e..f6c427a 100644
--- a/tools/dev/bash_profile
+++ b/tools/dev/bash_profile
@@ -45,20 +45,35 @@
# Test related conveniences
-# Default virtual box ONOS instances 1,2 & 3
-export OC1="192.168.56.101"
-export OC2="192.168.56.102"
-export OC3="192.168.56.103"
-
-# Default instance is #1
-export OCI="$OC1"
-
# SSH to a specified ONOS instance
function sshctl {
[ -n "$1" ] && OCI=$1 && shift
ssh -Y sdn@$OCI "$@"
}
+# Applies the settings in the specified cell file or lists current cell definition
+# if no cell file is given.
+function cell {
+ if [ -n "$1" ]; then
+ [ ! -f $ONOS_ROOT/tools/test/cells/$1 ] && \
+ echo "No such cell: $1" >&2 && return 1
+ . $ONOS_ROOT/tools/test/cells/$1
+ export OCI=$OC1
+ export ONOS_CELL=$1
+ cell
+ else
+ env | egrep "ONOS_CELL"
+ env | egrep "OCI"
+ env | egrep "OC[0-9]+" | sort
+ fi
+}
+
+cell local >/dev/null # Default cell is the local VMs
+
+# Lists available cells
+function cells {
+ ls -1 $ONOS_ROOT/tools/test/cells
+}
# Miscellaneous
function spy {
diff --git a/tools/package/etc/hazelcast.xml b/tools/package/etc/hazelcast.xml
index 5cb41ba..abd6223 100644
--- a/tools/package/etc/hazelcast.xml
+++ b/tools/package/etc/hazelcast.xml
@@ -38,7 +38,7 @@
</aws>
</join>
<interfaces enabled="true">
- <interface>10.1.9.*</interface>
+ <interface>192.168.56.*</interface>
</interfaces>
<ssl enabled="false"/>
<socket-interceptor enabled="false"/>
diff --git a/tools/test/bin/onos-install b/tools/test/bin/onos-install
index 9e17c76..d8e0522 100755
--- a/tools/test/bin/onos-install
+++ b/tools/test/bin/onos-install
@@ -7,22 +7,60 @@
. $ONOS_ROOT/tools/build/envDefaults
# If the first option is -f attempt uninstall first.
-[ "$1" = "-f" ] && shift && onos-uninstall ${1:-$OCI}
+[ "$1" = "-f" ] && shift && echo 'Uninstalling...' && onos-uninstall ${1:-$OCI}
remote=$ONOS_USER@${1:-$OCI}
scp -q $ONOS_TAR $remote:/tmp
+LOG=$ONOS_INSTALL_DIR/install.log
+onos=$ONOS_INSTALL_DIR/bin/onos
+
ssh $remote "
[ -d $ONOS_INSTALL_DIR/bin ] && echo \"ONOS is already installed\" && exit 1
# Prepare a landing zone and unroll the bits
+ echo 'Unpacking...'
sudo mkdir -p $ONOS_INSTALL_DIR && sudo chown sdn:sdn $ONOS_INSTALL_DIR
tar zxmf /tmp/$ONOS_BITS.tar.gz -C $ONOS_INSTALL_DIR --strip-components=1
# Make a link to the log file directory.
- ln -s /opt/onos/$KARAF_DIST/data/log /opt/onos/log
+ ln -s $ONOS_INSTALL_DIR/$KARAF_DIST/data/log /opt/onos/log
# TODO: Setup ONOS to run as a daemon; for now we at least startup
- nohup /opt/onos/bin/onos-ctl server </dev/null 1>/opt/onos/svc.log 2>&1 &
+ echo 'Starting...'
+ nohup $ONOS_INSTALL_DIR/bin/onos-ctl server </dev/null | 1>/opt/onos/svc.log 2>&1 &
+
+ # Wait until we reach the run-level 100
+ echo 'Waiting for cluster bootstrap...'
+ running=""
+ while [ -z \$running ]; do
+ $onos bundle:list 2>>$LOG | grep -q 'START LEVEL 100' && running=1 || sleep 2
+ done
+
+ # Now create group onos and join it, while quitting the default one
+ if ! $onos cluster:group-list 2>>$LOG | cut -d \\ -f3 | grep -q onos; then
+ echo 'Creating ONOS group...'
+ installRole=primary
+ $onos cluster:group-create onos 1>>$LOG 2>&1
+ fi
+
+ echo 'Configuring group membership...'
+ node=\$($onos cluster:node-list 2>>$LOG | grep '^x' | cut -d \\ -f3)
+ $onos cluster:group-join onos \$node 1>>$LOG 2>&1
+ $onos cluster:group-quit default \$node 1>>$LOG 2>&1
+
+ if [ X\$installRole = Xprimary ]; then
+ echo 'Installing ONOS bundles...'
+ $onos cluster:feature-install onos onos-api 1>>$LOG 2>&1
+ $onos cluster:feature-install onos onos-core 1>>$LOG 2>&1
+ $onos cluster:feature-install onos onos-openflow 1>>$LOG 2>&1
+ $onos cluster:feature-install onoe onos-cli 1>>$LOG 2>&1
+ # $onos cluster:feature-install onos onos-gui 1>>$LOG 2>&1
+ # $onos cluster:feature-install onos onos-rest 1>>$LOG 2>&1
+ $onos cluster:feature-install onos onos-app-tvue 1>>$LOG 2>&1
+ $onos cluster:feature-install onos onos-app-fwd 1>>$LOG 2>&1
+ fi
+
+ echo 'Started...'
"