From 8de835b706e08eac4bb8fca78c1f373bfb29191f Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Sun, 22 Nov 2015 16:32:44 +0100 Subject: [PATCH] Separate dumps by state: enable/disable Success and Failed tests --- example/diameter/launcher/DEPLOY.sh | 3 +- example/diameter/launcher/DEPLOY_setups.sh | 27 ++++---- example/diameter/launcher/Launcher.cpp | 63 +++++++++++------- .../launcher/deployments/basic/configure.sh | 2 +- .../launcher/deployments/st-client/README | 2 +- .../deployments/st-client/configure.sh | 64 +++++++++---------- .../launcher/deployments/st-client/program.sh | 15 ++++- example/diameter/launcher/main.cpp | 2 +- .../launcher/resources/scripts/clone.sh | 4 +- .../diameter/launcher/testing/TestCase.cpp | 3 +- .../diameter/launcher/testing/TestManager.cpp | 10 ++- .../diameter/launcher/testing/TestManager.hpp | 9 ++- 12 files changed, 119 insertions(+), 85 deletions(-) diff --git a/example/diameter/launcher/DEPLOY.sh b/example/diameter/launcher/DEPLOY.sh index 1023729..360f1bb 100755 --- a/example/diameter/launcher/DEPLOY.sh +++ b/example/diameter/launcher/DEPLOY.sh @@ -18,7 +18,6 @@ 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 # @@ -206,7 +205,7 @@ else fi [ -d $DPATH ] && _exit "The installation path '$DPATH' must not exists." -EXE=ADML-`basename $DPATH` +EXE=`basename $DPATH` echo "Copying to '$DPATH' ..." mkdir -p $DPATH diff --git a/example/diameter/launcher/DEPLOY_setups.sh b/example/diameter/launcher/DEPLOY_setups.sh index 5a3256d..ff55549 100755 --- a/example/diameter/launcher/DEPLOY_setups.sh +++ b/example/diameter/launcher/DEPLOY_setups.sh @@ -55,44 +55,45 @@ read DIR case $type in 1) - $DEPLOY_SCR b $DIR/client - $DEPLOY_SCR b $DIR/server + $DEPLOY_SCR b $DIR/ADML-client + $DEPLOY_SCR b $DIR/ADML-server echo "Configuring ..." - cd $DIR/client + cd $DIR/ADML-client echo c | ./configure.sh >/dev/null cd - >/dev/null - cd $DIR/server + cd $DIR/ADML-server echo s | ./configure.sh >/dev/null cd - >/dev/null ;; 2) - $DEPLOY_SCR f $DIR/ft-client - $DEPLOY_SCR b $DIR/server + $DEPLOY_SCR f $DIR/ADML-ft-client + $DEPLOY_SCR b $DIR/ADML-server echo "Configuring ..." - cd $DIR/server + cd $DIR/ADML-server echo s | ./configure.sh >/dev/null cd - >/dev/null ;; 3) - $DEPLOY_SCR s $DIR/st-client - $DEPLOY_SCR b $DIR/serverGx - $DEPLOY_SCR b $DIR/serverRx + $DEPLOY_SCR s $DIR/ADML-st-client + $DEPLOY_SCR b $DIR/ADML-serverGx + $DEPLOY_SCR b $DIR/ADML-serverRx echo "Configuring ..." - cd $DIR/st-client + cd $DIR/ADML-st-client + ln -s realms_example realms 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 + cd $DIR/ADML-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 + cd $DIR/ADML-serverRx echo s | ./configure.sh >/dev/null ln -sf stacks/other_examples/16777236.xml dictionary.xml cd - >/dev/null diff --git a/example/diameter/launcher/Launcher.cpp b/example/diameter/launcher/Launcher.cpp index 0968b8d..bf80e2d 100644 --- a/example/diameter/launcher/Launcher.cpp +++ b/example/diameter/launcher/Launcher.cpp @@ -1340,12 +1340,16 @@ std::string Launcher::help() const throw() { result += "\n Test cases reports are not dumped on process context (too many information in general)."; result += "\n The report contains context information in every moment: this operation acts as a snapshot."; result += "\n"; - result += "\n test|report[|[yes]|no] Every time a test case is finished, its xml representation will be dump on a file under"; + result += "\n test|report|[|[yes]|no]"; + result += "\n"; + result += "\n Every time a test case is finished, its xml representation will be dump on a file under"; result += "\n the execution directory (or the one configured in process command-line 'tmDir') with"; - result += "\n the name 'cycle-.testcase-.xml'. This option is disabled by"; - result += "\n default reducing IO. ADML process context won't show test manager whole information"; - result += "\n because it could be a huge amount of data to write. Anyway, you could use the 'look'"; - result += "\n operation to see the desired report(s)."; + result += "\n the name 'cycle-.testcase-.xml'. The third parameter represents"; + result += "\n the test result condition to dump the information. By default, neither failed nor successful"; + result += "\n test cases are written to avoid IO overload (in most of cases not all the tests are going to"; + result += "\n fail and you could enable only such dumps, but you can enable both types if you want)."; + result += "\n Better, you can use the 'look' operation to see the desired report(s) and its result state,"; + result += "\n in case that you miss the xml files or you disabled all the dumps during testing."; result += "\n"; result += "\n test|report-hex[|[yes]|no] Reports could include the diameter messages in hexadecimal format. Disabled by default."; result += "\n"; @@ -1373,7 +1377,8 @@ std::string Launcher::help() const throw() { result += "\n"; result += "\n test|summary Test manager general report (number of test cases, counts by state, global configuration,"; result += "\n forced in-progress limitation, reports visibility, etc.). Be careful when you have reports"; - result += "\n dumps enabled because all the programmed test cases will be dump and that could be heavy."; + result += "\n enabled because the programmed test cases dumps could be heavy (try to disable both failed"; + result += "\n and successful dumps)."; result += "\n"; result += "\n"; result += "\nUSING OPERATIONS INTERFACE"; @@ -1769,19 +1774,19 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons } } else if((opType == "test")) { - // test||[|parameters] Add a new step to the test case ... - // test|ttps| Starts/resume the provided number of time ticks per second (ttps). The ADML starts ... - // test|next[|] Forces the execution of the next test case(s) without waiting for test manager tick ... - // test|ip-limit[|amount] In-progress limit of test cases. No new test cases will be launched over this value ... - // test|repeats| Restarts the whole programmed test list when finished the amount number of times ... - // test|report[|[yes]|no] Every time a test case is finished a report file in xml format will be created under ... - // test|report-hex[|[yes]|no] Reports could include the diameter messages in hexadecimal format. Disabled by default. - // test|goto| Updates current test pointer position. - // test|look[|id] Show programmed test case for id provided, current when missing ... - // test|interact|amount|id Makes interactive a specific test case id. The amount is the margin of execution steps ... - // test|reset|[|id] Reset the test case for id provided, all the tests when missing ... - // test|clear Clears all the programmed test cases. - // test|summary Test manager general report (number of test cases, counts by state ... + // test||[|parameters] Add a new step to the test case ... + // test|ttps| Starts/resume the provided number of time ticks per second (ttps). The ADML starts ... + // test|next[|] Forces the execution of the next test case(s) without waiting for test manager tick ... + // test|ip-limit[|amount] In-progress limit of test cases. No new test cases will be launched over this value ... + // test|repeats| Restarts the whole programmed test list when finished the amount number of times ... + // test|report|[|[yes]|no] Every time a test case is finished a report file in xml format will be created under ... + // test|report-hex[|[yes]|no] Reports could include the diameter messages in hexadecimal format. Disabled by default. + // test|goto| Updates current test pointer position. + // test|look[|id] Show programmed test case for id provided, current when missing ... + // test|interact|amount|id Makes interactive a specific test case id. The amount is the margin of execution steps ... + // test|reset|[|id] Reset the test case for id provided, all the tests when missing ... + // test|clear Clears all the programmed test cases. + // test|summary Test manager general report (number of test cases, counts by state ... if(param1 == "ttps") { @@ -1844,12 +1849,24 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons opt_response_content += anna::functions::asString("Pool repeats: %d%s (current cycle: %d)", repeats, nolimit.c_str(), testManager.getPoolCycle()); } else if(param1 == "report") { - if (numParams > 2) + if (numParams > 3) throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION); - if(param2 == "") param2 = "yes"; - testManager.setDumpReports((param2 == "yes")); - opt_response_content += (testManager.getDumpReports() ? "report enabled" : "report disabled"); + if(param2 != "Failed" && param2 != "Success") + throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION); + + if(param3 == "") param3 = "yes"; + bool enable = (param3 == "yes"); + + if(param2 == "Success") + testManager.setDumpSuccessfulReports(enable); + else + testManager.setDumpFailedReports(enable); + + opt_response_content += (enable ? "report enabled " : "report disabled "); + opt_response_content += "for "; + opt_response_content += param2; + opt_response_content += " tests"; } else if(param1 == "report-hex") { if (numParams > 2) diff --git a/example/diameter/launcher/deployments/basic/configure.sh b/example/diameter/launcher/deployments/basic/configure.sh index 3b326bc..c473692 100755 --- a/example/diameter/launcher/deployments/basic/configure.sh +++ b/example/diameter/launcher/deployments/basic/configure.sh @@ -88,7 +88,7 @@ then fi # Run script: -EXE_LINK=ADML-`basename $PWD` +EXE_LINK=`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 8950d84..8730f6e 100644 --- a/example/diameter/launcher/deployments/st-client/README +++ b/example/diameter/launcher/deployments/st-client/README @@ -18,7 +18,7 @@ you actually are establishing a total 5*N speed rate over the servers. TESTING PROCEDURE ----------------- -Firstly you shall program the test cases. For example: +Firstly you shall program the test cases by mean script './program.sh'. For example: ./program.sh st_examples/DynamicQualification Using option '-s', the testing will start after programming, with the desired rate diff --git a/example/diameter/launcher/deployments/st-client/configure.sh b/example/diameter/launcher/deployments/st-client/configure.sh index 9030c46..728440d 100755 --- a/example/diameter/launcher/deployments/st-client/configure.sh +++ b/example/diameter/launcher/deployments/st-client/configure.sh @@ -37,7 +37,7 @@ calculate_deployment_layout() { read max_server_accepted_connections [ "$max_server_accepted_connections" = "" ] && max_server_accepted_connections=5000 - echo "Input the maximum test case rate per second:" + echo "Input the maximum desired test case rate per second:" read desired_rate while [ -z "$desired_rate" ]; do read desired_rate; done @@ -47,49 +47,48 @@ calculate_deployment_layout() { G_ADML_CONNECTIONS=1 G_ADML_INSTANCES=1 return - fi - max_adml_instances=$((max_server_accepted_connections/MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE)) - if [ $max_connections -gt $max_server_accepted_connections ] + elif [ $max_connections -gt $max_server_accepted_connections ] then - echo - echo "Maximum rate reached for $max_server_accepted_connections server connections:" - G_ADML_CONNECTIONS=$MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE - G_ADML_INSTANCES=$max_adml_instances - return + _exit "Not enough server connections to fit the desired rate (requires $max_connections connections)." fi echo echo "===========================================================================================================" echo "Orientative table" echo "-----------------------------------------------------------------------------------------------------------" - echo -e "Connects per instance:\t1\t2\t3\t4\t5\t6\t7\t8\t9\t10" echo -n "Number of instances: " - for conn in `seq 1 $MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE` + for conn in `seq 1 $MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE | tac` do instances=$(ceil $max_connections $conn) echo -n -e "\t$instances" done echo + echo -e "Connects per instance:\t10\t9\t8\t7\t6\t5\t4\t3\t2\t1" echo "===========================================================================================================" echo - echo "Input selection (connections per instance 1..$MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE) [1]:" - read G_ADML_CONNECTIONS - [ -z "$G_ADML_CONNECTIONS" ] && G_ADML_CONNECTIONS=1 - [ $G_ADML_CONNECTIONS -lt 1 ] && G_ADML_CONNECTIONS=1 -# 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 + #echo "Input selection (connections per instance 1..$MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE) [1]:" + instances__dflt=$(ceil $max_connections $MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE) + echo "Input the desired number of ADML instances [$instances__dflt]:" + read G_ADML_INSTANCES + [ -z "$G_ADML_INSTANCES" ] && G_ADML_INSTANCES=$instances__dflt + [ $G_ADML_INSTANCES -lt 1 ] && G_ADML_INSTANCES=1 + G_ADML_CONNECTIONS=$(ceil $max_connections $G_ADML_INSTANCES) if [ $G_ADML_CONNECTIONS -gt $MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE ] then - G_ADML_CONNECTIONS=$MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE + echo "Warning: the number of connections per ADML instance ($G_ADML_CONNECTIONS) is greater" + echo " than the maximum suggested: $MAXIMUM_SUGGESTED_CLIENT_CONNECTION_PER_ADML_INSTANCE" + echo + echo "Press ENTER to continue, CTRL-C to abort ..." + read dummy + fi + client_connections=$((G_ADML_INSTANCES*G_ADML_CONNECTIONS)) + if [ $client_connections -gt $max_server_accepted_connections ] + then + echo + echo "Insufficient server connections available ($max_server_accepted_connections) to accept" + echo " launcher client connections: $G_ADML_INSTANCES x $G_ADML_CONNECTIONS = $client_connections." + _exit "Configuration error" fi - - G_ADML_INSTANCES=$(ceil $max_connections $G_ADML_CONNECTIONS) } ############# @@ -104,7 +103,7 @@ 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 !" +[ ! -d realms ] && _exit "Missing realms configuration (expecting '$PWD/realms' directory) !" calculate_deployment_layout @@ -125,6 +124,7 @@ echo " - $G_ADML_INSTANCES ADML instances" echo " - $G_ADML_CONNECTIONS client connections per ADML instance" maximum_rate=$((G_ADML_INSTANCES*G_ADML_CONNECTIONS*MAXIMUM_ADML_ASYNC_RATE)) echo " - Maximum rate: $maximum_rate test cases per second" +echo " - Desired rate: $desired_rate test cases per second" echo echo "Usually, you will program a test case per subscriber. Input the number of test cases to program:" read N_TESTCASES @@ -132,8 +132,8 @@ 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))) +time_covered_1=$(ceil $N_TESTCASES $desired_rate) +time_covered=$(ceil $N_TESTCASES $((desired_rate*G_ADML_INSTANCES))) echo "That amount covers $time_covered_1 seconds for one running ADML instance." if [ $G_ADML_INSTANCES -gt 1 ] then @@ -182,9 +182,9 @@ cd - >/dev/null for instance in `seq 1 $G_ADML_INSTANCES` do - echo "Creating ADMLS/$instance ..." - mkdir -p ADMLS/$instance - cd ADMLS/$instance + echo "Creating ADML instance $instance ..." + mkdir -p ADMLS/ADML-$instance + cd ADMLS/ADML-$instance # Create resources: ln -s ../../.operation-one.sh operation.sh ln -s ../../pre-start.sh diff --git a/example/diameter/launcher/deployments/st-client/program.sh b/example/diameter/launcher/deployments/st-client/program.sh index fccfe07..93cd866 100755 --- a/example/diameter/launcher/deployments/st-client/program.sh +++ b/example/diameter/launcher/deployments/st-client/program.sh @@ -27,7 +27,7 @@ usage() { 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" + [ $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 } @@ -60,14 +60,19 @@ 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 !!" +#CLONE_GROUPS=1 +MAX_NUMBER_GROUPS=$(grep ^MAX_NUMBER_GROUPS= clone.sh | cut -d= -f2) +ADML_INSTANCES=`cat .st_conf_adml_instances` +CLONE_GROUPS=$((MAX_NUMBER_GROUPS/ADML_INSTANCES)) + 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 & + ADML_DIR=`readlink -f ADMLS/ADML-$instance` + ./clone.sh $ADML_DIR $TESTCASE $ini_seq $fin_seq $CLONE_GROUPS & done < $PROGRAM_LAYOUT_FILE @@ -80,6 +85,10 @@ do sleep 1 done +echo +echo "Programming has finished !" +echo + echo "Configuring repeat cycles ..." ./operation.sh "test|repeats|$REPEATS" diff --git a/example/diameter/launcher/main.cpp b/example/diameter/launcher/main.cpp index 9f45651..2d44b3a 100644 --- a/example/diameter/launcher/main.cpp +++ b/example/diameter/launcher/main.cpp @@ -32,7 +32,7 @@ int main(int argc, const char** argv) { commandLine.add("services", anna::CommandLine::Argument::Mandatory, "Services xml path file. Shall be validated against dtd schema written on warning traces: 'Services DTD schema'. Empty string or \"null\" name, to start without services (see help for management operation 'services')."); commandLine.add("trace", anna::CommandLine::Argument::Optional, "Trace level (emergency, alert, critical, error, warning, notice, information, debug, local0..local7)"); commandLine.add("cntDir", anna::CommandLine::Argument::Optional, "Counters directory. By default is the current execution directory. Warning: a counter file will be dump per record period; take care about the possible accumulation of files"); - commandLine.add("tmDir", anna::CommandLine::Argument::Optional, "Test manager directory. By default is the current execution directory. Warning: report files could be dump during system testing (see help for management operation 'test|report'); take care about the possible accumulation of files"); + commandLine.add("tmDir", anna::CommandLine::Argument::Optional, "Test manager directory. By default is the current execution directory. Warning: report files could be dump during system testing (see help for management operation 'test|report|result'); take care about the possible accumulation of files"); commandLine.add("cntRecordPeriod", anna::CommandLine::Argument::Optional, "Counters record procedure period in milliseconds. If missing, default value of 300000 (5 minutes) will be assigned. Value of 0 disables the record procedure."); commandLine.add("logStatisticSamples", anna::CommandLine::Argument::Optional, "Log statistics samples for the provided concept id list, over './sample..csv' files. For example: \"1,2\" will log concepts 1 and 2. Reserved word \"all\" activates all registered statistics concept identifiers. That ids are shown at context dump (see help to get it)."); commandLine.add("disableLogs", anna::CommandLine::Argument::Optional, "Overrides every realm configuration regarding traffic log in order to disable it and ease production or system test startup.", false); diff --git a/example/diameter/launcher/resources/scripts/clone.sh b/example/diameter/launcher/resources/scripts/clone.sh index 099aa7f..318e681 100755 --- a/example/diameter/launcher/resources/scripts/clone.sh +++ b/example/diameter/launcher/resources/scripts/clone.sh @@ -131,7 +131,7 @@ clone() { rm $wkdir/testcase.txt.$sequence # Population: - if [ -n "$POPULATION_FILE" ] + if [ -n "$POPULATION" ] then parse_file $sequence $POPULATION_FILE $CLONE_WKDIR/${POPULATION}.$sequence cat $CLONE_WKDIR/${POPULATION}.$sequence >> $POPULATION_ALL @@ -188,7 +188,7 @@ fi GROUPS_SIZE=$((N_ITEMS/N_GROUPS)) if [ "$GROUPS_SIZE" -eq 0 ] then - echo "Assuming minimum allowed number of groups: $N_ITEMS" + echo "Assuming minimum allowed number of groups (one group per item): $N_ITEMS" GROUPS_SIZE=1 N_GROUPS=$N_ITEMS fi diff --git a/example/diameter/launcher/testing/TestCase.cpp b/example/diameter/launcher/testing/TestCase.cpp index 2817248..d69a61a 100644 --- a/example/diameter/launcher/testing/TestCase.cpp +++ b/example/diameter/launcher/testing/TestCase.cpp @@ -132,7 +132,8 @@ void TestCase::setState(const State::_v &state) throw() { if (isFinished()) { - if (!testManager.getDumpReports()) return; + if ((getState() == State::Failed) && (!testManager.getDumpFailedReports())) return; + if ((getState() == State::Success) && (!testManager.getDumpSuccessfulReports())) return; // report file name: cycle-.testcase-.xml // FORMAT: We tabulate the cycle and test case in order to ease ordering of files by mean ls: diff --git a/example/diameter/launcher/testing/TestManager.cpp b/example/diameter/launcher/testing/TestManager.cpp index bd9bbfc..e9cca9b 100644 --- a/example/diameter/launcher/testing/TestManager.cpp +++ b/example/diameter/launcher/testing/TestManager.cpp @@ -82,7 +82,8 @@ TestManager::TestManager() : anna::timex::TimeEventObserver("TestManager") { a_timeController = NULL; a_reportsDirectory = "./"; - a_dumpReports = false; + a_dumpSuccessfulReports = false; + a_dumpFailedReports = false; a_dumpHexMessages = false; a_synchronousAmount = 1; a_poolRepeats = 0; // repeat disabled by default @@ -460,7 +461,8 @@ throw() { result->createAttribute("InProgressLimit", ""); else result->createAttribute("InProgressLimit", a_inProgressLimit); - result->createAttribute("DumpReports", (a_dumpReports ? "yes":"no")); + result->createAttribute("DumpSuccessfulReports", (a_dumpSuccessfulReports ? "yes":"no")); + result->createAttribute("DumpFailedReports", (a_dumpFailedReports ? "yes":"no")); result->createAttribute("DumpHexMessages", (a_dumpHexMessages ? "yes":"no")); result->createAttribute("ReportsDirectory", a_reportsDirectory); if (a_clock) { @@ -471,9 +473,11 @@ throw() { if (a_currentTestIt != a_testPool.end()) { result->createAttribute("CurrentTestCaseId", (*a_currentTestIt).first); } - if (a_dumpReports && poolSize != 0) { + if (poolSize != 0) { anna::xml::Node* testCases = result->createChild("TestCases"); for (test_pool_it it = a_testPool.begin(); it != a_testPool.end(); it++) { + if (((*it).second->getState() == TestCase::State::Success) && (!getDumpSuccessfulReports())) continue; + if (((*it).second->getState() == TestCase::State::Failed) && (!getDumpFailedReports())) continue; (*it).second->asXML(testCases); } } diff --git a/example/diameter/launcher/testing/TestManager.hpp b/example/diameter/launcher/testing/TestManager.hpp index 76abcbb..43c5340 100644 --- a/example/diameter/launcher/testing/TestManager.hpp +++ b/example/diameter/launcher/testing/TestManager.hpp @@ -76,7 +76,7 @@ class TestManager : public anna::timex::TimeEventObserver, public anna::Singleto // reports std::string a_reportsDirectory; - bool a_dumpReports; + bool a_dumpSuccessfulReports, a_dumpFailedReports; bool a_dumpHexMessages; // Pool of test cases @@ -123,8 +123,11 @@ class TestManager : public anna::timex::TimeEventObserver, public anna::Singleto void setDumpHex(bool dh) throw() { a_dumpHexMessages = dh; } bool getDumpHex() const throw() { return a_dumpHexMessages; } - void setDumpReports(bool dr) throw() { a_dumpReports = dr; } - bool getDumpReports() const throw() { return a_dumpReports; } + void setDumpSuccessfulReports(bool dsr) throw() { a_dumpSuccessfulReports = dsr; } + void setDumpFailedReports(bool dfr) throw() { a_dumpFailedReports = dfr; } + + bool getDumpSuccessfulReports() const throw() { return a_dumpSuccessfulReports; } + bool getDumpFailedReports() const throw() { return a_dumpFailedReports; } // Helper to calculate time interval and synchronous amount of execution tests to guarantee the input rate (tests per second) // through the time manager which has a minimum resolution of ADML minimum resolution. The first call to this method will -- 2.20.1