From 18319deabbc8563fc112795968372e96263e6fe4 Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Fri, 20 Nov 2015 15:46:50 +0100 Subject: [PATCH] System test refinement --- example/diameter/launcher/DEPLOY.sh | 17 +- example/diameter/launcher/DEPLOY_setups.sh | 33 +- .../launcher/deployments/basic/configure.sh | 4 +- .../launcher/deployments/st-client/README | 21 +- .../launcher/deployments/st-client/clone.sh | 1 + .../deployments/st-client/configure.sh | 71 +- .../deployments/st-client/operation_all.sh | 17 + .../deployments/st-client/pre-start.sh | 2 + .../launcher/deployments/st-client/program.sh | 112 ++ .../st-client/realms_example/README | 13 + .../realms_example/cerGx.xml} | 0 .../realms_example/cerRx.xml} | 0 .../realms_example/dictionaryBase.xml | 1 + .../st-client/realms_example/dictionaryGx.xml | 1 + .../st-client/realms_example/dictionaryRx.xml | 1 + .../st-client/realms_example/services.msk | 11 + .../launcher/deployments/st-client/run.sh | 11 - .../launcher/deployments/st-client/run_all.sh | 23 +- .../deployments/st-client/st_examples | 1 + .../test_examples/RxGx/02.CEA_Gx.xml | 21 - .../test_examples/RxGx/04.CEA_Rx.xml | 21 - .../test_examples/RxGx/06.CCA-I.xml | 16 - .../test_examples/RxGx/08.AAA-flows.xml | 13 - .../test_examples/RxGx/09.RAR-install.xml | 124 -- .../test_examples/RxGx/12.CCA-U.xml | 116 -- .../test_examples/RxGx/14.STA_Rx.xml | 7 - .../test_examples/RxGx/15.RAR-remove.xml | 16 - .../test_examples/RxGx/18.CCA-T.xml | 10 - .../test_examples/RxGx/19.DPR_Gx.xml | 5 - .../test_examples/RxGx/20.DPA_Gx.xml | 5 - .../test_examples/RxGx/21.DPR_Rx.xml | 5 - .../test_examples/RxGx/22.DPA_Rx.xml | 5 - .../deployments/test_examples/RxGx/simple.sh | 23 - .../deployments/test_examples/checkings.sh | 24 - .../deployments/test_examples/cycle.sh | 40 - .../deployments/test_examples/endsOk.sh | 22 - .../launcher/resources/scripts/clone.sh | 46 +- .../resources/scripts/operation_signal.sh | 3 + .../DynamicQualification/.testcase.txt.st | 17 + .../DynamicQualification/1.15.hex.as.xml.msk} | 12 +- .../DynamicQualification/1.20.hex.as.xml.msk} | 32 +- .../DynamicQualification/1.28.hex.as.xml.msk} | 4 +- .../DynamicQualification/1.30.hex.as.xml.msk} | 6 +- .../DynamicQualification/1.35.hex.as.xml.msk} | 6 +- .../DynamicQualification/1.39.hex.as.xml.msk} | 4 +- .../DynamicQualification/1.41.hex.as.xml.msk} | 6 +- .../DynamicQualification/15.hex.as.xml.msk | 27 + .../DynamicQualification/20.hex.as.xml.msk | 68 + .../DynamicQualification/28.hex.as.xml.msk | 7 + .../DynamicQualification/30.hex.as.xml.msk | 18 + .../DynamicQualification/35.hex.as.xml.msk | 10 + .../DynamicQualification/39.hex.as.xml.msk | 7 + .../DynamicQualification/41.hex.as.xml.msk | 18 + .../DynamicQualification/testcase.txt.msk | 17 + .../launcher/resources/st_examples/README | 3 + .../launcher/resources/stack_examples/0.xml | 438 ++++++ .../resources/stack_examples/16777236.xml | 696 +++++++++ .../resources/stack_examples/16777238.xml | 1270 +++++++++++++++++ .../resources/stack_examples/16777302.xml | 553 +++++++ 59 files changed, 3521 insertions(+), 560 deletions(-) create mode 120000 example/diameter/launcher/deployments/st-client/clone.sh create mode 100755 example/diameter/launcher/deployments/st-client/operation_all.sh create mode 100755 example/diameter/launcher/deployments/st-client/pre-start.sh create mode 100755 example/diameter/launcher/deployments/st-client/program.sh create mode 100644 example/diameter/launcher/deployments/st-client/realms_example/README rename example/diameter/launcher/deployments/{test_examples/RxGx/01.CER_Gx.xml => st-client/realms_example/cerGx.xml} (100%) rename example/diameter/launcher/deployments/{test_examples/RxGx/03.CER_Rx.xml => st-client/realms_example/cerRx.xml} (100%) create mode 120000 example/diameter/launcher/deployments/st-client/realms_example/dictionaryBase.xml create mode 120000 example/diameter/launcher/deployments/st-client/realms_example/dictionaryGx.xml create mode 120000 example/diameter/launcher/deployments/st-client/realms_example/dictionaryRx.xml create mode 100644 example/diameter/launcher/deployments/st-client/realms_example/services.msk delete mode 100755 example/diameter/launcher/deployments/st-client/run.sh create mode 120000 example/diameter/launcher/deployments/st-client/st_examples delete mode 100644 example/diameter/launcher/deployments/test_examples/RxGx/02.CEA_Gx.xml delete mode 100644 example/diameter/launcher/deployments/test_examples/RxGx/04.CEA_Rx.xml delete mode 100644 example/diameter/launcher/deployments/test_examples/RxGx/06.CCA-I.xml delete mode 100644 example/diameter/launcher/deployments/test_examples/RxGx/08.AAA-flows.xml delete mode 100644 example/diameter/launcher/deployments/test_examples/RxGx/09.RAR-install.xml delete mode 100644 example/diameter/launcher/deployments/test_examples/RxGx/12.CCA-U.xml delete mode 100644 example/diameter/launcher/deployments/test_examples/RxGx/14.STA_Rx.xml delete mode 100644 example/diameter/launcher/deployments/test_examples/RxGx/15.RAR-remove.xml delete mode 100644 example/diameter/launcher/deployments/test_examples/RxGx/18.CCA-T.xml delete mode 100644 example/diameter/launcher/deployments/test_examples/RxGx/19.DPR_Gx.xml delete mode 100644 example/diameter/launcher/deployments/test_examples/RxGx/20.DPA_Gx.xml delete mode 100644 example/diameter/launcher/deployments/test_examples/RxGx/21.DPR_Rx.xml delete mode 100644 example/diameter/launcher/deployments/test_examples/RxGx/22.DPA_Rx.xml delete mode 100755 example/diameter/launcher/deployments/test_examples/RxGx/simple.sh delete mode 100755 example/diameter/launcher/deployments/test_examples/checkings.sh delete mode 100755 example/diameter/launcher/deployments/test_examples/cycle.sh delete mode 100755 example/diameter/launcher/deployments/test_examples/endsOk.sh create mode 100644 example/diameter/launcher/resources/st_examples/DynamicQualification/.testcase.txt.st rename example/diameter/launcher/{deployments/test_examples/RxGx/05.CCR-I.xml => resources/st_examples/DynamicQualification/1.15.hex.as.xml.msk} (72%) rename example/diameter/launcher/{deployments/test_examples/RxGx/07.AAR-flows.xml => resources/st_examples/DynamicQualification/1.20.hex.as.xml.msk} (73%) rename example/diameter/launcher/{deployments/test_examples/RxGx/10.RAA-install.xml => resources/st_examples/DynamicQualification/1.28.hex.as.xml.msk} (63%) rename example/diameter/launcher/{deployments/test_examples/RxGx/11.CCR-U.xml => resources/st_examples/DynamicQualification/1.30.hex.as.xml.msk} (77%) rename example/diameter/launcher/{deployments/test_examples/RxGx/13.STR_Rx.xml => resources/st_examples/DynamicQualification/1.35.hex.as.xml.msk} (64%) rename example/diameter/launcher/{deployments/test_examples/RxGx/16.RAA-remove.xml => resources/st_examples/DynamicQualification/1.39.hex.as.xml.msk} (63%) rename example/diameter/launcher/{deployments/test_examples/RxGx/17.CCR-T.xml => resources/st_examples/DynamicQualification/1.41.hex.as.xml.msk} (77%) create mode 100644 example/diameter/launcher/resources/st_examples/DynamicQualification/15.hex.as.xml.msk create mode 100644 example/diameter/launcher/resources/st_examples/DynamicQualification/20.hex.as.xml.msk create mode 100644 example/diameter/launcher/resources/st_examples/DynamicQualification/28.hex.as.xml.msk create mode 100644 example/diameter/launcher/resources/st_examples/DynamicQualification/30.hex.as.xml.msk create mode 100644 example/diameter/launcher/resources/st_examples/DynamicQualification/35.hex.as.xml.msk create mode 100644 example/diameter/launcher/resources/st_examples/DynamicQualification/39.hex.as.xml.msk create mode 100644 example/diameter/launcher/resources/st_examples/DynamicQualification/41.hex.as.xml.msk create mode 100644 example/diameter/launcher/resources/st_examples/DynamicQualification/testcase.txt.msk create mode 100644 example/diameter/launcher/resources/st_examples/README create mode 100644 example/diameter/launcher/resources/stack_examples/0.xml create mode 100644 example/diameter/launcher/resources/stack_examples/16777236.xml create mode 100644 example/diameter/launcher/resources/stack_examples/16777238.xml create mode 100644 example/diameter/launcher/resources/stack_examples/16777302.xml diff --git a/example/diameter/launcher/DEPLOY.sh b/example/diameter/launcher/DEPLOY.sh index e44e928..1023729 100755 --- a/example/diameter/launcher/DEPLOY.sh +++ b/example/diameter/launcher/DEPLOY.sh @@ -8,6 +8,7 @@ MSGDTD=../../../include/anna/diameter/codec/message.dtd DCTDTD=../../../include/anna/diameter/stack/dictionary.dtd BASE_PROT=commands_baseProtocol.xml SERVICES=./resources/services_examples +STACK_EXAMPLES=./resources/stack_examples SRVDTD=$SERVICES/services.dtd # Executables in priority order: @@ -17,6 +18,7 @@ EXECS=( $EXEC_installed ./release/example_diameter_launcher ./debug/example_diam # Stack management STACKMGMT_EXEC_installed=/opt/bin/anna/example_diameter_stackManagement STACKMGMT_EXECS=( $STACKMGMT_EXEC_installed ../stackManagement/release/example_diameter_stackManagement ../stackManagement/debug/example_diameter_stackManagement ) +:1 ############# # FUNCTIONS # @@ -54,17 +56,17 @@ createRunScript () { [ "$1" = "b" ] && return local other= - [ "$1" = "a" ] && { exe=ADML-launcher ; other="--httpServer \`grep -v ^# .httpServer\`"; } - [ "$1" = "f" ] && { exe=ADML-ftclient ; ln -s ADML-launcher $exe ; } - [ "$1" = "s" ] && { exe=ADML-stclient ; other="--disableLogs"; ln -s ADML-launcher $exe ; } + [ "$1" = "a" ] && other="--httpServer \`grep -v ^# .httpServer\`" + [ "$1" = "f" ] && ln -s ADML-launcher $EXE + [ "$1" = "s" ] && { other="--disableLogs"; ln -s ADML-launcher $EXE ; } echo "Creating 'run.sh' script ..." cat << EOF > run.sh #!/bin/bash cd \`dirname \$0\` -EXE=$exe -STARTED=\`pgrep \$EXE 2>/dev/null\` +EXE=$EXE +STARTED=\`pgrep \$EXE$ 2>/dev/null\` [ \$? -eq 0 ] && { echo "Already started!"; echo "\$STARTED" ; exit 1 ; } ./pre-start.sh 0> launcher.trace @@ -154,7 +156,7 @@ then echo " (a)dvanced version: includes burst management script and templates for different scenarios. Automatic configuration during start." echo " (b)asic version: 4 types of launcher (client, server, balancer, dummy), lightly configured and managed through SIGURS2 method." echo " (f)unction test client: special client with regexp scheduler script based on splitted traffic logs. Requires a server to perform the tests." - echo " (s)ystem test client: special client for stress testing. Requires a server to perform the tests." + echo " (s)ystem test client: special client for stress testing. Requires a server/s to perform the tests." echo echo "Input option [b]:" read option @@ -204,6 +206,7 @@ else fi [ -d $DPATH ] && _exit "The installation path '$DPATH' must not exists." +EXE=ADML-`basename $DPATH` echo "Copying to '$DPATH' ..." mkdir -p $DPATH @@ -222,6 +225,8 @@ cp -rL $DEPLOYMENTS_DIR/* $DPATH cp $SETUPS_DIR/*xml $DPATH/stacks cp $SETUPS_DIR/*sh $DPATH/stacks cp $SETUPS_DIR/readme.txt $DPATH/stacks +mkdir $DPATH/stacks/other_examples +cp $STACK_EXAMPLES/* $DPATH/stacks/other_examples cp $MSGDTD $DPATH/DTDs cp $DCTDTD $DPATH/DTDs cp $SRVDTD $DPATH/DTDs diff --git a/example/diameter/launcher/DEPLOY_setups.sh b/example/diameter/launcher/DEPLOY_setups.sh index b050efd..5a3256d 100755 --- a/example/diameter/launcher/DEPLOY_setups.sh +++ b/example/diameter/launcher/DEPLOY_setups.sh @@ -23,7 +23,7 @@ echo "Which one you want to deploy [1]:" echo echo " 1. Client and server" echo " 2. Ft-client and server" -echo " 3. St-client and server" +echo " 3. St-client and servers" echo read type [ "$type" = "" ] && type=1 @@ -38,7 +38,7 @@ case $type in ;; 3) - DEPLOY_DIR__dflt=$HOME/ADML-stclientAndServer + DEPLOY_DIR__dflt=$HOME/ADML-stclientAndServers ;; *) @@ -57,27 +57,44 @@ case $type in 1) $DEPLOY_SCR b $DIR/client $DEPLOY_SCR b $DIR/server + echo "Configuring ..." cd $DIR/client - echo c | ./configure.sh + echo c | ./configure.sh >/dev/null cd - >/dev/null cd $DIR/server - echo s | ./configure.sh + echo s | ./configure.sh >/dev/null cd - >/dev/null ;; 2) $DEPLOY_SCR f $DIR/ft-client $DEPLOY_SCR b $DIR/server + echo "Configuring ..." cd $DIR/server - echo s | ./configure.sh + echo s | ./configure.sh >/dev/null cd - >/dev/null ;; 3) $DEPLOY_SCR s $DIR/st-client - $DEPLOY_SCR b $DIR/server - cd $DIR/server - echo s | ./configure.sh + $DEPLOY_SCR b $DIR/serverGx + $DEPLOY_SCR b $DIR/serverRx + echo "Configuring ..." + cd $DIR/st-client + mv run.sh .run-one.sh + mv run_all.sh run.sh + mv operation.sh .operation-one.sh + mv operation_all.sh operation.sh + rm dictionary.xml + cd - >/dev/null + cd $DIR/serverGx + echo s | ./configure.sh >/dev/null + sed -i 's/3868/3869/' services.xml + ln -sf stacks/other_examples/16777238.xml dictionary.xml + cd - >/dev/null + cd $DIR/serverRx + echo s | ./configure.sh >/dev/null + ln -sf stacks/other_examples/16777236.xml dictionary.xml cd - >/dev/null ;; esac diff --git a/example/diameter/launcher/deployments/basic/configure.sh b/example/diameter/launcher/deployments/basic/configure.sh index 7a3705b..3b326bc 100755 --- a/example/diameter/launcher/deployments/basic/configure.sh +++ b/example/diameter/launcher/deployments/basic/configure.sh @@ -24,7 +24,7 @@ createRunScript () { cat << EOF > run.sh #!/bin/bash cd \`dirname \$0\` -STARTED=\`pgrep $1 2>/dev/null\` +STARTED=\`pgrep $1$ 2>/dev/null\` [ \$? -eq 0 ] && { echo "Already started!"; echo "\$STARTED" ; exit 1 ; } 0> launcher.trace rm -f counters/* test-reports/* @@ -88,7 +88,7 @@ then fi # Run script: -EXE_LINK=ADML-$tol +EXE_LINK=ADML-`basename $PWD` ln -sf $EXE_BN $EXE_LINK case $tol in diff --git a/example/diameter/launcher/deployments/st-client/README b/example/diameter/launcher/deployments/st-client/README index 6c8c711..8950d84 100644 --- a/example/diameter/launcher/deployments/st-client/README +++ b/example/diameter/launcher/deployments/st-client/README @@ -10,11 +10,26 @@ for system testing. STARTING THE PROCESS -------------------- After configuring the ADML execution context, a new script has been created: 'run.sh'. -This script will run all the cloned ADML instances within ADMLS directory. +This script will run all the cloned ADML instances within ADMLS directory. Also, an +'./operation.sh' script will broadcast the operation provided through every cloned +instance. For example, if you provide 'test|ttps|5', the speed of 5 test cases per +second will be set on every ADML instance. Imagine you have N instances, and then +you actually are establishing a total 5*N speed rate over the servers. + +TESTING PROCEDURE +----------------- +Firstly you shall program the test cases. For example: + ./program.sh st_examples/DynamicQualification + +Using option '-s', the testing will start after programming, with the desired rate +selected on configuration stage. + +Don't forget to populate whatever data you need on the tested system, because this +work is not done here. OPERATION --------- Management interface for lite version is based on SIGUSR2 signal caugh. Use './operation.sh' -script to send any operation to the processes. Ask for help with that script to see all the -operations supported. +script within a specific instance directory to send any operation to the process. Ask for +help with that script to see all the operations supported. diff --git a/example/diameter/launcher/deployments/st-client/clone.sh b/example/diameter/launcher/deployments/st-client/clone.sh new file mode 120000 index 0000000..1a5e8eb --- /dev/null +++ b/example/diameter/launcher/deployments/st-client/clone.sh @@ -0,0 +1 @@ +../../resources/scripts/clone.sh \ No newline at end of file diff --git a/example/diameter/launcher/deployments/st-client/configure.sh b/example/diameter/launcher/deployments/st-client/configure.sh index 383c21a..3073050 100755 --- a/example/diameter/launcher/deployments/st-client/configure.sh +++ b/example/diameter/launcher/deployments/st-client/configure.sh @@ -9,6 +9,9 @@ ADML_INSTANCES__ST_CONF_FILE=.st_conf_adml_instances ADML_CONNECTIONS__ST_CONF_FILE=.st_conf_adml_connections CYCLE_REPEATS__ST_CONF_FILE=.st_conf_cycle_repeats N_TESTCASES__ST_CONF_FILE=.st_conf_n_testcases +ADML_RATE_PER_INSTANCE__ST_CONF_FILE=.st_conf_rate_per_instance +ADML_DESIRED_RATE__ST_CONF_FILE=.st_conf_desired_rate +N_TESTCASES_PROGRAM_LAYOUT__ST_CONF_FILE=.st_conf_n_testcases_program_layout ############# # FUNCTIONS # @@ -22,7 +25,10 @@ _exit () { # ceil of division $1/$2 ceil() { - echo "$1 $2" | awk '{print int( ($1/$2) + 1 )}' + #echo "$1 $2" | awk '{print int( ($1/$2) + 1 )}' + awk -vnumber="$1" -vdiv="$2" ' + function ceiling(x){return x%1 ? int(x)+1 : x} + BEGIN{ print ceiling(number/div) }' } # Calculates the number of ADML instances and their client connections @@ -70,9 +76,20 @@ calculate_deployment_layout() { read G_ADML_CONNECTIONS [ -z "$G_ADML_CONNECTIONS" ] && G_ADML_CONNECTIONS=1 [ $G_ADML_CONNECTIONS -lt 1 ] && G_ADML_CONNECTIONS=1 - [ $G_ADML_CONNECTIONS -gt $MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE ] && G_ADML_CONNECTIONS=$MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE + if [ $G_ADML_CONNECTIONS -gt 1 ] + then + echo "Remember to add 'diameterServerSessions="$G_ADML_CONNECTIONS"' on servers services.xml file (node tag)" + echo " in case that you are testing against ADML servers." + echo + echo "Press ENTER to continue, CTRL-C to abort ..." + read dummy + fi + if [ $G_ADML_CONNECTIONS -gt $MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE ] + then + G_ADML_CONNECTIONS=$MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE + fi - G_ADML_INSTANCES=$((max_connections/G_ADML_CONNECTIONS)) + G_ADML_INSTANCES=$(ceil $max_connections $G_ADML_CONNECTIONS) } ############# @@ -86,6 +103,8 @@ echo "=====================================" echo "ADML SYSTEM TEST CONFIGURATION WIZARD" echo "=====================================" echo +[ -d ADMLS ] && _exit "ADMLS directory still exists. Please remove it to continue (perhaps you have to 'pkill ADML' before) !" +[ ! -d realms ] && _exit "Missing realms configuration (expecting '$PWD/realms' directory). Try with 'realms-example' and see README inside it !" calculate_deployment_layout @@ -93,6 +112,13 @@ calculate_deployment_layout echo $G_ADML_INSTANCES > $ADML_INSTANCES__ST_CONF_FILE echo $G_ADML_CONNECTIONS > $ADML_CONNECTIONS__ST_CONF_FILE +# Rate per instance: +#rate_per_instance=$(ceil $desired_rate $G_ADML_INSTANCES) +rate_per_instance=$((desired_rate/$G_ADML_INSTANCES)) +[ $rate_per_instance -lt 1 ] && rate_per_instance=1 +echo $rate_per_instance > $ADML_RATE_PER_INSTANCE__ST_CONF_FILE +echo $desired_rate > $ADML_DESIRED_RATE__ST_CONF_FILE + echo echo "Suggested layout:" echo " - $G_ADML_INSTANCES ADML instances" @@ -104,6 +130,7 @@ echo "Usually, you will program a test case per subscriber. Input the number of read N_TESTCASES while [ -z "$N_TESTCASES" ]; do read N_TESTCASES; done echo $N_TESTCASES > $N_TESTCASES__ST_CONF_FILE +testcase_per_adml_instance=$N_TESTCASES echo time_covered_1=$(ceil $N_TESTCASES $maximum_rate) time_covered=$(ceil $N_TESTCASES $((maximum_rate*G_ADML_INSTANCES))) @@ -111,10 +138,19 @@ echo "That amount covers $time_covered_1 seconds for one running ADML instance." if [ $G_ADML_INSTANCES -gt 1 ] then echo "But you will have $G_ADML_INSTANCES instances running in parallel, then the total covered time is: $time_covered seconds" - testcase_per_adml_instance=$(ceil $N_TESTCASES $G_ADML_INSTANCES) + testcase_per_adml_instance=$((N_TESTCASES/G_ADML_INSTANCES)) echo "(aproximately, $testcase_per_adml_instance test cases will be programmed on each ADML instance)" fi +0>$N_TESTCASES_PROGRAM_LAYOUT__ST_CONF_FILE +for instance in `seq 1 $G_ADML_INSTANCES` +do + offset=$((testcase_per_adml_instance * (instance-1))) + ini=$((offset + 1)) + fin=$((offset + testcase_per_adml_instance)) + echo "$instance $ini $fin" >> $N_TESTCASES_PROGRAM_LAYOUT__ST_CONF_FILE +done + echo if [ $time_covered -lt 300 ] then @@ -130,28 +166,37 @@ while [ -z "$minutes" ]; do read minutes; done seconds=$((minutes*60)) repeats=$(ceil $seconds $time_covered) echo $repeats > $CYCLE_REPEATS__ST_CONF_FILE -[ $repeats -gt 0 ] && echo "Configured $repeats cycle repeats ($repeats x $time_covered seconds = $seconds seconds (desired $minutes minutes)" +[ $repeats -gt 0 ] && echo "Configured $repeats cycle repeats ($repeats x $time_covered seconds ~ $seconds seconds (desired $minutes minutes)" echo echo "System test configuration completed." echo echo "Ready to clone/start the ADML instances: press ENTER to continue, CTRL+C to abort ..." read dummy -[ ! -d realms ] && _exit "Missing realms configuration (expecting '$PWD/realms' directory). Try with 'realms.example' and see README inside it !" # Update services.xml regarding the number of client connections: -cp realms/services.msk realms/services.xml -sed -i 's/__CLIENT_CONNECTIONS__/'$G_ADML_CONNECTIONS'/g' realms/services.xml +cd realms +cp services.msk services.xml +sed -i 's/__CLIENT_CONNECTIONS__/'$G_ADML_CONNECTIONS'/g' services.xml +cd - >/dev/null + -rm -rf ADMLS for instance in `seq 1 $G_ADML_INSTANCES` do + echo "Creating ADMLS/$instance ..." mkdir -p ADMLS/$instance cd ADMLS/$instance # Create resources: - ln -s ../../ADML-launcher - ln -s ../../operation.sh - ln -s ../../realms/services.xml - for cer in `ls ../../realms/cer*xml`; do ln -s $cer; done + ln -s ../../.operation-one.sh operation.sh + ln -s ../../pre-start.sh + cp ../../.run-one.sh run.sh + sed -i 's/^EXE=.*/EXE=ADML-'$instance'/' run.sh + ln -s ../../ADML-launcher ADML-$instance + for xml in `ls ../../realms/*xml`; do ln -s $xml; done cd - >/dev/null done +echo +echo "Now you can run all the instances deployed: ./run.sh" +echo +echo "Done!" + diff --git a/example/diameter/launcher/deployments/st-client/operation_all.sh b/example/diameter/launcher/deployments/st-client/operation_all.sh new file mode 100755 index 0000000..616814d --- /dev/null +++ b/example/diameter/launcher/deployments/st-client/operation_all.sh @@ -0,0 +1,17 @@ +#!/bin/bash +cd `dirname $0` +if [ ! -d "ADMLS" ] +then + echo + echo "Run './configure.sh' first !" + echo + exit 1 +fi + +for op in `ls ADMLS/*/operation.sh` +do + cd `dirname $op` + ./operation.sh $@ + cd - >/dev/null +done + diff --git a/example/diameter/launcher/deployments/st-client/pre-start.sh b/example/diameter/launcher/deployments/st-client/pre-start.sh new file mode 100755 index 0000000..8b97a22 --- /dev/null +++ b/example/diameter/launcher/deployments/st-client/pre-start.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo "Launching ADML instance `pwd` ..." diff --git a/example/diameter/launcher/deployments/st-client/program.sh b/example/diameter/launcher/deployments/st-client/program.sh new file mode 100755 index 0000000..fccfe07 --- /dev/null +++ b/example/diameter/launcher/deployments/st-client/program.sh @@ -0,0 +1,112 @@ +#!/bin/bash + +############# +# VARIABLES # +############# +ADML_INSTANCES=`cat .st_conf_adml_instances 2>/dev/null` +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 + +############# +# FUNCTIONS # +############# +_exit() { + echo + echo $1 + echo + exit 1 +} + +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 " $0 st_examples/DynamicQualification" + 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 # +############# +miss_conf= +[ ! -f .st_conf_adml_instances ] && miss_conf=yes +[ ! -f .st_conf_n_testcases_program_layout ] && miss_conf=yes +[ ! -f .st_conf_cycle_repeats ] && miss_conf=yes +[ ! -f .st_conf_rate_per_instance ] && miss_conf=yes +[ ! -f .st_conf_desired_rate ] && miss_conf=yes +[ -n "$miss_conf" ] && _exit "You must run './configure.sh' script firtly !!" + +echo +[ -z "$1" ] && usage +TESTCASE_DIR=$1 +AUTOSTART=$2 + +[ ! -d $TESTCASE_DIR ] && _exit "Cannot found the test directory '$TESTCASE_DIR' !!" +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 !!" + +children_before=$(children) +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/$instance` + ./clone.sh $ADML_DIR $TESTCASE $ini_seq $fin_seq 1 & + +done < $PROGRAM_LAYOUT_FILE + +# Wait background jobs to finish: +sleep 1 +echo "Waiting for clone completion ..." +while true +do + [ $(children) -eq $children_before ] && break + sleep 1 +done + +echo "Configuring repeat cycles ..." +./operation.sh "test|repeats|$REPEATS" + +start_testing= +if [ "$AUTOSTART" = "-s" ] +then + start_testing=yes +else + echo "Input desired rate (test cases per second) to start testing [0: nothing done]:" + read desired_rate + if [ "$desired_rate" != "" ] + then + rate_per_instance=$((desired_rate/$ADML_INSTANCES)) + [ $rate_per_instance -lt 1 ] && rate_per_instance=1 + ./operation.sh "test|ttps|$rate_per_instance" + fi +fi + +if [ -n "$start_testing" ] +then + echo + echo "Start testing to achieve desired rate of $DESIRED_RATE test cases per second ..." + echo + ./operation.sh "test|ttps|$RATE_PER_INSTANCE" +fi + +echo +echo "Done !" +echo + diff --git a/example/diameter/launcher/deployments/st-client/realms_example/README b/example/diameter/launcher/deployments/st-client/realms_example/README new file mode 100644 index 0000000..1ddd49b --- /dev/null +++ b/example/diameter/launcher/deployments/st-client/realms_example/README @@ -0,0 +1,13 @@ + +Content +======= + +README: this file. +services.msk: services with some possible parseable variables: + __CLIENT_CONNECTIONS__: Number of client conections from a specific realm to the + corresponding diameter entity. +cerGx.xml: CER file for Gx referenced in the services specification. +cerRx.xml: CER file for Rx referenced in the services specification. +dictionaryBase.xml: Diameter base dictionary used in the services specification. +dictionaryGx.xml: Gx dictionary used in the services specification. +dictionaryRx.xml: Rx dictionary used in the services specification. diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/01.CER_Gx.xml b/example/diameter/launcher/deployments/st-client/realms_example/cerGx.xml similarity index 100% rename from example/diameter/launcher/deployments/test_examples/RxGx/01.CER_Gx.xml rename to example/diameter/launcher/deployments/st-client/realms_example/cerGx.xml diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/03.CER_Rx.xml b/example/diameter/launcher/deployments/st-client/realms_example/cerRx.xml similarity index 100% rename from example/diameter/launcher/deployments/test_examples/RxGx/03.CER_Rx.xml rename to example/diameter/launcher/deployments/st-client/realms_example/cerRx.xml diff --git a/example/diameter/launcher/deployments/st-client/realms_example/dictionaryBase.xml b/example/diameter/launcher/deployments/st-client/realms_example/dictionaryBase.xml new file mode 120000 index 0000000..3b80f68 --- /dev/null +++ b/example/diameter/launcher/deployments/st-client/realms_example/dictionaryBase.xml @@ -0,0 +1 @@ +../../../resources/stack_examples/0.xml \ No newline at end of file diff --git a/example/diameter/launcher/deployments/st-client/realms_example/dictionaryGx.xml b/example/diameter/launcher/deployments/st-client/realms_example/dictionaryGx.xml new file mode 120000 index 0000000..4221ca3 --- /dev/null +++ b/example/diameter/launcher/deployments/st-client/realms_example/dictionaryGx.xml @@ -0,0 +1 @@ +../../../resources/stack_examples/16777238.xml \ No newline at end of file diff --git a/example/diameter/launcher/deployments/st-client/realms_example/dictionaryRx.xml b/example/diameter/launcher/deployments/st-client/realms_example/dictionaryRx.xml new file mode 120000 index 0000000..0706e2b --- /dev/null +++ b/example/diameter/launcher/deployments/st-client/realms_example/dictionaryRx.xml @@ -0,0 +1 @@ +../../../resources/stack_examples/16777236.xml \ No newline at end of file diff --git a/example/diameter/launcher/deployments/st-client/realms_example/services.msk b/example/diameter/launcher/deployments/st-client/realms_example/services.msk new file mode 100644 index 0000000..dc06824 --- /dev/null +++ b/example/diameter/launcher/deployments/st-client/realms_example/services.msk @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/example/diameter/launcher/deployments/st-client/run.sh b/example/diameter/launcher/deployments/st-client/run.sh deleted file mode 100755 index 27aa362..0000000 --- a/example/diameter/launcher/deployments/st-client/run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -cd `dirname $0` -EXE_BN=`basename $PWD` -STARTED=`pgrep $EXE_BN 2>/dev/null` -[ $? -eq 0 ] && { echo "Already started!"; echo "$STARTED" ; exit 1 ; } -0> launcher.trace -rm -f counters/* test-reports/* -# Execution line: -nohup ./ADML-client --cntDir counters --tmDir test-reports --disableLogs --services $SERVICES > stdout & -echo $! > .pid - diff --git a/example/diameter/launcher/deployments/st-client/run_all.sh b/example/diameter/launcher/deployments/st-client/run_all.sh index 8f2cd56..e9014ee 100755 --- a/example/diameter/launcher/deployments/st-client/run_all.sh +++ b/example/diameter/launcher/deployments/st-client/run_all.sh @@ -1,6 +1,27 @@ #!/bin/bash cd `dirname $0` +if [ ! -d "ADMLS" ] +then + echo + echo "Run './configure.sh' first !" + echo + exit 1 +fi + for run in `ls ADMLS/*/run.sh` do - $run + cd `dirname $run` + ./run.sh + sleep 0.1 + cd - >/dev/null done + +sleep 1 +echo "Now you could program the tests by mean script 'program.sh'. For example:" +echo " ./program.sh st_examples/DynamicQualification" +echo +echo "To stop the processes, you could execute:" +echo " pgrep ADML-[0-9] | xargs kill" +echo +echo "Done!" + diff --git a/example/diameter/launcher/deployments/st-client/st_examples b/example/diameter/launcher/deployments/st-client/st_examples new file mode 120000 index 0000000..58e802a --- /dev/null +++ b/example/diameter/launcher/deployments/st-client/st_examples @@ -0,0 +1 @@ +../../resources/st_examples \ No newline at end of file diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/02.CEA_Gx.xml b/example/diameter/launcher/deployments/test_examples/RxGx/02.CEA_Gx.xml deleted file mode 100644 index 06ce804..0000000 --- a/example/diameter/launcher/deployments/test_examples/RxGx/02.CEA_Gx.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/04.CEA_Rx.xml b/example/diameter/launcher/deployments/test_examples/RxGx/04.CEA_Rx.xml deleted file mode 100644 index 7b9dd52..0000000 --- a/example/diameter/launcher/deployments/test_examples/RxGx/04.CEA_Rx.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/06.CCA-I.xml b/example/diameter/launcher/deployments/test_examples/RxGx/06.CCA-I.xml deleted file mode 100644 index 885b867..0000000 --- a/example/diameter/launcher/deployments/test_examples/RxGx/06.CCA-I.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/08.AAA-flows.xml b/example/diameter/launcher/deployments/test_examples/RxGx/08.AAA-flows.xml deleted file mode 100644 index 1392535..0000000 --- a/example/diameter/launcher/deployments/test_examples/RxGx/08.AAA-flows.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/09.RAR-install.xml b/example/diameter/launcher/deployments/test_examples/RxGx/09.RAR-install.xml deleted file mode 100644 index 5c1d643..0000000 --- a/example/diameter/launcher/deployments/test_examples/RxGx/09.RAR-install.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/12.CCA-U.xml b/example/diameter/launcher/deployments/test_examples/RxGx/12.CCA-U.xml deleted file mode 100644 index 27f8e3b..0000000 --- a/example/diameter/launcher/deployments/test_examples/RxGx/12.CCA-U.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/14.STA_Rx.xml b/example/diameter/launcher/deployments/test_examples/RxGx/14.STA_Rx.xml deleted file mode 100644 index 24038dc..0000000 --- a/example/diameter/launcher/deployments/test_examples/RxGx/14.STA_Rx.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/15.RAR-remove.xml b/example/diameter/launcher/deployments/test_examples/RxGx/15.RAR-remove.xml deleted file mode 100644 index 3840a18..0000000 --- a/example/diameter/launcher/deployments/test_examples/RxGx/15.RAR-remove.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/18.CCA-T.xml b/example/diameter/launcher/deployments/test_examples/RxGx/18.CCA-T.xml deleted file mode 100644 index f6a6808..0000000 --- a/example/diameter/launcher/deployments/test_examples/RxGx/18.CCA-T.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/19.DPR_Gx.xml b/example/diameter/launcher/deployments/test_examples/RxGx/19.DPR_Gx.xml deleted file mode 100644 index b277506..0000000 --- a/example/diameter/launcher/deployments/test_examples/RxGx/19.DPR_Gx.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/20.DPA_Gx.xml b/example/diameter/launcher/deployments/test_examples/RxGx/20.DPA_Gx.xml deleted file mode 100644 index f4a2435..0000000 --- a/example/diameter/launcher/deployments/test_examples/RxGx/20.DPA_Gx.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/21.DPR_Rx.xml b/example/diameter/launcher/deployments/test_examples/RxGx/21.DPR_Rx.xml deleted file mode 100644 index 17896d0..0000000 --- a/example/diameter/launcher/deployments/test_examples/RxGx/21.DPR_Rx.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/22.DPA_Rx.xml b/example/diameter/launcher/deployments/test_examples/RxGx/22.DPA_Rx.xml deleted file mode 100644 index 76fcc1c..0000000 --- a/example/diameter/launcher/deployments/test_examples/RxGx/22.DPA_Rx.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/simple.sh b/example/diameter/launcher/deployments/test_examples/RxGx/simple.sh deleted file mode 100755 index 765401c..0000000 --- a/example/diameter/launcher/deployments/test_examples/RxGx/simple.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -pkill ADML -sleep 1 -./run.sh -sleep 1 - -SCR_DIR=`dirname $0` -./operation.sh "test|report|yes" - -./operation.sh "test|1|timeout|5000" -./operation.sh "test|1|sendxml2e|$SCR_DIR/05.CCR-I.xml" -./operation.sh "test|1|waitfe|272|0|2001|tc_01_MMTel_DynamicQualification;ggsnNodeHostname.ggsnNodeHostRealm.com;1;629571" -./operation.sh "test|1|sendxml2e|$SCR_DIR/07.AAR-flows.xml" -./operation.sh "test|1|waitfe|265|0|2001|tc_01_MMTel_DynamicQualification;afNodeHostname.afNodeHostRealm.com;1;690434" -./operation.sh "test|1|waitfe|258|1||tc_01_MMTel_DynamicQualification;ggsnNodeHostname.ggsnNodeHostRealm.com;1;629571" -./operation.sh "test|1|sendxml2e|$SCR_DIR/10.RAA-install.xml|6" -./operation.sh "test|1|sendxml2e|$SCR_DIR/17.CCR-T.xml" -./operation.sh "test|1|waitfe|272|0|2001|tc_01_MMTel_DynamicQualification;ggsnNodeHostname.ggsnNodeHostRealm.com;1;629571|H1" -./operation.sh "test|1|waitfe|258|1||tc_01_MMTel_DynamicQualification;ggsnNodeHostname.ggsnNodeHostRealm.com;1;629571" -./operation.sh "test|1|sendxml2e|$SCR_DIR/16.RAA-remove.xml|10" - -#./operation.sh "test|ttps|1" - diff --git a/example/diameter/launcher/deployments/test_examples/checkings.sh b/example/diameter/launcher/deployments/test_examples/checkings.sh deleted file mode 100755 index 11d0c70..0000000 --- a/example/diameter/launcher/deployments/test_examples/checkings.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -pkill ADML -sleep 1 -./run.sh -sleep 1 - -./operation.sh "test|1|timeout|5000" -./operation.sh "test|1|delay|5000" -./operation.sh "test|1|waitfe|258|1" -./operation.sh "test|1|waitfc|258|1" -./operation.sh "test|1|sendxml2e|aar.xml|7" - -#for id in `seq 1 2` -#do -# ./operation.sh "test|$id|timeout|5000" -# ./operation.sh "test|$id|delay|5000" -# ./operation.sh "test|$id|sendxml2e|aar${id}.xml" -## ./operation.sh "test|$id|waitfe-answer|2" -## ./operation.sh "test|$id|waitfe|258|1||Session|hbhx" -## ./operation.sh "test|$id|waitfe|258|1|rcxxx|Session" -#done - -#./operation.sh "test|ttps|40" - diff --git a/example/diameter/launcher/deployments/test_examples/cycle.sh b/example/diameter/launcher/deployments/test_examples/cycle.sh deleted file mode 100755 index a16a62e..0000000 --- a/example/diameter/launcher/deployments/test_examples/cycle.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# Checking the correct cycle repeat and reports appending -program () { - - if [ "$2" = "ok" ] - then - ./operation.sh "test|$1|timeout|5000" - ./operation.sh "test|$1|delay|2000" - ./operation.sh "test|$1|delay|2000" - else - ./operation.sh "test|$1|timeout|5000" - ./operation.sh "test|$1|delay|2000" - ./operation.sh "test|$1|delay|4000" - fi -} - -pkill ADML -sleep 1 -./run.sh -sleep 1 -./operation.sh "test|repeat|yes" -./operation.sh "test|report|yes" - -COVERED_SECONDS=1 -for id in `seq 0 $((COVERED_SECONDS/2))` -do - program $((2*id + 1)) ok - program $((2*id + 2)) nok -done - -echo "Press ENTER to continue, CTRL+C to abort ..." -read dummy -./operation.sh "test|ttps|1" - -while true -do - sleep 1 - ./operation.sh "test|look" -done - diff --git a/example/diameter/launcher/deployments/test_examples/endsOk.sh b/example/diameter/launcher/deployments/test_examples/endsOk.sh deleted file mode 100755 index b355ea1..0000000 --- a/example/diameter/launcher/deployments/test_examples/endsOk.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -pkill ADML -sleep 1 -./run.sh -sleep 1 -./operation.sh "test|report|yes" -./operation.sh "test|1|timeout|5000" -./operation.sh "test|1|delay|2000" -./operation.sh "test|1|delay|2000" -# Last timeout ignored: -./operation.sh "test|1|timeout|3000" - -echo "Press ENTER to continue, CTRL+C to abort ..." -read dummy -./operation.sh "test|ttps|1" - -while true -do - sleep 1 - ./operation.sh "test|look|1" -done - diff --git a/example/diameter/launcher/resources/scripts/clone.sh b/example/diameter/launcher/resources/scripts/clone.sh index 815a5a7..099aa7f 100755 --- a/example/diameter/launcher/resources/scripts/clone.sh +++ b/example/diameter/launcher/resources/scripts/clone.sh @@ -28,7 +28,7 @@ sig_handler() { } usage() { - echo "Usage: $0 [number of groups]" + echo "Usage: $0 [number of groups] [population]" echo echo " ADML directory: path to the ADML directory where 'operation.sh' script is used to load the test cases." echo " testcase variable file: path to the testcase file with parseable variables, for example '/testcase.txt.msk'." @@ -43,13 +43,22 @@ usage() { echo " __SRX1_SUFFIX__: \"" echo " __SGX2_SUFFIX__: 2<8-digit sequence>" echo " __SRX2_SUFFIX__: \"" + echo " Edit the variables section to add more special values if you need them." echo echo " initial sequence: initial sequence number to parse over variables." echo " final sequence: final sequence number to parse over variables." echo " number of groups: number of background group jobs to clone the provided sequence range." - echo " By default, it will be the number of items divided by 25, with a maximum of $MAX_NUMBER_GROUPS." - echo - echo + echo " By default (or if you provide \"\"), it will be the number of items divided by 25, with a maximum" + echo " of $MAX_NUMBER_GROUPS." + echo " population: Optionally, a population file (basename) can be provided. It must exist on the same directory" + echo " than other stuff (testcase, xml files). The behaviour will be the accumulation of every parsing" + echo " operation during clone procedure regarding the templated content of the population file. The" + echo " accumulated content will be dump over a new file created together with cloned and" + echo " named with the extension '.all' (.all). This population file could be useful to" + echo " specify database commands related to each sequence (each single testcase), in order to have" + echo " the whole population file. This won't include common database elements for the tested scenary," + echo " which shall be provisioned in a separated procedure." + echo _exit } @@ -78,7 +87,8 @@ clone() { local wkdir=$2 mkdir -p $wkdir - # Values: + ############################################# SPECIAL VARIABLES SECTION ############################################# + ################################ EDIT THIS SECTION IF YOU NEED NEW SPECIAL VARIABLES ################################ testid=$sequence seq8=$(printf "%08d" $testid) msisdn9=6${seq8} @@ -105,6 +115,8 @@ clone() { echo "__SRX2_SUFFIX__=$srx2_suffix" >> $target source $target #rm $target + ######################################### END SPECIAL VARIABLES SECTION ######################################### + # Parse template files: parse_file $sequence $TESTCASE_TEMPLATE $wkdir/testcase.txt.$sequence @@ -117,6 +129,13 @@ clone() { done cat $wkdir/testcase.txt.$sequence >> $wkdir/testcase.txt rm $wkdir/testcase.txt.$sequence + + # Population: + if [ -n "$POPULATION_FILE" ] + then + parse_file $sequence $POPULATION_FILE $CLONE_WKDIR/${POPULATION}.$sequence + cat $CLONE_WKDIR/${POPULATION}.$sequence >> $POPULATION_ALL + fi } # $1: group number; $2: initial subrange value; $3: final subrange value @@ -124,7 +143,7 @@ clone_group() { for i in `seq $2 $3` do clone $i $CLONE_WKDIR/$1 - #sleep 0.01 + sleep 0.01 done } @@ -136,9 +155,13 @@ trap sig_handler SIGTERM ADML_DIR=$1 TESTCASE_TEMPLATE=`readlink -f $2` +TESTCASE_TEMPLATE_DIR=`dirname $TESTCASE_TEMPLATE` CLONE_SEQ_BEGIN=$3 CLONE_SEQ_END=$4 N_GROUPS=$5 +POPULATION=$6 +POPULATION_FILE=$TESTCASE_TEMPLATE_DIR/$POPULATION +POPULATION_ALL=$TESTCASE_TEMPLATE_DIR/${POPULATION}.all [ "$4" = "" ] && usage @@ -147,7 +170,14 @@ OPERATION=$ADML_DIR/operation.sh [ ! -f $OPERATION ] && _exit "Missing '$OPERATION' file !!" [ ! -f $TESTCASE_TEMPLATE ] && _exit "Missing '$TESTCASE_TEMPLATE' testcase template file !!" -TESTCASE_TEMPLATE_DIR=`dirname $TESTCASE_TEMPLATE` +if [ -n "$POPULATION" ] +then + bn_population=`basename $POPULATION` + [ "$bn_population" != "$POPULATION" ] && _exit "Only basename is allowed for population provided !!" + [ ! -f $POPULATION_FILE ] && _exit "Missing provided population file '$POPULATION_FILE' !!" + 0> $POPULATION_ALL +fi + N_ITEMS=$((CLONE_SEQ_END - CLONE_SEQ_BEGIN + 1)) if [ -z "$N_GROUPS" ] then @@ -169,6 +199,7 @@ children_before=$(children) offset=0 $OPERATION "test|clear" echo "Please be patient, this may take a while ..." +#echo "Temporary directory: $CLONE_WKDIR" for group in `seq 1 $((N_GROUPS+1))` do n_begin=$((CLONE_SEQ_BEGIN + offset)) @@ -178,7 +209,6 @@ do clone_group $group $n_begin $n_end & offset=$((group * GROUPS_SIZE)) done -children_now=$(children) # Wait background jobs to finish: while true diff --git a/example/diameter/launcher/resources/scripts/operation_signal.sh b/example/diameter/launcher/resources/scripts/operation_signal.sh index 85b3111..1be6fa9 100755 --- a/example/diameter/launcher/resources/scripts/operation_signal.sh +++ b/example/diameter/launcher/resources/scripts/operation_signal.sh @@ -29,7 +29,10 @@ else grep -v "^#" $FILE | sed '/^[ \t]*$/d' > sigusr2.in fi 0> sigusr2.out +kill -0 $PID 2>/dev/null +[ $? -ne 0 ] && _exit "Operation error: missing process with pid $PID" kill -s SIGUSR2 $PID + # Detect EOF and print all except that last line: while [ -z "$(tail -1 sigusr2.out | grep ^EOF)" ]; do sleep 0.1; done head --lines=-1 `pwd`/sigusr2.out diff --git a/example/diameter/launcher/resources/st_examples/DynamicQualification/.testcase.txt.st b/example/diameter/launcher/resources/st_examples/DynamicQualification/.testcase.txt.st new file mode 100644 index 0000000..f741b4b --- /dev/null +++ b/example/diameter/launcher/resources/st_examples/DynamicQualification/.testcase.txt.st @@ -0,0 +1,17 @@ +test|1|delay|0 +test|1|delay|0 +test|1|delay|0 +test|1|sendxml2e|15.hex.as.xml +test|1|waitfe|272|0|||tc_01_MMTel_DynamicQualification;ggsnNodeHostname.ggsnNodeHostRealm.com;2;|2001 +test|1|sendxml2e|20.hex.as.xml +test|1|waitfe|265|0|||tc_01_MMTel_DynamicQualification;afNodeHostname.afNodeHostRealm.com;2;|2001 +test|1|waitfe|258|1|||tc_01_MMTel_DynamicQualification;ggsnNodeHostname.ggsnNodeHostRealm.com;2; +test|1|sendxml2e|28.hex.as.xml|8 +test|1|sendxml2e|30.hex.as.xml +test|1|waitfe|272|0|||tc_01_MMTel_DynamicQualification;ggsnNodeHostname.ggsnNodeHostRealm.com;2;|2001 +test|1|sendxml2e|35.hex.as.xml +test|1|waitfe|275|0|||tc_01_MMTel_DynamicQualification;afNodeHostname.afNodeHostRealm.com;2;|2001 +test|1|waitfe|258|1|||tc_01_MMTel_DynamicQualification;ggsnNodeHostname.ggsnNodeHostRealm.com;2; +test|1|sendxml2e|39.hex.as.xml|14 +test|1|sendxml2e|41.hex.as.xml +test|1|waitfe|272|0|||tc_01_MMTel_DynamicQualification;ggsnNodeHostname.ggsnNodeHostRealm.com;2;|2001 diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/05.CCR-I.xml b/example/diameter/launcher/resources/st_examples/DynamicQualification/1.15.hex.as.xml.msk similarity index 72% rename from example/diameter/launcher/deployments/test_examples/RxGx/05.CCR-I.xml rename to example/diameter/launcher/resources/st_examples/DynamicQualification/1.15.hex.as.xml.msk index 96a031a..726b1ab 100644 --- a/example/diameter/launcher/deployments/test_examples/RxGx/05.CCR-I.xml +++ b/example/diameter/launcher/resources/st_examples/DynamicQualification/1.15.hex.as.xml.msk @@ -1,6 +1,6 @@ - - - + + + @@ -8,7 +8,7 @@ - + @@ -20,8 +20,8 @@ - - + + diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/07.AAR-flows.xml b/example/diameter/launcher/resources/st_examples/DynamicQualification/1.20.hex.as.xml.msk similarity index 73% rename from example/diameter/launcher/deployments/test_examples/RxGx/07.AAR-flows.xml rename to example/diameter/launcher/resources/st_examples/DynamicQualification/1.20.hex.as.xml.msk index 3e11df3..9d0543d 100644 --- a/example/diameter/launcher/deployments/test_examples/RxGx/07.AAR-flows.xml +++ b/example/diameter/launcher/resources/st_examples/DynamicQualification/1.20.hex.as.xml.msk @@ -1,26 +1,26 @@ - - - + + + - + - - + + - - + + @@ -29,7 +29,7 @@ - + @@ -37,15 +37,15 @@ - - + + - - + + @@ -54,7 +54,7 @@ - + @@ -62,7 +62,7 @@ - - + + diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/10.RAA-install.xml b/example/diameter/launcher/resources/st_examples/DynamicQualification/1.28.hex.as.xml.msk similarity index 63% rename from example/diameter/launcher/deployments/test_examples/RxGx/10.RAA-install.xml rename to example/diameter/launcher/resources/st_examples/DynamicQualification/1.28.hex.as.xml.msk index 8c7f5b5..ec101b0 100644 --- a/example/diameter/launcher/deployments/test_examples/RxGx/10.RAA-install.xml +++ b/example/diameter/launcher/resources/st_examples/DynamicQualification/1.28.hex.as.xml.msk @@ -1,5 +1,5 @@ - - + + diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/11.CCR-U.xml b/example/diameter/launcher/resources/st_examples/DynamicQualification/1.30.hex.as.xml.msk similarity index 77% rename from example/diameter/launcher/deployments/test_examples/RxGx/11.CCR-U.xml rename to example/diameter/launcher/resources/st_examples/DynamicQualification/1.30.hex.as.xml.msk index 29aad50..42e6cd0 100644 --- a/example/diameter/launcher/deployments/test_examples/RxGx/11.CCR-U.xml +++ b/example/diameter/launcher/resources/st_examples/DynamicQualification/1.30.hex.as.xml.msk @@ -1,6 +1,6 @@ - - - + + + diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/13.STR_Rx.xml b/example/diameter/launcher/resources/st_examples/DynamicQualification/1.35.hex.as.xml.msk similarity index 64% rename from example/diameter/launcher/deployments/test_examples/RxGx/13.STR_Rx.xml rename to example/diameter/launcher/resources/st_examples/DynamicQualification/1.35.hex.as.xml.msk index 0f823dc..1f54e3a 100644 --- a/example/diameter/launcher/deployments/test_examples/RxGx/13.STR_Rx.xml +++ b/example/diameter/launcher/resources/st_examples/DynamicQualification/1.35.hex.as.xml.msk @@ -1,6 +1,6 @@ - - - + + + diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/16.RAA-remove.xml b/example/diameter/launcher/resources/st_examples/DynamicQualification/1.39.hex.as.xml.msk similarity index 63% rename from example/diameter/launcher/deployments/test_examples/RxGx/16.RAA-remove.xml rename to example/diameter/launcher/resources/st_examples/DynamicQualification/1.39.hex.as.xml.msk index 53a2386..ac0a303 100644 --- a/example/diameter/launcher/deployments/test_examples/RxGx/16.RAA-remove.xml +++ b/example/diameter/launcher/resources/st_examples/DynamicQualification/1.39.hex.as.xml.msk @@ -1,5 +1,5 @@ - - + + diff --git a/example/diameter/launcher/deployments/test_examples/RxGx/17.CCR-T.xml b/example/diameter/launcher/resources/st_examples/DynamicQualification/1.41.hex.as.xml.msk similarity index 77% rename from example/diameter/launcher/deployments/test_examples/RxGx/17.CCR-T.xml rename to example/diameter/launcher/resources/st_examples/DynamicQualification/1.41.hex.as.xml.msk index 84a790a..152ad13 100644 --- a/example/diameter/launcher/deployments/test_examples/RxGx/17.CCR-T.xml +++ b/example/diameter/launcher/resources/st_examples/DynamicQualification/1.41.hex.as.xml.msk @@ -1,6 +1,6 @@ - - - + + + diff --git a/example/diameter/launcher/resources/st_examples/DynamicQualification/15.hex.as.xml.msk b/example/diameter/launcher/resources/st_examples/DynamicQualification/15.hex.as.xml.msk new file mode 100644 index 0000000..dc7332d --- /dev/null +++ b/example/diameter/launcher/resources/st_examples/DynamicQualification/15.hex.as.xml.msk @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/diameter/launcher/resources/st_examples/DynamicQualification/20.hex.as.xml.msk b/example/diameter/launcher/resources/st_examples/DynamicQualification/20.hex.as.xml.msk new file mode 100644 index 0000000..0b4129c --- /dev/null +++ b/example/diameter/launcher/resources/st_examples/DynamicQualification/20.hex.as.xml.msk @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/diameter/launcher/resources/st_examples/DynamicQualification/28.hex.as.xml.msk b/example/diameter/launcher/resources/st_examples/DynamicQualification/28.hex.as.xml.msk new file mode 100644 index 0000000..92d6388 --- /dev/null +++ b/example/diameter/launcher/resources/st_examples/DynamicQualification/28.hex.as.xml.msk @@ -0,0 +1,7 @@ + + + + + + + diff --git a/example/diameter/launcher/resources/st_examples/DynamicQualification/30.hex.as.xml.msk b/example/diameter/launcher/resources/st_examples/DynamicQualification/30.hex.as.xml.msk new file mode 100644 index 0000000..6e53c57 --- /dev/null +++ b/example/diameter/launcher/resources/st_examples/DynamicQualification/30.hex.as.xml.msk @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/example/diameter/launcher/resources/st_examples/DynamicQualification/35.hex.as.xml.msk b/example/diameter/launcher/resources/st_examples/DynamicQualification/35.hex.as.xml.msk new file mode 100644 index 0000000..31a4d35 --- /dev/null +++ b/example/diameter/launcher/resources/st_examples/DynamicQualification/35.hex.as.xml.msk @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/example/diameter/launcher/resources/st_examples/DynamicQualification/39.hex.as.xml.msk b/example/diameter/launcher/resources/st_examples/DynamicQualification/39.hex.as.xml.msk new file mode 100644 index 0000000..b229433 --- /dev/null +++ b/example/diameter/launcher/resources/st_examples/DynamicQualification/39.hex.as.xml.msk @@ -0,0 +1,7 @@ + + + + + + + diff --git a/example/diameter/launcher/resources/st_examples/DynamicQualification/41.hex.as.xml.msk b/example/diameter/launcher/resources/st_examples/DynamicQualification/41.hex.as.xml.msk new file mode 100644 index 0000000..242a779 --- /dev/null +++ b/example/diameter/launcher/resources/st_examples/DynamicQualification/41.hex.as.xml.msk @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/example/diameter/launcher/resources/st_examples/DynamicQualification/testcase.txt.msk b/example/diameter/launcher/resources/st_examples/DynamicQualification/testcase.txt.msk new file mode 100644 index 0000000..b215519 --- /dev/null +++ b/example/diameter/launcher/resources/st_examples/DynamicQualification/testcase.txt.msk @@ -0,0 +1,17 @@ +test|__TESTID__|delay|0 +test|__TESTID__|delay|0 +test|__TESTID__|delay|0 +test|__TESTID__|sendxml2e|15.hex.as.xml +test|__TESTID__|waitfe|272|0|||MMTel_DynamicQualification;ggsnNodeHostname.ggsnNodeHostRealm.com;2;__SGX1_SUFFIX__|2001 +test|__TESTID__|sendxml2e|20.hex.as.xml +test|__TESTID__|waitfe|265|0|||MMTel_DynamicQualification;afNodeHostname.afNodeHostRealm.com;2;__SRX1_SUFFIX__|2001 +test|__TESTID__|waitfe|258|1|||MMTel_DynamicQualification;ggsnNodeHostname.ggsnNodeHostRealm.com;2;__SGX1_SUFFIX__ +test|__TESTID__|sendxml2e|28.hex.as.xml|8 +test|__TESTID__|sendxml2e|30.hex.as.xml +test|__TESTID__|waitfe|272|0|||MMTel_DynamicQualification;ggsnNodeHostname.ggsnNodeHostRealm.com;2;__SGX1_SUFFIX__|2001 +test|__TESTID__|sendxml2e|35.hex.as.xml +test|__TESTID__|waitfe|275|0|||MMTel_DynamicQualification;afNodeHostname.afNodeHostRealm.com;2;__SRX1_SUFFIX__|2001 +test|__TESTID__|waitfe|258|1|||MMTel_DynamicQualification;ggsnNodeHostname.ggsnNodeHostRealm.com;2;__SGX1_SUFFIX__ +test|__TESTID__|sendxml2e|39.hex.as.xml|14 +test|__TESTID__|sendxml2e|41.hex.as.xml +test|__TESTID__|waitfe|272|0|||MMTel_DynamicQualification;ggsnNodeHostname.ggsnNodeHostRealm.com;2;__SGX1_SUFFIX__|2001 diff --git a/example/diameter/launcher/resources/st_examples/README b/example/diameter/launcher/resources/st_examples/README new file mode 100644 index 0000000..b421345 --- /dev/null +++ b/example/diameter/launcher/resources/st_examples/README @@ -0,0 +1,3 @@ +Here there are testcase to clone. For example: + + ../scripts/clone.sh DynamicQualification/testcase.txt.msk 1 40 1 diff --git a/example/diameter/launcher/resources/stack_examples/0.xml b/example/diameter/launcher/resources/stack_examples/0.xml new file mode 100644 index 0000000..c1e23cc --- /dev/null +++ b/example/diameter/launcher/resources/stack_examples/0.xml @@ -0,0 +1,438 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/diameter/launcher/resources/stack_examples/16777236.xml b/example/diameter/launcher/resources/stack_examples/16777236.xml new file mode 100644 index 0000000..a0d53e3 --- /dev/null +++ b/example/diameter/launcher/resources/stack_examples/16777236.xml @@ -0,0 +1,696 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/diameter/launcher/resources/stack_examples/16777238.xml b/example/diameter/launcher/resources/stack_examples/16777238.xml new file mode 100644 index 0000000..efc5acd --- /dev/null +++ b/example/diameter/launcher/resources/stack_examples/16777238.xml @@ -0,0 +1,1270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/diameter/launcher/resources/stack_examples/16777302.xml b/example/diameter/launcher/resources/stack_examples/16777302.xml new file mode 100644 index 0000000..ce4e22d --- /dev/null +++ b/example/diameter/launcher/resources/stack_examples/16777302.xml @@ -0,0 +1,553 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.20.1