Add Ericsson Sy selector for sniffing (disect selector for tshark)
[anna.git] / example / diameter / launcher / deployments / st-client / program.sh
index fccfe07..fb31cca 100755 (executable)
@@ -22,12 +22,15 @@ _exit() {
 usage() {
   echo "Usage: $0 <test stuff directory> [-s]"
   echo
+  echo "       Performs test case programming from scratch (current test cases will be dropped from ADML involved instances)."
+  echo
   echo "       test stuff directory: contains msk files, specially a testcase description with xml files referenced."
   echo "                             Those files, adding .msk extension, shall exists in the same directory. For example:"
+  echo
   echo "                                $0 st_examples/DynamicQualification"
   echo
   echo "       -s: start testing just after programming, using desired rate: $DESIRED_RATE test cases per second."
-  [ $ADML_INSTANCES -gt 1 ] && echo "           In your case, with $ADML_INSTANCES, a rate of $RATE_PER_INSTANCE ttps will be send per instance"
+  [ $ADML_INSTANCES -gt 1 ] && echo "           In your case, with $ADML_INSTANCES, a rate of $RATE_PER_INSTANCE ttps will be send per instance."
   echo
   _exit
 }
@@ -52,6 +55,8 @@ miss_conf=
 
 echo
 [ -z "$1" ] && usage
+./operation.sh --ping
+[ $? -ne 0 ] && _exit "Programming aborted (some ADML client process is not running) !"
 TESTCASE_DIR=$1
 AUTOSTART=$2
 
@@ -60,14 +65,18 @@ TESTCASE=( `ls $TESTCASE_DIR/testcase*msk 2>/dev/null` )
 TESTCASE_FILES=${#TESTCASE[@]}
 [ $TESTCASE_FILES -ne 1 ] && _exit "One and only one 'testcase*msk' file must be present !!"
 
+MAX_NUMBER_GROUPS=$(grep ^MAX_NUMBER_GROUPS= clone.sh | cut -d= -f2)
+CLONE_GROUPS=$((MAX_NUMBER_GROUPS/ADML_INSTANCES))
+#CLONE_GROUPS=1
+
 children_before=$(children)
 while read -r line
 do
   instance=$(echo $line | awk '{ print $1 }')
   ini_seq=$(echo $line | awk '{ print $2 }')
   fin_seq=$(echo $line | awk '{ print $3 }')
-  ADML_DIR=`readlink -f ADMLS/$instance`
-  ./clone.sh $ADML_DIR $TESTCASE $ini_seq $fin_seq 1 &
+  ADML_DIR=`readlink -f ADMLS/ADML-$instance`
+  ./clone.sh $ADML_DIR $TESTCASE $ini_seq $fin_seq $CLONE_GROUPS &
 
 done < $PROGRAM_LAYOUT_FILE
 
@@ -80,9 +89,15 @@ do
   sleep 1
 done
 
+echo
+echo "Programming has finished !"
+echo
+
 echo "Configuring repeat cycles ..."
 ./operation.sh "test|repeats|$REPEATS"
 
+echo
+echo
 start_testing=
 if [ "$AUTOSTART" = "-s" ]
 then
@@ -95,6 +110,9 @@ else
     rate_per_instance=$((desired_rate/$ADML_INSTANCES))
     [ $rate_per_instance -lt 1 ] && rate_per_instance=1
     ./operation.sh "test|ttps|$rate_per_instance"
+  else
+    echo "Remember that you could start traffic using:"
+    echo "   ./operation.sh \"test|ttps|<test cases per second rate>\""
   fi
 fi