X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Fdeployments%2Fst-client%2Fprogram.sh;h=07e76169b365bc65b02622adc602b059147b1ebe;hb=b8a974c5eaba39f0891dfd17b64f7dd6411688dc;hp=f3aa5390cac7dc47db600655fa566bb97dfc83fa;hpb=ec48516a195faabbb514298ad743520b3fdb7ee4;p=anna.git diff --git a/example/diameter/launcher/deployments/st-client/program.sh b/example/diameter/launcher/deployments/st-client/program.sh index f3aa539..07e7616 100755 --- a/example/diameter/launcher/deployments/st-client/program.sh +++ b/example/diameter/launcher/deployments/st-client/program.sh @@ -22,23 +22,24 @@ _exit() { usage() { echo "Usage: $0 [-s]" 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 " 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 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 # ############# @@ -52,6 +53,11 @@ miss_conf= echo [ -z "$1" ] && usage +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 @@ -60,29 +66,45 @@ 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 +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 -children_before=$(children) +[ -z "$ADML_CONCURRENT_PROVISION_JOBS" ] && ADML_CONCURRENT_PROVISION_JOBS=5 + +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 !" @@ -91,6 +113,15 @@ echo 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= @@ -105,6 +136,12 @@ 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|\"" + echo + echo "For example, to reach $DESIRED_RATE test cases per second:" + echo " ./operation.sh \"test|ttps|$RATE_PER_INSTANCE\"" fi fi