6 ADML_INSTANCES=`cat .st_conf_adml_instances 2>/dev/null`
7 RATE_PER_INSTANCE=`cat .st_conf_rate_per_instance 2>/dev/null`
8 DESIRED_RATE=`cat .st_conf_desired_rate 2>/dev/null`
9 REPEATS=`cat .st_conf_cycle_repeats 2>/dev/null`
10 PROGRAM_LAYOUT_FILE=.st_conf_n_testcases_program_layout
23 echo "Usage: $0 <test stuff directory> [-s]"
25 echo " Performs test case programming from scratch (current test cases will be dropped from ADML involved instances)."
27 echo " test stuff directory: contains msk files, specially a testcase file with xml files referenced inside. Those"
28 echo " xml files (without the .msk extension) shall exists in the directory. For example:"
30 echo " $0 st_examples/DynamicQualification"
32 echo " Optionally, a file called 'specific' could exists containing testcase-specific information,"
33 echo " which normally will be used to specify database sentences. This file will be accumulated"
34 echo " as a cloning seed over the file 'specific.all' created on test stuff directory."
37 echo " -s: start testing just after programming, using desired rate: $DESIRED_RATE test cases per second."
38 [ $ADML_INSTANCES -gt 1 ] && echo " In your case, with $ADML_INSTANCES, a rate of $RATE_PER_INSTANCE ttps will be send per instance."
45 children=`ps -eo ppid | grep -w $bash_pid`
46 echo $children | wc -w
54 [ ! -f .st_conf_adml_instances ] && miss_conf=yes
55 [ ! -f .st_conf_n_testcases_program_layout ] && miss_conf=yes
56 [ ! -f .st_conf_cycle_repeats ] && miss_conf=yes
57 [ ! -f .st_conf_rate_per_instance ] && miss_conf=yes
58 [ ! -f .st_conf_desired_rate ] && miss_conf=yes
59 [ -n "$miss_conf" ] && _exit "You must run './configure.sh' script firtly !!"
64 [ $? -ne 0 ] && _exit "Programming aborted (some ADML client process is not running) !"
68 [ ! -d $TESTCASE_DIR ] && _exit "Cannot found the test directory '$TESTCASE_DIR' !!"
69 TESTCASE=( `ls $TESTCASE_DIR/testcase*msk 2>/dev/null` )
70 TESTCASE_FILES=${#TESTCASE[@]}
71 [ $TESTCASE_FILES -ne 1 ] && _exit "One and only one 'testcase*msk' file must be present !!"
73 MAX_NUMBER_GROUPS=$(grep ^MAX_NUMBER_GROUPS= clone.sh | cut -d= -f2)
74 CLONE_GROUPS=$((MAX_NUMBER_GROUPS/ADML_INSTANCES))
77 [ -f $TESTCASE_DIR/specific ] && specific=specific
79 children_before=$(children)
82 instance=$(echo $line | awk '{ print $1 }')
83 ini_seq=$(echo $line | awk '{ print $2 }')
84 fin_seq=$(echo $line | awk '{ print $3 }')
85 ADML_DIR=`readlink -f ADMLS/ADML-$instance`
86 ./clone.sh $ADML_DIR $TESTCASE $ini_seq $fin_seq $CLONE_GROUPS $specific &
88 done < $PROGRAM_LAYOUT_FILE
90 # Wait background jobs to finish:
92 echo "Waiting for clone completion ..."
95 [ $(children) -eq $children_before ] && break
100 echo "Programming has finished !"
103 echo "Configuring repeat cycles ..."
104 ./operation.sh "test|repeats|$REPEATS"
106 if [ -n "$specific" ]
108 echo "A new file '$TESTCASE_DIR/specific.all' has been created."
109 echo "Probably you need to apply it before starting traffic."
111 echo "Press ENTER to continue, CTRL-C to abort ..."
118 if [ "$AUTOSTART" = "-s" ]
122 echo "Input desired rate (test cases per second) to start testing [0: nothing done]:"
124 if [ "$desired_rate" != "" ]
126 rate_per_instance=$((desired_rate/$ADML_INSTANCES))
127 [ $rate_per_instance -lt 1 ] && rate_per_instance=1
128 ./operation.sh "test|ttps|$rate_per_instance"
130 echo "Remember that you could start traffic using:"
131 echo " ./operation.sh \"test|ttps|<test cases per second rate>\""
135 if [ -n "$start_testing" ]
138 echo "Start testing to achieve desired rate of $DESIRED_RATE test cases per second ..."
140 ./operation.sh "test|ttps|$RATE_PER_INSTANCE"