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 " test stuff directory: contains msk files, specially a testcase file with xml files referenced inside. Those"
+ echo " xml files (without the .msk extension) shall exists in the directory. For example:"
echo
echo " $0 st_examples/DynamicQualification"
echo
+ echo " Optionally, a file called 'specific' could exists containing testcase-specific information,"
+ echo " which normally will be used to specify database sentences. This file will be accumulated"
+ echo " as a cloning seed over the file 'specific.all' created on test stuff directory."
+ echo
+ 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."
echo
_exit
}
-children () {
- bash_pid=$$
- children=`ps -eo ppid | grep -w $bash_pid`
- echo $children | wc -w
-}
-
-
#############
# EXECUTION #
#############
echo
[ -z "$1" ] && usage
-./operation.sh --ping
+echo "Starting testcases programming ..."
+echo
+
+./operation.sh --ping >/dev/null
[ $? -ne 0 ] && _exit "Programming aborted (some ADML client process is not running) !"
TESTCASE_DIR=$1
AUTOSTART=$2
MAX_NUMBER_GROUPS=$(grep ^MAX_NUMBER_GROUPS= clone.sh | cut -d= -f2)
CLONE_GROUPS=$((MAX_NUMBER_GROUPS/ADML_INSTANCES))
#CLONE_GROUPS=1
+specific=
+[ -f $TESTCASE_DIR/specific ] && specific=specific
+
+[ -z "$ADML_CONCURRENT_PROVISION_JOBS" ] && ADML_CONCURRENT_PROVISION_JOBS=5
-children_before=$(children)
+count=0
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/ADML-$instance`
- ./clone.sh $ADML_DIR $TESTCASE $ini_seq $fin_seq $CLONE_GROUPS &
+ echo -e "\rCloning interval [$ini_seq,$fin_seq] for $(basename $ADML_DIR) ..."
+ ./clone.sh $ADML_DIR $TESTCASE $ini_seq $fin_seq $CLONE_GROUPS $specific &
+ sleep 0.1
+ 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
# Wait background jobs to finish:
-sleep 1
+sleep 5
echo "Waiting for clone completion ..."
-while true
-do
- [ $(children) -eq $children_before ] && break
- sleep 1
-done
+echo "(please be patient, this may take a while)"
+echo
+echo "Background Jobs: $(jobs -p | wc -l)"
+wait $(jobs -p)
echo
echo "Programming has finished !"
echo "Configuring repeat cycles ..."
./operation.sh "test|repeats|$REPEATS"
+if [ -n "$specific" ]
+then
+ echo "A new file '$TESTCASE_DIR/specific.all' has been created."
+ echo "Probably you need to apply it before starting traffic."
+ echo
+ echo "Press ENTER to continue, CTRL-C to abort ..."
+ read dummy
+fi
+
echo
echo
start_testing=
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\""
fi
fi