#!/bin/bash
-# touch .operation_background to force background execution of every ADML instances operations "broadcasted"
cd `dirname $0`
if [ ! -d "ADMLS" ]
then
exit 1
fi
-BGROUND=
-[ -f .operation_background ] && BGROUND=yes
+if [ "$1" = "-h" -o "$1" = "--help" ]
+then
+ first_adml=$(ls -d ADMLS/* | head -n +1)
+ $first_adml/operation.sh help
+ exit 0
+fi
for op in `ls ADMLS/*/operation.sh`
do
cd $dn_op
echo -n "Instance `basename $dn_op`: "
0>launcher.trace
- if [ -n "$BGROUND" ]
- then
- ./operation.sh $@ &
- sleep 0.01
- else
- ./operation.sh $@
- [ $? -ne 0 ] && { echo ; exit 1 ; }
- fi
+ ./operation.sh $@ &
+ #[ $? -ne 0 ] && { echo ; exit 1 ; }
cd - >/dev/null
done
echo -n "${xml}|"
done | sed 's/'\|'$//')
+ # If still idle CPU, you could increase chunks number of background jobs
+ CHUNKS=10
+ echo "Dynamic programming ..."
+ echo
while read -r line
do
instance=$(echo $line | awk '{ print $1 }')
fin_seq=$(echo $line | awk '{ print $3 }')
ADML_DIR=`readlink -f ADMLS/ADML-$instance`
- cd $ADML_DIR
- ./operation.sh -t 60 "dynamic|$ini_seq|$fin_seq|$dynamic_suffix"
- cd - >/dev/null
+ cd $ADML_DIR
+ ./operation.sh -t 60 "dynamic|$ini_seq|$fin_seq|$dynamic_suffix" &
+ count=$((count+1))
+ [ $count -eq $CHUNKS ] && { wait $(jobs -p) ; count=1 ; }
+ cd - >/dev/null
done < $PROGRAM_LAYOUT_FILE
[ $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>\""
- echo
- echo "For example, to reach $DESIRED_RATE test cases per second:"
- echo " ./operation.sh \"test|ttps|$RATE_PER_INSTANCE\""
+ cat << EOF
+
+To start testing, you must use the './operation.sh' script. Use '-h'
+ to get detailed help. The most common commands used for testing are:
+
+ * Enable reports dump for failed tests:
+ ./operation.sh "test|report|failed"
+
+ * Launch traffic:
+ ./operation.sh "test|ttps|<test cases per second and instance(*)>"
+
+ (*) note: ttps value is related to a single instance: you should"
+ divide the desired CPS by the number of instances. For"
+ exampl, if you need $DESIRED_RATE test cases per second:
+
+ ./operation.sh "test|ttps|$RATE_PER_INSTANCE"
+
+ * Stop traffic:
+ ./operation.sh "test|ttps|0"
+
+ * Reset already classified (Success/Failed) test cases:
+ ./operation.sh "test|reset[|soft]"
+
+ * Reset also 'in-progress' state test cases:
+ ./operation.sh "test|reset|hard"
+
+Remember that './operation.sh' broadcasts the operation scripts along
+ the ADML instances, then some operations should better be used within
+ a specific 'ADMLS/ADML-<instance>' directory to avoid console spam,
+ for example:
+
+ * Check a testcase in runtime:
+ ADMLS/ADML-001/operation.sh "test|look|<test id>"
+
+ * Execute the next programmed test case:
+ ADMLS/ADML-001/operation.sh "test|next"
+
+ * Interactive-step execution:
+ ADMLS/ADML-001/operation.sh "test|interact|<steps to execute>|<test id>"
+
+ * Summary:
+ ADMLS/ADML-001/operation.sh "test|summary"
+
+EOF
+
fi
fi
done
echo
wait $(jobs -p)
-echo "$(pgrep ADML- | wc -l) instances alive !"
-echo
-echo
-echo "To enable reports dump for failed tests, execute:"
-echo " ./operation.sh \"test|report|failed\""
-echo
-echo "To stop the processes, you could execute:"
-echo " pgrep ADML-[0-9] | xargs kill"
-echo
-echo "When running, use script './program.sh' to configure the test cases."
-echo "To configure another layout you should execute './configure.sh'."
-echo
-echo "Done!"
+
+cat << EOF
+ $(pgrep ADML- | wc -l) instances alive !
+ $(netstat -a | grep :diameter | grep ESTABLISHED | wc -l) connections established !
+
+ To stop the processes, you could execute: pgrep ADML-[0-9] | xargs kill
+ Anyway, executing './run.sh' again you will restart the ADML instances.
+
+ Now it's time to './program.sh' the started instances with the desired
+ scenary. There are two programming variants:
+
+ ./program.sh <test stuff directory>
+ ./program.sh dynamic
+
+
+ Done!
+EOF
+
echo