X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FLauncher.cpp;fp=example%2Fdiameter%2Flauncher%2FLauncher.cpp;h=aebebecff1ffc2f8f0aeb8c7a34e6a950cac1957;hp=116c325e75285a49a5e0e2f3e7d6be04091e2256;hb=8b3eb3637cbe90fbabe70ec5667cce58cb7e368b;hpb=5e6cbe34594884c65483235a5d782fe5717cdce6 diff --git a/example/diameter/launcher/Launcher.cpp b/example/diameter/launcher/Launcher.cpp index 116c325..aebebec 100644 --- a/example/diameter/launcher/Launcher.cpp +++ b/example/diameter/launcher/Launcher.cpp @@ -25,6 +25,7 @@ #include #include #include +#include // Process #include @@ -1418,6 +1419,27 @@ std::string Launcher::help() const throw() { result += "\n test|report-hex[|[yes]|no] Reports could include the diameter messages in hexadecimal format. Disabled by default."; result += "\n"; result += "\n"; + result += "\n------------------------------------------------------------------------------------- Dynamic procedure"; + result += "\n"; + result += "\ndynamic[|args] This launch an internal operation implemented in 'Procedure' class."; + result += "\n Its default implementation does nothing, but you could create a dynamic"; + result += "\n library 'libanna_launcherDynamic.so' and replace the one in this project."; + result += "\n One interesting application consists in the use of the diameter API and"; + result += "\n event operation to create a set of libraries as the testing framework."; + result += "\n To execute each test case, the ADML process would be executed with a"; + result += "\n specific library path. But the main use would be the stress programming"; + result += "\n to achieve a great amount of cloned (even mixed) tests without using"; + result += "\n the management operation interface by mean http or signals: a single"; + result += "\n call to 'dynamic' would be enough to start a cascade of internally"; + result += "\n implemented operations."; + result += "\n This operation accepts a generic string argument (piped or not, as you"; + result += "\n desire and depending on your procedure implementation)."; + result += "\n"; + result += "\n This operation requires advanced programming and knowlegde of ANNA Diameter"; + result += "\n stack and testing framework, to take advantage of all the possibilities."; + result += "\n"; + result += "\n"; + result += "\n"; result += "\nUSING OPERATIONS INTERFACE"; result += "\n--------------------------"; result += "\n"; @@ -1510,6 +1532,17 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons /////////////////////////////////////////////////////////////////// // Simple operations without arguments: + // Dynamic operation: + if(operation.find("dynamic") == 0) { + Procedure p(this); + int op_size = operation.size(); + std::string args = ((operation.find("dynamic|") == 0) && (op_size > 8)) ? operation.substr(8) : ""; + if (args == "" && op_size != 7) + throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION); + p.execute(args, response_content); + return; + } + // Help: if(operation == "help") { response_content = help();