Ayaka Koshibe
Committed by Yuta Higuchi

Update cell related util scripts to support larger cluster [ONOS-467]

Change-Id: Ie182397b7da92212cdaf6e1622b1482408b6de59
...@@ -78,7 +78,8 @@ function cell { ...@@ -78,7 +78,8 @@ function cell {
78 [ ! -f $ONOS_ROOT/tools/test/cells/$1 ] && \ 78 [ ! -f $ONOS_ROOT/tools/test/cells/$1 ] && \
79 echo "No such cell: $1" >&2 && return 1 79 echo "No such cell: $1" >&2 && return 1
80 unset ONOS_CELL ONOS_NIC ONOS_FEATURES ONOS_USER ONOS_GROUP 80 unset ONOS_CELL ONOS_NIC ONOS_FEATURES ONOS_USER ONOS_GROUP
81 - unset OC0 OC1 OC2 OC3 OC4 OC5 OC6 OC7 OC8 OC9 OCN OCI 81 + unset OCI OCN
82 + unset $(env | sed -n 's:\(^OC[0-9]\{1,\}\)=.*:\1 :g p')
82 export ONOS_CELL=$1 83 export ONOS_CELL=$1
83 . $ONOS_ROOT/tools/test/cells/$1 84 . $ONOS_ROOT/tools/test/cells/$1
84 cell 85 cell
......
...@@ -49,7 +49,7 @@ function getcmd() { ...@@ -49,7 +49,7 @@ function getcmd() {
49 # early sanity check for instances/arguments 49 # early sanity check for instances/arguments
50 [ -z "$1" ] && usage && exit 0 50 [ -z "$1" ] && usage && exit 0
51 51
52 -OCIS=( $(env | sed -ne 's:OC[0-9]=\(.*\):\1 :g p' | sort -k1) ) 52 +OCIS=( $(env | sed -ne 's:OC[0-9]\{1,\}=\(.*\):\1 :g p' | sort -k1) )
53 if [ -z "$OCIS" ]; then 53 if [ -z "$OCIS" ]; then
54 printf "no controller instances, quitting early" >&2 && exit 0 54 printf "no controller instances, quitting early" >&2 && exit 0
55 fi 55 fi
......
...@@ -42,7 +42,9 @@ fi ...@@ -42,7 +42,9 @@ fi
42 42
43 echo "ONOS_CELL=${ONOS_CELL}" 43 echo "ONOS_CELL=${ONOS_CELL}"
44 echo "ONOS_NIC=${ONOS_NIC}" 44 echo "ONOS_NIC=${ONOS_NIC}"
45 -for n in {0..9}; do 45 +# get number of OC variables
46 +max=$( env | egrep 'OC[0-9]+' | wc -l )
47 +for n in $( seq 0 ${max} ); do
46 ocn="OC${n}" 48 ocn="OC${n}"
47 if [ -n "${!ocn}" ]; then 49 if [ -n "${!ocn}" ]; then
48 echo "$ocn=${!ocn}" 50 echo "$ocn=${!ocn}"
......