DESIRED_RATE=`cat .st_conf_desired_rate 2>/dev/null`
REPEATS=`cat .st_conf_cycle_repeats 2>/dev/null`
PROGRAM_LAYOUT_FILE=.st_conf_n_testcases_program_layout
+[ -z "$ADML_CONCURRENT_PROVISION_JOBS" ] && ADML_CONCURRENT_PROVISION_JOBS=10
#############
# FUNCTIONS #
_exit
}
+advice_to_squeeze_idle_cpu () {
+ local idle=$(top -b -d 0.1 -n 2 | grep 'Cpu(s):'| tail -1 | awk '{print $8}' | sed 's/,/./')
+ sleep 10
+ echo
+ echo "Idle cpu now: $idle. Check the system CPU with top. If is not overcommited, consider"
+ echo " increase the environment variable 'ADML_CONCURRENT_PROVISION_JOBS' (now $ADML_CONCURRENT_PROVISION_JOBS)."
+ echo
+}
+
#############
# EXECUTION #
#############
specific=
[ -f $TESTCASE_DIR/specific ] && specific=specific
- [ -z "$ADML_CONCURRENT_PROVISION_JOBS" ] && ADML_CONCURRENT_PROVISION_JOBS=5
-
count=0
while read -r line
do
count=$((count+1))
if [ $count -eq $ADML_CONCURRENT_PROVISION_JOBS ]
then
- idle_cpu=$(top -b -d 0.1 -n 2 | grep 'Cpu(s):'| tail -1 |awk '{print $8}')
- echo
- echo "Idle cpu = $idle_cpu%"
- echo "if cpu is not overcommited, consider increase ADML_CONCURRENT_PROVISION_JOBS environment variable (now $ADML_CONCURRENT_PROVISION_JOBS)"
- echo
wait $(jobs -p)
count=0
fi
done < $PROGRAM_LAYOUT_FILE
+
+ # Advice for idle cpu:
+ advice_to_squeeze_idle_cpu
# Wait background jobs to finish:
sleep 5
suffixes=${#dynamic_suffix[@]}
if [ $suffixes -gt 1 ]
then
- echo "Detected $suffixes scenarios. Please, select the desired option:"
+ echo
+ echo "----------------------------------------------------------------"
+ cat $DYNAMIC_SUFFIX_FILE
+ echo "----------------------------------------------------------------"
+ echo
+ echo "Detected $suffixes scenarios:"
echo
tmpfile=$(mktemp)
opt=1
done > $tmpfile
cat $tmpfile
echo
+ echo "Select the desired option:"
read option
while [ -z "$option" ]; do read option ; done
dynamic_suffix=$(grep "^${option}) " $tmpfile | cut -d" " -f2-)
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
cd $ADML_DIR
./operation.sh -t 60 "dynamic|$ini_seq|$fin_seq|$dynamic_suffix" &
+ sleep 0.1
count=$((count+1))
- [ $count -eq $CHUNKS ] && { wait $(jobs -p) ; count=1 ; }
+ if [ $count -eq $ADML_CONCURRENT_PROVISION_JOBS ]
+ then
+ wait $(jobs -p)
+ count=1
+ fi
cd - >/dev/null
done < $PROGRAM_LAYOUT_FILE
+ # Advice for idle cpu:
+ advice_to_squeeze_idle_cpu
+
fi
echo
else
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"
+To start testing, you must use the './operation.sh' script. The most
+ common commands used for testing are:
- * Launch traffic:
- ./operation.sh "test|ttps|<test cases per second and instance(*)>"
+ - Enable reports dump for failed tests: ./operation.sh "test|report|failed"
+ - Launch traffic: ./operation.sh "test|ttps|<test ticks per second (*)>"
- (*) 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:
+ (*) this is related to a single instance, because operation script launched
+ here invokes every 'ADMLS/ADML-<instance>/operation.sh' counterpart
+ script. Then, you should divide the desired CPS by the number of
+ instances. For example, if you need $DESIRED_RATE test cases per second,
+ as you have $ADML_INSTANCES instances, then you should execute:
- ./operation.sh "test|ttps|$RATE_PER_INSTANCE"
+ ./operation.sh "test|ttps|$RATE_PER_INSTANCE"
- * Stop traffic:
- ./operation.sh "test|ttps|0"
+ - 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"
+ - Clear programmed test cases: ./operation.sh "test|clear"
- * 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
+Remember that './operation.sh' broadcasts the operation scripts inside
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"
+ a specific 'ADMLS/ADML-<instance>' directory to avoid console spam:
- * Interactive-step execution:
- ADMLS/ADML-001/operation.sh "test|interact|<steps to execute>|<test id>"
+ - 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"
- * Summary:
- ADMLS/ADML-001/operation.sh "test|summary"
+For a complete and detailed information, execute: ./operation.sh --help | less
EOF