From: Eduardo Ramos Testillano Date: Thu, 10 Dec 2015 17:17:58 +0000 (+0100) Subject: Allow pipes in sh commands X-Git-Tag: REFACTORING_TESTING_LIBRARY~65 X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=commitdiff_plain;h=bae11e335034e5a80b471ca7be6207af6071829c Allow pipes in sh commands --- diff --git a/example/diameter/launcher/Launcher.cpp b/example/diameter/launcher/Launcher.cpp index 120fabc..0faafe2 100644 --- a/example/diameter/launcher/Launcher.cpp +++ b/example/diameter/launcher/Launcher.cpp @@ -2079,10 +2079,13 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons } } else if (param2 == "sh-command") { - if (numParams > 4) - throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION); + // Allow pipes in command: + //if (numParams > 4) + // throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION); if(param3 == "") throw anna::RuntimeException("Missing script/executable command-line for 'sh-command' in test id operation", ANNA_FILE_LOCATION); - testManager.getTestCase(id)->addCommand(param3); // creates / reuses + std::string token = "|sh-command|"; + std::string command = operation.substr(operation.find(token) + token.size()); + testManager.getTestCase(id)->addCommand(command); // creates / reuses } else { throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);