Changing stc scenarios to be compatible with multiple links in the ATT MPLS test topology.
Change-Id: I9ee8fd9a3279a0d59f837569a7ada0eb77fd1d41
diff --git a/tools/test/bin/onos-mininet b/tools/test/bin/onos-mininet
index 5f11fd0..44d489b 100755
--- a/tools/test/bin/onos-mininet
+++ b/tools/test/bin/onos-mininet
@@ -6,6 +6,8 @@
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
. $ONOS_ROOT/tools/build/envDefaults
+export MAX_WAIT=45
+
cmd="$1" && shift
log="screenlog.0"
remote="$ONOS_USER@$OCN"
@@ -25,8 +27,9 @@
wait)
ssh $remote "
- sleep 1 && while test ! -f $log; do sleep 1; done
- while ! (tail -n1 $log | egrep -q '^mininet>'); do sleep 1; done
+ let count=0
+ sleep 1 && while test ! -f $log; do if test \$count -ge $MAX_WAIT; then exit 1; fi; sleep 1; let count=count+1; done
+ while ! (tail -n1 $log | egrep -q '^mininet>'); do if [ \$count -ge $MAX_WAIT ]; then exit 1; fi; sleep 1; done
sleep ${1-:1}
"
;;
@@ -36,7 +39,8 @@
ssh $remote "
sleep 1
if [ ! -f $log ]; then exit 1; fi;
- while ! (tail -n1 $log | egrep -q '^mininet>'); do sleep 1; done
+ let count=0
+ while ! (tail -n1 $log | egrep -q '^mininet>'); do if test \$count -ge $MAX_WAIT; then exit 1; fi; sleep 1; let count=count+1; done
tac $log | awk '{ print \$0; } /^mininet>/ { if (on) { exit 0; } on=1; }' | tac > $aux
cat $aux
set -x