From ed1119164e35f8192e11449af285ce94ce2c3dbe Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Fri, 27 Nov 2015 14:31:41 +0100 Subject: [PATCH] Support test|report|none operation. Add timeout to system test example --- example/diameter/launcher/Launcher.cpp | 13 +++++++------ .../DynamicQualification/testcase.txt.msk | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/example/diameter/launcher/Launcher.cpp b/example/diameter/launcher/Launcher.cpp index 67343ff..9aa5425 100644 --- a/example/diameter/launcher/Launcher.cpp +++ b/example/diameter/launcher/Launcher.cpp @@ -1366,7 +1366,7 @@ std::string Launcher::help() const throw() { result += "\n enabled because the programmed test cases dumps could be heavy (anyway you could enable the"; result += "\n dumps separately, for any of the possible states: Initialized, InProgress, Failed, Success)."; result += "\n"; - result += "\n test|report|[|[yes]|no]"; + result += "\n test|report|[|[yes]|no]"; result += "\n"; result += "\n Enables/disables report generation for a certain test case state: initialized, in-progress,"; result += "\n failed or success. This applies to report summary (former described operation) and automatic"; @@ -1781,7 +1781,7 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons // 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] + // test|report|[|[yes]|no] // Enables/disables report generation for a certain test case state: initialized, in-progress ... // test|report-hex[|[yes]|no] Reports could include the diameter messages in hexadecimal format. Disabled by default. // test|goto| Updates current test pointer position. @@ -1855,9 +1855,6 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons 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 != "initialized" && param2 != "in-progress" && param2 != "failed" && param2 != "success" && param2 != "all") - 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"); @@ -1869,8 +1866,12 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons testManager.setDumpFailedReports(enable); else if(param2 == "success") testManager.setDumpSuccessReports(enable); - else // all + else if(param2 == "all") testManager.setDumpAllReports(enable); + else if(param2 == "none") + testManager.setDumpAllReports(!enable); + else + throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION); opt_response_content += (enable ? "report enabled " : "report disabled "); opt_response_content += "for tests in '"; diff --git a/example/diameter/launcher/resources/st_examples/DynamicQualification/testcase.txt.msk b/example/diameter/launcher/resources/st_examples/DynamicQualification/testcase.txt.msk index 2abbda0..04aea23 100644 --- a/example/diameter/launcher/resources/st_examples/DynamicQualification/testcase.txt.msk +++ b/example/diameter/launcher/resources/st_examples/DynamicQualification/testcase.txt.msk @@ -1,6 +1,7 @@ test|__TESTID__|delay|0 test|__TESTID__|delay|0 test|__TESTID__|delay|0 +test|__TESTID__|timeout|5000 test|__TESTID__|sendxml2e|15.hex.as.xml test|__TESTID__|waitfe|272|0|||MMTel_DynamicQualification;ggsnNodeHostname.nodeHostRealm.com;2;1__SEQ8__|2001 test|__TESTID__|sendxml2e|20.hex.as.xml -- 2.20.1