Adding support for enhanced cell spec, e.g. 5+3+1
Change-Id: I9d23eb766eb72e559366f974afc2ec0838f82270
diff --git a/tools/dev/bash_profile b/tools/dev/bash_profile
index ab95905..8ae6b47 100644
--- a/tools/dev/bash_profile
+++ b/tools/dev/bash_profile
@@ -175,6 +175,7 @@
# Sets the primary instance to the specified instance number.
function setPrimaryInstance {
export ONOS_INSTANCES=$(env | grep 'OC[0-9]*=' | sort | cut -d= -f2)
+ export ONOS_CORES=$(env | grep 'OCC[0-9]*=' | sort | cut -d= -f2)
export OCI=$(env | egrep "OC[0-9]+" | sort | egrep OC${1:-1} | cut -d= -f2)
echo $OCI
}
@@ -209,9 +210,10 @@
# Clears cell environment
function clearCell {
unset ONOS_CELL ONOS_NIC ONOS_IP ONOS_APPS ONOS_BOOT_FEATURES
- unset OCI OCN OCT ONOS_INSTANCES ONOS_FEATURES
+ unset OCI OCN OCT ONOS_INSTANCES ONOS_CORES ONOS_FEATURES
unset ONOS_USER ONOS_GROUP ONOS_WEB_USER ONOS_WEB_PASS
unset $(env | sed -n 's:\(^OC[0-9]\{1,\}\)=.*:\1 :g p')
+ unset $(env | sed -n 's:\(^OCC[0-9]\{1,\}\)=.*:\1 :g p')
unset $(env | sed -n 's:\(^OCMI[0-9]\{1,\}\)=.*:\1 :g p')
unset $(env | sed -n 's:\(^OCMA[0-9]\{1,\}\)=.*:\1 :g p')
}
@@ -226,7 +228,7 @@
aux="/tmp/cell-$$"
duration=${2:-0}
spec=${3:-3+1}
- spec=${spec/+/%2B}
+ spec=${spec//+/%2B}
user=${4:-$(id -un)}
hint=${5:-""}
query="duration=$duration&spec=$spec&user=$user&cellNameHint=$hint"
@@ -249,10 +251,10 @@
"")
env | egrep "^ONOS_CELL"
- env | egrep "^OCI"
+ env | egrep "^OCC[0-9]+" | sort
env | egrep "^OC[0-9]+" | sort
- env | egrep "^OC[NT]"
- env | egrep "^ONOS_" | egrep -v 'ONOS_ROOT|ONOS_CELL|ONOS_INSTANCES|ONOS_DEVICES|ONOS_HOSTS' | sort
+ env | egrep "^OC[INT]" | sort
+ env | egrep "^ONOS_" | egrep -v 'ONOS_ROOT|ONOS_CELL|ONOS_INSTANCES|ONOS_CORES|ONOS_DEVICES|ONOS_HOSTS' | sort
;;
*)
diff --git a/tools/test/bin/onos-verify-cell b/tools/test/bin/onos-verify-cell
index 72a23df..68fc924 100755
--- a/tools/test/bin/onos-verify-cell
+++ b/tools/test/bin/onos-verify-cell
@@ -8,7 +8,7 @@
let err=0
-for node in $OCT $OCN $(env | sort | egrep "^OC[0-9]+" | cut -d= -f2); do
+for node in $OCT $OCN $(env | sort | egrep "^OC[C]*[0-9]+" | cut -d= -f2); do
for i in {1..18}; do
printf "%s: " $node; ssh -n -q -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o ConnectTimeout=10 $ONOS_USER@$node hostname
if [ $? -eq 0 ]; then