From bae11e335034e5a80b471ca7be6207af6071829c Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Thu, 10 Dec 2015 18:17:58 +0100 Subject: [PATCH] Allow pipes in sh commands --- example/diameter/launcher/Launcher.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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); -- 2.20.1