Update cell related util scripts to support larger cluster [ONOS-467]
Change-Id: Ie182397b7da92212cdaf6e1622b1482408b6de59
diff --git a/tools/test/bin/onos-group b/tools/test/bin/onos-group
index 0e6b396..150f947 100755
--- a/tools/test/bin/onos-group
+++ b/tools/test/bin/onos-group
@@ -49,7 +49,7 @@
# early sanity check for instances/arguments
[ -z "$1" ] && usage && exit 0
-OCIS=( $(env | sed -ne 's:OC[0-9]=\(.*\):\1 :g p' | sort -k1) )
+OCIS=( $(env | sed -ne 's:OC[0-9]\{1,\}=\(.*\):\1 :g p' | sort -k1) )
if [ -z "$OCIS" ]; then
printf "no controller instances, quitting early" >&2 && exit 0
fi
diff --git a/tools/test/bin/onos-show-cell b/tools/test/bin/onos-show-cell
index 559ecaf..3b11a1d 100755
--- a/tools/test/bin/onos-show-cell
+++ b/tools/test/bin/onos-show-cell
@@ -42,7 +42,9 @@
echo "ONOS_CELL=${ONOS_CELL}"
echo "ONOS_NIC=${ONOS_NIC}"
-for n in {0..9}; do
+# get number of OC variables
+max=$( env | egrep 'OC[0-9]+' | wc -l )
+for n in $( seq 0 ${max} ); do
ocn="OC${n}"
if [ -n "${!ocn}" ]; then
echo "$ocn=${!ocn}"