}
}
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);