X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FLauncher.cpp;h=eabf63511c09e76cd9db13fcd47d1c5a1d11bbef;hp=cd20991e481ff9ff342c998e8a622617c8989651;hb=bfedf5aed2670ccd65405c0ff96539ccb88b8f23;hpb=30def5757c5b3411f77fff62a163241ecc616337 diff --git a/example/diameter/launcher/Launcher.cpp b/example/diameter/launcher/Launcher.cpp index cd20991..eabf635 100644 --- a/example/diameter/launcher/Launcher.cpp +++ b/example/diameter/launcher/Launcher.cpp @@ -1457,6 +1457,10 @@ std::string Launcher::help() const throw() { result += "\n been done before. Test cases state & data will be reset (when achieved again), but general"; result += "\n statistics and counters will continue measuring until reset with 'collect' operation."; result += "\n"; + result += "\n test|auto-reset| When cycling, current test cases can be soft (default) or hard reset. If no timeout has"; + result += "\n been configured for the test case, hard reset could prevent stuck on the next cycle for"; + result += "\n those test cases still in progress."; + result += "\n"; result += "\n test|clear Clears all the programmed test cases and stop testing (if in progress)."; result += "\n"; result += "\n test|summary Test manager general report (number of test cases, counts by state, global configuration,"; @@ -1978,6 +1982,7 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons // 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|<[soft]/hard>[|id] Reset the test case for id provided, all the tests when missing ... + // test|auto-reset| When cycling, current test cases can be soft (default) or hard reset ... // test|clear Clears all the programmed test cases. // test|summary Test manager general report (number of test cases, counts by state ... @@ -2162,7 +2167,7 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons anna::testing::TestCase *testCase = ((id != -1) ? testManager.findTestCase(id) : NULL); if (testCase) { - bool done = testCase->reset((param2 == "hard") ? true:false); + bool done = testCase->reset(param2 == "hard"); opt_response_content = "test "; opt_response_content += param2; opt_response_content += " reset for id "; @@ -2171,7 +2176,7 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons } else { if (id == -1) { - bool anyReset = testManager.resetPool((param2 == "hard") ? true:false); + bool anyReset = testManager.resetPool(param2 == "hard"); opt_response_content = param2; opt_response_content += " reset have been sent to all programmed tests: "; opt_response_content += anyReset ? "some/all have been reset" : "nothing was reset"; } else { @@ -2181,6 +2186,16 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons } } } + else if(param1 == "auto-reset") { + if (numParams != 2) + throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION); + + if (param2 != "soft" && param2 != "hard") + throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION); + + testManager.setAutoResetHard(param2 == "hard"); + opt_response_content += anna::functions::asString("Auto-reset configured to '%s'", param2.c_str()); + } else if(param1 == "clear") { if (numParams > 1) throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);