tom

Added a number of test tools.

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