From 9ddc2d2a1628b701d26e6a732359081e1269f738 Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Thu, 27 Oct 2016 23:36:49 +0200 Subject: [PATCH] Improvements --- dynamic/launcher/gx/00001/dynamic.suffix | 18 ++++ example/diameter/launcher/Procedure.cpp | 2 +- .../launcher/deployments/st-client/program.sh | 92 ++++++++++--------- 3 files changed, 69 insertions(+), 43 deletions(-) diff --git a/dynamic/launcher/gx/00001/dynamic.suffix b/dynamic/launcher/gx/00001/dynamic.suffix index 07737b6..c39ba94 100644 --- a/dynamic/launcher/gx/00001/dynamic.suffix +++ b/dynamic/launcher/gx/00001/dynamic.suffix @@ -1,2 +1,20 @@ +# Procedure arguments: +# +# ||[|CCR-Termination path file>] +# +# is the first step to control the test cases execution. A value of 0 omits +# this first step (good to avoid huge load of timers during high performance testing). +# +# All the tests not fulfilled (those where the corresponding answers are not received) +# will be eternally keep 'in-progress' state. You could consider them failed after +# a specific time. A non-zero timeout step will ensure that this situation is updated +# as failed on expiration. Diameter application request timeouts also expire but are +# not processed here (not neccessary because reception conditions are enough to block +# the flow when something is wrong). Anyway, you could check ADML counters executing +# the command: ./operation show-oam + +# Only CCR-Initial: 0|7|CCR-I.xml + +# CCR-Initial + CCR-Termination: 0|7|CCR-I.xml|CCR-T.xml diff --git a/example/diameter/launcher/Procedure.cpp b/example/diameter/launcher/Procedure.cpp index 697a981..0ef767e 100644 --- a/example/diameter/launcher/Procedure.cpp +++ b/example/diameter/launcher/Procedure.cpp @@ -50,7 +50,7 @@ namespace { void Procedure::execute(const std::string &args, std::string &response) throw(anna::RuntimeException) { - response = "ERROR : "; + response = "Dynamic procedure failed to process '"; response += args; response += "': "; anna::Tokenizer targs; targs.apply(args, "|"); diff --git a/example/diameter/launcher/deployments/st-client/program.sh b/example/diameter/launcher/deployments/st-client/program.sh index fcfea84..54b99ae 100755 --- a/example/diameter/launcher/deployments/st-client/program.sh +++ b/example/diameter/launcher/deployments/st-client/program.sh @@ -8,6 +8,7 @@ RATE_PER_INSTANCE=`cat .st_conf_rate_per_instance 2>/dev/null` 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 # @@ -83,6 +84,15 @@ EOF _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 # ############# @@ -122,8 +132,6 @@ then specific= [ -f $TESTCASE_DIR/specific ] && specific=specific - [ -z "$ADML_CONCURRENT_PROVISION_JOBS" ] && ADML_CONCURRENT_PROVISION_JOBS=5 - count=0 while read -r line do @@ -137,16 +145,14 @@ then 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 @@ -184,7 +190,12 @@ else 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 @@ -195,6 +206,7 @@ else 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-) @@ -211,7 +223,6 @@ else 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 @@ -223,12 +234,20 @@ else 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 @@ -248,46 +267,35 @@ else 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|" + - Enable reports dump for failed tests: ./operation.sh "test|report|failed" + - Launch traffic: ./operation.sh "test|ttps|" - (*) 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-/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-' directory to avoid console spam, - for example: - - * Check a testcase in runtime: - ADMLS/ADML-001/operation.sh "test|look|" - - * Execute the next programmed test case: - ADMLS/ADML-001/operation.sh "test|next" + a specific 'ADMLS/ADML-' directory to avoid console spam: - * Interactive-step execution: - ADMLS/ADML-001/operation.sh "test|interact||" + - Check a testcase in runtime: ADMLS/ADML-001/operation.sh "test|look|" + - Execute the next programmed test case: ADMLS/ADML-001/operation.sh "test|next" + - Interactive-step execution: ADMLS/ADML-001/operation.sh "test|interact||" + - 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 -- 2.20.1