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 {
[ ! -f $ONOS_ROOT/tools/test/cells/$1 ] && \
echo "No such cell: $1" >&2 && return 1
unset ONOS_CELL ONOS_NIC ONOS_FEATURES ONOS_USER ONOS_GROUP
unset OC0 OC1 OC2 OC3 OC4 OC5 OC6 OC7 OC8 OC9 OCN OCI
unset OCI OCN
unset $(env | sed -n 's:\(^OC[0-9]\{1,\}\)=.*:\1 :g p')
export ONOS_CELL=$1
. $ONOS_ROOT/tools/test/cells/$1
cell
......
......@@ -49,7 +49,7 @@ function getcmd() {
# 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
......
......@@ -42,7 +42,9 @@ fi
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}"
......