Changes to docker file and cluster creation, complete stc test on single instance, but not yet on multi-instances Alao, we add detailed checking for every step in ODTN testing.
Change-Id: Id074e2db89a8892ed263880cfa670c4861e011b9
diff --git a/tools/test/scenarios/odtn/checkUntilSucc.sh b/tools/test/scenarios/odtn/checkUntilSucc.sh
new file mode 100755
index 0000000..808ac0e
--- /dev/null
+++ b/tools/test/scenarios/odtn/checkUntilSucc.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# This script is used to execute some checking commands in period to confirm whether specific requirement is satisfied.
+# $1 - the command to be executed in this script, whose parameter splitter is +, but ont space. This command could use |, &&, || to concatenate multiple shell commands.
+# $2 - Optional. If exists, it means the output (Note: not returned value) of $1 should equals $2.
+
+cmd=${1//'+'/' '}
+if [ $# == 1 ]; then
+ for i in {1..60}; do
+ eval ${cmd}
+ rtn=$?
+ if [[ ${rtn} -ne 0 ]]
+ then
+ echo "$i-th execution returns $rtn"
+ sleep 3
+ else
+ exit 0
+ fi
+ done
+elif [ $# == 2 ]; then
+ for i in {1..60}; do
+ out=`eval ${cmd}`
+ rtn=$?
+ if [[ ${rtn} -ne 0 || "$out" != $2 ]]; then
+ echo "$i-th execution fails"
+ sleep 3
+ else
+ exit 0
+ fi
+ done
+fi