tom

Added a number of test tools.

...@@ -6,6 +6,7 @@ export ONOS_ROOT=${ONOS_ROOT:-~/onos-next} ...@@ -6,6 +6,7 @@ export ONOS_ROOT=${ONOS_ROOT:-~/onos-next}
6 # M2 repository and Karaf gold bits 6 # M2 repository and Karaf gold bits
7 export M2_REPO=${M2_REPO:-~/.m2/repository} 7 export M2_REPO=${M2_REPO:-~/.m2/repository}
8 export KARAF_ZIP=${KARAF_ZIP:-~/Downloads/apache-karaf-3.0.1.zip} 8 export KARAF_ZIP=${KARAF_ZIP:-~/Downloads/apache-karaf-3.0.1.zip}
9 +export KARAF_TAR=${KARAF_TAR:-~/Downloads/apache-karaf-3.0.1.tar.gz}
9 export KARAF_DIST=$(basename $KARAF_ZIP .zip) 10 export KARAF_DIST=$(basename $KARAF_ZIP .zip)
10 11
11 # ONOS Version and onos.tar.gz staging environment 12 # ONOS Version and onos.tar.gz staging environment
......
...@@ -13,7 +13,7 @@ rm -fr $ONOS_STAGE # Remove this when package script is completed ...@@ -13,7 +13,7 @@ rm -fr $ONOS_STAGE # Remove this when package script is completed
13 13
14 # Make sure we have the original apache karaf bits first 14 # Make sure we have the original apache karaf bits first
15 [ ! -d $M2_REPO ] && echo "M2 repository $M2_REPO not found" && exit 1 15 [ ! -d $M2_REPO ] && echo "M2 repository $M2_REPO not found" && exit 1
16 -[ ! -f $KARAF_ZIP ] && echo "Apache Karaf bits $KARAF_ZIP not found" && exit 1 16 +[ ! -f $KARAF_ZIP -a ! -f $KARAF_TAR ] && echo "Apache Karaf bits $KARAF_ZIP or $KARAF_TAR not found" && exit 1
17 [ -d $ONOS_STAGE ] && echo "ONOS stage $ONOS_STAGE already exists" && exit 1 17 [ -d $ONOS_STAGE ] && echo "ONOS stage $ONOS_STAGE already exists" && exit 1
18 18
19 # Create the stage directory and warp into it 19 # Create the stage directory and warp into it
...@@ -21,7 +21,8 @@ mkdir -p $ONOS_STAGE ...@@ -21,7 +21,8 @@ mkdir -p $ONOS_STAGE
21 cd $ONOS_STAGE 21 cd $ONOS_STAGE
22 22
23 # Unroll the Apache Karaf bits, prune them and make ONOS top-level directories. 23 # Unroll the Apache Karaf bits, prune them and make ONOS top-level directories.
24 -unzip -q $KARAF_ZIP && rm -rf $KARAF_DIST/demos 24 +[ -f $KARAF_ZIP ] && unzip -q $KARAF_ZIP && rm -rf $KARAF_DIST/demos
25 +[ -f $KARAF_TAR ] && tar zxf $KARAF_TAR && rm -rf $KARAF_DIST/demos
25 mkdir bin 26 mkdir bin
26 27
27 # Stage the ONOS admin scripts and patch in Karaf service wrapper extras 28 # Stage the ONOS admin scripts and patch in Karaf service wrapper extras
......
...@@ -21,7 +21,8 @@ ssh $remote " ...@@ -21,7 +21,8 @@ ssh $remote "
21 21
22 echo 'Installing ONOS bundles...' 22 echo 'Installing ONOS bundles...'
23 $onos cluster:feature-install default onos-api 1>>$LOG 2>&1 23 $onos cluster:feature-install default onos-api 1>>$LOG 2>&1
24 - $onos cluster:feature-install default onos-core 1>>$LOG 2>&1 24 + # $onos cluster:feature-install default onos-core 1>>$LOG 2>&1
25 + $onos cluster:feature-install default onos-core-trivial 1>>$LOG 2>&1
25 $onos cluster:feature-install default onos-openflow 1>>$LOG 2>&1 26 $onos cluster:feature-install default onos-openflow 1>>$LOG 2>&1
26 $onos cluster:feature-install default onos-cli 1>>$LOG 2>&1 27 $onos cluster:feature-install default onos-cli 1>>$LOG 2>&1
27 # $onos cluster:feature-install default onos-gui 1>>$LOG 2>&1 28 # $onos cluster:feature-install default onos-gui 1>>$LOG 2>&1
......
...@@ -27,6 +27,9 @@ ssh $remote " ...@@ -27,6 +27,9 @@ ssh $remote "
27 # Install the upstart configuration file. 27 # Install the upstart configuration file.
28 sudo cp $ONOS_INSTALL_DIR/debian/onos.conf /etc/init/onos.conf 28 sudo cp $ONOS_INSTALL_DIR/debian/onos.conf /etc/init/onos.conf
29 29
30 + # Remove any previous ON.Lab bits from ~/.m2 repo
31 + rm -fr ~/.m2/repository/org/onlab
32 +
30 # Ignite the ONOS service. 33 # Ignite the ONOS service.
31 sudo service onos start 34 sudo service onos start
32 " 35 "
......
1 +#!/bin/bash
2 +#-------------------------------------------------------------------------------
3 +# Remotely patches the ONOS VM to tailor its hostname.
4 +#-------------------------------------------------------------------------------
5 +
6 +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7 +. $ONOS_ROOT/tools/build/envDefaults
8 +
9 +address=${1:-$OCI}
10 +remote=$ONOS_USER@$address
11 +name=${2:-onos-1}
12 +
13 +[ -z "$address" ] && echo "Null address not allowed" >&2 && exit 1
14 +[ -z "$name" ] && echo "Null name not allowed" >&2 && exit 1
15 +
16 +ssh $remote "
17 + sudo perl -pi.bak -e \"s/127.0.1.1.*/127.0.1.1 $name/g\" /etc/hosts
18 + sudo echo $name /etc/hostname
19 + sudo hostname $name
20 +"
...\ No newline at end of file ...\ No newline at end of file
1 +#!/bin/bash
2 +#-------------------------------------------------------------------------------
3 +# Pushes the local id_rsa.pub to the remote ONOS host authorized_keys.
4 +#-------------------------------------------------------------------------------
5 +
6 +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7 +. $ONOS_ROOT/tools/build/envDefaults
8 +
9 +remote=$ONOS_USER@${1:-$OCI}
10 +
11 +scp -q ~/.ssh/id_rsa.pub $remote:/tmp
12 +ssh $remote "cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys"
13 +ssh -n -o PasswordAuthentication=no $remote true
1 +#!/bin/bash
2 +#-------------------------------------------------------------------------------
3 +# Verifies connectivity to each node in ONOS cell.
4 +#-------------------------------------------------------------------------------
5 +
6 +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7 +. $ONOS_ROOT/tools/build/envDefaults
8 +
9 +for node in $(env | sort | egrep "OC[0-9]+" | cut -d= -f2); do
10 + printf "%s: " $node; ssh -n -o PasswordAuthentication=no $ONOS_USER@$node date
11 +done
...\ No newline at end of file ...\ No newline at end of file
1 +#!/bin/bash
2 +#-------------------------------------------------------------------------------
3 +# Waits for ONOS to reach run-level 100.
4 +#-------------------------------------------------------------------------------
5 +
6 +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7 +. $ONOS_ROOT/tools/build/envDefaults
8 +
9 +remote=$ONOS_USER@${1:-$OCI}
10 +
11 +ssh $remote "
12 + # Wait until we reach the run-level 100
13 + running=""
14 + while [ -z \$running ]; do
15 + $ONOS_INSTALL_DIR/bin/onos bundle:list 2>/dev/null | \
16 + grep -q 'START LEVEL 100' && running=1 || sleep 2
17 + done
18 +
19 +"