From 5bf5055ab79aaf464e2491cfbab173ba37ba3419 Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Tue, 24 Nov 2015 18:17:26 +0100 Subject: [PATCH] Make Origin-Host the node identifier instead of origin-realm --- example/diameter/launcher/DEPLOY_setups.sh | 2 +- example/diameter/launcher/Launcher.cpp | 209 +++++++++--------- example/diameter/launcher/Launcher.hpp | 30 +-- .../diameter/launcher/MyDiameterEntity.cpp | 12 +- example/diameter/launcher/MyLocalServer.cpp | 12 +- .../{RealmNode.cpp => OriginHost.cpp} | 57 ++--- .../{RealmNode.hpp => OriginHost.hpp} | 14 +- .../deployments/advanced/services.msk | 2 +- .../deployments/ft-client/services.msk | 2 +- .../deployments/ft-client/tests/go.sh | 4 +- .../deployments/st-client/configure.sh | 6 +- .../deployments/st-client/operation_all.sh | 1 + .../st-client/realms_example/services.msk | 11 - .../README | 2 +- .../cerGx.xml | 4 +- .../cerRx.xml | 4 +- .../dictionaryBase.xml | 0 .../dictionaryGx.xml | 0 .../dictionaryRx.xml | 0 .../st-client/services_example/services.msk | 11 + example/diameter/launcher/main.cpp | 2 +- .../launcher/resources/scripts/clone.sh | 16 +- .../resources/services_examples/balancer.xml | 4 +- .../resources/services_examples/client.xml | 2 +- .../resources/services_examples/dummy.xml | 2 +- .../services_examples/multi-client.xml | 8 +- .../resources/services_examples/server.xml | 2 +- .../resources/services_examples/services.dtd | 13 +- .../DynamicQualification/.testcase.txt.st | 14 +- .../DynamicQualification/15.hex.as.xml.msk | 6 +- .../DynamicQualification/20.hex.as.xml.msk | 6 +- .../DynamicQualification/28.hex.as.xml.msk | 6 +- .../DynamicQualification/30.hex.as.xml.msk | 6 +- .../DynamicQualification/35.hex.as.xml.msk | 6 +- .../DynamicQualification/39.hex.as.xml.msk | 6 +- .../DynamicQualification/41.hex.as.xml.msk | 6 +- .../DynamicQualification/testcase.txt.msk | 14 +- .../launcher/resources/xml_examples/aaa.xml | 4 +- .../diameter/launcher/testing/TestCase.cpp | 8 +- .../diameter/launcher/testing/TestCase.hpp | 6 +- .../diameter/launcher/testing/TestManager.cpp | 22 +- .../diameter/launcher/testing/TestManager.hpp | 6 +- .../diameter/launcher/testing/TestStep.cpp | 18 +- .../diameter/launcher/testing/TestStep.hpp | 10 +- include/anna/diameter.comm/Engine.hpp | 33 ++- source/diameter.comm/Engine.cpp | 52 +++-- source/diameter.comm/Entity.cpp | 17 +- source/diameter.comm/LocalServer.cpp | 6 +- source/diameter.comm/Server.cpp | 6 +- 49 files changed, 354 insertions(+), 336 deletions(-) rename example/diameter/launcher/{RealmNode.cpp => OriginHost.cpp} (84%) rename example/diameter/launcher/{RealmNode.hpp => OriginHost.hpp} (94%) delete mode 100644 example/diameter/launcher/deployments/st-client/realms_example/services.msk rename example/diameter/launcher/deployments/st-client/{realms_example => services_example}/README (94%) rename example/diameter/launcher/deployments/st-client/{realms_example => services_example}/cerGx.xml (74%) rename example/diameter/launcher/deployments/st-client/{realms_example => services_example}/cerRx.xml (75%) rename example/diameter/launcher/deployments/st-client/{realms_example => services_example}/dictionaryBase.xml (100%) rename example/diameter/launcher/deployments/st-client/{realms_example => services_example}/dictionaryGx.xml (100%) rename example/diameter/launcher/deployments/st-client/{realms_example => services_example}/dictionaryRx.xml (100%) create mode 100644 example/diameter/launcher/deployments/st-client/services_example/services.msk diff --git a/example/diameter/launcher/DEPLOY_setups.sh b/example/diameter/launcher/DEPLOY_setups.sh index ff55549..fe89053 100755 --- a/example/diameter/launcher/DEPLOY_setups.sh +++ b/example/diameter/launcher/DEPLOY_setups.sh @@ -81,7 +81,7 @@ case $type in $DEPLOY_SCR b $DIR/ADML-serverRx echo "Configuring ..." cd $DIR/ADML-st-client - ln -s realms_example realms + ln -s services_example services mv run.sh .run-one.sh mv run_all.sh run.sh mv operation.sh .operation-one.sh diff --git a/example/diameter/launcher/Launcher.cpp b/example/diameter/launcher/Launcher.cpp index 4219399..67343ff 100644 --- a/example/diameter/launcher/Launcher.cpp +++ b/example/diameter/launcher/Launcher.cpp @@ -27,7 +27,7 @@ // Process #include -#include +#include #include #include #include @@ -59,14 +59,13 @@ const char *ServicesDTD = "\ -->\n\ \n\ \n\ -\n\ +\n\ "; - result += "\n "; + result += "\n "; result += "\n"; result += "\n"; result += "\nServer configuration:"; @@ -908,13 +907,13 @@ std::string Launcher::help() const throw() { result += "\n "; result += "\n"; result += "\n "; - result += "\n "; + result += "\n "; result += "\n"; result += "\n"; result += "\nIf you act as a proxy or a translation agent, you need to combine both former setups, and probably"; result += "\n will need to program the answers to be replied through the operations interface. To balance the"; result += "\n traffic at your client side you shall use '--balance' and '--sessionBasedModelsClientSocketSelection'"; - result += "\n arguments in order to define the balancing behaviour. To make hybrid setups you only must mix the realms:"; + result += "\n arguments in order to define the balancing behaviour. To make hybrid setups you only must mix the nodes:"; result += "\n"; result += "\nClient and server configuration:"; result += "\n"; @@ -925,8 +924,8 @@ std::string Launcher::help() const throw() { result += "\n "; result += "\n"; result += "\n "; - result += "\n "; - result += "\n "; + result += "\n "; + result += "\n "; result += "\n"; result += "\n"; result += "\n"; @@ -948,7 +947,7 @@ std::string Launcher::help() const throw() { result += "\n"; result += "\n--------------------------------------------------------------------------------------- Node management"; result += "\n"; - result += "\nnode[|] Selects a context working node by mean a registered name."; + result += "\nnode[|] Selects a context working node by mean a registered name (origin-host)."; result += "\n All the subsequent operations will be forced to work with"; result += "\n this node, which makes possible some rare scenarios like"; result += "\n sending unexpected messages on remote peers. This is also"; @@ -958,12 +957,12 @@ std::string Launcher::help() const throw() { result += "\n"; result += "\nnode_auto Returns to the default behaviour (smart node selection)."; result += "\n Depending on the operation, this could imply a global"; - result += "\n action scope, affecting to all the registered realms."; + result += "\n action scope, affecting to all the registered hosts."; result += "\n This should be the normal configuration. Take into"; result += "\n account that if you fix the working node, this could"; result += "\n affect to things like test programming: communication"; result += "\n resources will override those which would be inferred"; - result += "\n from programmed messages Origin-Realm avps."; + result += "\n from programmed messages Origin-Host avps."; result += "\n"; result += "\n------------------------------------------------------------------------------------ Parsing operations"; result += "\n"; @@ -979,7 +978,7 @@ std::string Launcher::help() const throw() { result += "\n line '--services' parameter was used or not. Those services which"; result += "\n are not correctly loaded will be ignored to keep the process alive."; result += "\n If you need to load services as deltas, you must firstly load the"; - result += "\n diameter base dictionary with stack id 0, because all the realms"; + result += "\n diameter base dictionary with stack id 0, because all the nodes"; result += "\n will use this dictionary to encode/decode base protocol messages"; result += "\n managed by the communication engine."; result += "\n"; @@ -992,7 +991,7 @@ std::string Launcher::help() const throw() { result += "\n performance measurement. Context data can be written at"; result += "\n '/var/tmp/anna.context.' by mean 'kill -10 '."; result += "\n or sending operation 'context|[target file]'."; - result += "\n This operation applies over all the registered realm nodes"; + result += "\n This operation applies over all the registered host nodes"; result += "\n except if one specific working node has been set."; result += "\nforceCountersRecord Forces dump to file the current counters of the process."; result += "\nshow-oam Dumps current counters of the process. This is also done at"; @@ -1081,10 +1080,10 @@ std::string Launcher::help() const throw() { result += "\n"; result += "\n------------------------------------------------------------------------------------------- Burst tests"; result += "\n"; - result += "\nIn order to simplify user experience, burst category operations are only allowed in single realm node"; - result += "\n configuration. Indeed, you could send messages with incorrect Origin-Realm, and no warning is shown."; - result += "\nAll the operations are performed through the unique realm: if you need to use more interfaces, you may"; - result += "\n launch different ADML instances. Is nonsense to allow burst in a multi-realm configured ADML, because"; + result += "\nIn order to simplify user experience, burst category operations are only allowed in single host node"; + result += "\n configuration. Indeed, you could send messages with unmatched Origin-Host, and no warning is shown."; + result += "\nAll the operations are performed through the unique host: if you need to use more interfaces, you may"; + result += "\n launch different ADML instances. Is nonsense to allow burst in a multi-host configured ADML, because"; result += "\n this feature is not able to coordinate the messages."; result += "\n"; result += "\nburst|[|parameter] Used for performance testing, we first program diameter requests"; @@ -1117,7 +1116,7 @@ std::string Launcher::help() const throw() { result += "\n-------------------------------------------------------------------------------------- Advanced testing"; result += "\n"; result += "\n Burst mode only allows single interface interaction. For multiple interface"; - result += "\n (realm) coordination, you could use the advanced test cases programming:"; + result += "\n (origin-host) coordination, you could use the advanced test cases programming:"; result += "\n"; result += "\n"; result += "\n test||[|parameters]"; @@ -1215,7 +1214,7 @@ std::string Launcher::help() const throw() { result += "\n which fulfills that condition. This message is useful together with the peer"; result += "\n connection source in a further send step configured with the corresponding"; result += "\n response. You could also insert a delay between wait and send steps to be"; - result += "\n more realistic (processing time simulation in a specific ADML realm node)."; + result += "\n more realistic (processing time simulation in a specific ADML host node)."; result += "\n Always, a response send step will get the needed information from the most"; result += "\n recent wait step finding in reverse order (note that some race conditions"; result += "\n could happen if your condition is not specific enough)."; @@ -1253,7 +1252,7 @@ std::string Launcher::help() const throw() { result += "\n RFC says that a hop by hop must be unique for a specific connection, something that"; result += "\n could be difficult to manage if we have multiple available connections from client"; result += "\n side endpoint (entity or local server), even if we would have only one connection but"; - result += "\n several realm interfaces. It is enough to configure different hop-by-hop values within"; + result += "\n several host interfaces. It is enough to configure different hop-by-hop values within"; result += "\n each test case, because on reception, the Session-Id is used to identify that test case."; result += "\n"; result += "\n"; @@ -1563,7 +1562,7 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons return; } - // Realm switch: + // Host switch: if(opType == "node") { if (param1 != "") { if (setWorkingNode(param1)) response_content = anna::functions::asString("Forced node is now '%s'", param1.c_str()); @@ -1585,12 +1584,12 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons return; } - // Operated realm from possible forced-working node: - a_operatedRealm = a_workingNode ? a_workingNode /* priority */: NULL /* auto */; + // Operated host from possible forced-working node: + a_operatedHost = a_workingNode ? a_workingNode /* priority */: NULL /* auto */; // Use later: - // If any message is managed: updateOperatedRealmNodeWithMessage(codecMessage) + // If any message is managed: updateOperatedOriginHostWithMessage(codecMessage) // To operate, use the exception-protected methods which never will return NULL: - // getOperatedRealm(), getOperatedEntity(), getOperatedServer(), getOperatedEngine() + // getOperatedHost(), getOperatedEntity(), getOperatedServer(), getOperatedEngine() if(opType == "code") { @@ -1655,8 +1654,8 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons if(opType == "sendxml2e") { codecMsg.loadXML(param1); - updateOperatedRealmNodeWithMessage(codecMsg); - msg = getOperatedRealm()->createCommMessage(); + updateOperatedOriginHostWithMessage(codecMsg); + msg = getOperatedHost()->createCommMessage(); msg->clearBody(); try { codecMsg.valid(); } catch(anna::RuntimeException &ex) { ex.trace(); } // at least we need to see validation errors although it will continue sending (see validation mode configured in launcher) msg->setBody(codecMsg.code()); @@ -1664,25 +1663,25 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons // Get DataBlock from file with hex content: if(!getDataBlockFromHexFile(param1, db_aux)) throw anna::RuntimeException("Error reading hex file provided", ANNA_FILE_LOCATION); - msg = getOperatedRealm()->createCommMessage(); + msg = getOperatedHost()->createCommMessage(); msg->setBody(db_aux); - try { if(getOperatedRealm()->logEnabled()) codecMsg.decode(db_aux); } catch(anna::RuntimeException &ex) { ex.trace(); } + try { if(getOperatedHost()->logEnabled()) codecMsg.decode(db_aux); } catch(anna::RuntimeException &ex) { ex.trace(); } } bool success = getOperatedEntity()->send(msg, cl.exists("balance")); - getOperatedRealm()->releaseCommMessage(msg); + getOperatedHost()->releaseCommMessage(msg); // Detailed log: - if(getOperatedRealm()->logEnabled()) { + if(getOperatedHost()->logEnabled()) { anna::diameter::comm::Server *usedServer = getOperatedEntity()->getLastUsedResource(); anna::diameter::comm::ClientSession *usedClientSession = usedServer ? usedServer->getLastUsedResource() : NULL; std::string detail = usedClientSession ? usedClientSession->asString() : ""; // shouldn't happen - getOperatedRealm()->writeLogFile(codecMsg, (success ? "sent2e" : "send2eError"), detail); + getOperatedHost()->writeLogFile(codecMsg, (success ? "sent2e" : "send2eError"), detail); } } else if((opType == "burst")) { - if (!uniqueRealm()) - throw anna::RuntimeException("Burst category operations are only allowed in single realm node configuration. This is only to simplify user experience.", ANNA_FILE_LOCATION); + if (!uniqueOriginHost()) + throw anna::RuntimeException("Burst category operations are only allowed in single host node configuration. This is only to simplify user experience.", ANNA_FILE_LOCATION); // burst|clear clears all loaded burst messages. // burst|load| loads the next diameter message into launcher burst. @@ -1699,7 +1698,7 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons if(param1 == "clear") { opt_response_content = "removed "; - opt_response_content += anna::functions::asString(getOperatedRealm()->clearBurst()); + opt_response_content += anna::functions::asString(getOperatedHost()->clearBurst()); opt_response_content += " elements"; } else if(param1 == "load") { if(param2 == "") throw anna::RuntimeException("Missing xml path file for burst load operation", ANNA_FILE_LOCATION); @@ -1708,7 +1707,7 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons if(codecMsg.isAnswer()) throw anna::RuntimeException("Cannot load diameter answers for burst feature", ANNA_FILE_LOCATION); try { codecMsg.valid(); } catch(anna::RuntimeException &ex) { ex.trace(); } // at least we need to see validation errors although it will continue loading (see validation mode configured in launcher) - int position = getOperatedRealm()->loadBurstMessage(codecMsg.code()); + int position = getOperatedHost()->loadBurstMessage(codecMsg.code()); opt_response_content = "loaded '"; opt_response_content += param2; opt_response_content += "' file into burst list position "; @@ -1717,7 +1716,7 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons if(param2 == "") throw anna::RuntimeException("Missing initial load for burst start operation", ANNA_FILE_LOCATION); int initialLoad = atoi(param2.c_str()); - int processed = getOperatedRealm()->startBurst(initialLoad); + int processed = getOperatedHost()->startBurst(initialLoad); if(processed > 0) { opt_response_content = "initial load completed for "; @@ -1726,7 +1725,7 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons } else if(param1 == "push") { if(param2 == "") throw anna::RuntimeException("Missing load amount for burst push operation", ANNA_FILE_LOCATION); - int pushed = getOperatedRealm()->pushBurst(atoi(param2.c_str())); + int pushed = getOperatedHost()->pushBurst(atoi(param2.c_str())); if(pushed > 0) { opt_response_content = "pushed "; @@ -1736,14 +1735,14 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons if(param2 == "") throw anna::RuntimeException("Missing amount for burst pop operation", ANNA_FILE_LOCATION); int releaseLoad = atoi(param2.c_str()); - int popped = getOperatedRealm()->popBurst(releaseLoad); + int popped = getOperatedHost()->popBurst(releaseLoad); if(popped > 0) { opt_response_content = "burst popped for "; opt_response_content += anna::functions::entriesAsString(popped, "message"); } } else if(param1 == "stop") { - int left = getOperatedRealm()->stopBurst(); + int left = getOperatedHost()->stopBurst(); if(left != -1) { opt_response_content += anna::functions::entriesAsString(left, "message"); @@ -1753,12 +1752,12 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons if(param2 == "") param2 = "yes"; bool repeat = (param2 == "yes"); - getOperatedRealm()->repeatBurst(repeat); + getOperatedHost()->repeatBurst(repeat); opt_response_content += (repeat ? "repeat enabled" : "repeat disabled"); } else if(param1 == "send") { if(param2 == "") throw anna::RuntimeException("Missing amount for burst send operation", ANNA_FILE_LOCATION); - int sent = getOperatedRealm()->sendBurst(atoi(param2.c_str())); + int sent = getOperatedHost()->sendBurst(atoi(param2.c_str())); if(sent > 0) { opt_response_content = "sent "; @@ -1767,11 +1766,11 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons } else if(param1 == "goto") { if(param2 == "") throw anna::RuntimeException("Missing order position for burst goto operation", ANNA_FILE_LOCATION); - opt_response_content = getOperatedRealm()->gotoBurst(atoi(param2.c_str())); + opt_response_content = getOperatedHost()->gotoBurst(atoi(param2.c_str())); } else if(param1 == "look") { int order = ((param2 != "") ? atoi(param2.c_str()) : -1); opt_response_content = "\n\n"; - opt_response_content += getOperatedRealm()->lookBurst(order); + opt_response_content += getOperatedHost()->lookBurst(order); } else { throw anna::RuntimeException("Wrong body content format on HTTP Request for 'burst' operation (unexpected action parameter). See help", ANNA_FILE_LOCATION); } @@ -2035,13 +2034,13 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons else { if (param4 == "") LOGWARNING(anna::Logger::warning("Step number has not been provided. Take into account that this answer message will be sent 'as is' and sequence information could be wrong at the remote peer", ANNA_FILE_LOCATION)); } - updateOperatedRealmNodeWithMessage(codecMsg); + updateOperatedOriginHostWithMessage(codecMsg); int stepNumber = ((param4 != "") ? atoi(param4.c_str()):-1); if (param2 == "sendxml2e") - testManager.getTestCase(id)->addSendxml2e(codecMsg.code(), getOperatedRealm(), stepNumber); // creates / reuses + testManager.getTestCase(id)->addSendxml2e(codecMsg.code(), getOperatedHost(), stepNumber); // creates / reuses else - testManager.getTestCase(id)->addSendxml2c(codecMsg.code(), getOperatedRealm(), stepNumber); // creates / reuses + testManager.getTestCase(id)->addSendxml2c(codecMsg.code(), getOperatedHost(), stepNumber); // creates / reuses } else if (param2 == "delay") { if (numParams > 3) @@ -2088,8 +2087,8 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons if(opType == "sendxml2c") { codecMsg.loadXML(param1); - updateOperatedRealmNodeWithMessage(codecMsg); - msg = getOperatedRealm()->createCommMessage(); + updateOperatedOriginHostWithMessage(codecMsg); + msg = getOperatedHost()->createCommMessage(); msg->clearBody(); try { codecMsg.valid(); } catch(anna::RuntimeException &ex) { ex.trace(); } // at least we need to see validation errors although it will continue sending (see validation mode configured in launcher) @@ -2098,18 +2097,18 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons // Get DataBlock from file with hex content: if(!getDataBlockFromHexFile(param1, db_aux)) throw anna::RuntimeException("Error reading hex file provided", ANNA_FILE_LOCATION); - msg = getOperatedRealm()->createCommMessage(); + msg = getOperatedHost()->createCommMessage(); msg->setBody(db_aux); } bool success = getOperatedServer()->send(msg); - getOperatedRealm()->releaseCommMessage(msg); + getOperatedHost()->releaseCommMessage(msg); // Detailed log: - if(getOperatedRealm()->logEnabled()) { + if(getOperatedHost()->logEnabled()) { anna::diameter::comm::ServerSession *usedServerSession = getOperatedServer()->getLastUsedResource(); std::string detail = usedServerSession ? usedServerSession->asString() : ""; // shouldn't happen - getOperatedRealm()->writeLogFile(codecMsg, (success ? "sent2c" : "send2cError"), detail); + getOperatedHost()->writeLogFile(codecMsg, (success ? "sent2c" : "send2cError"), detail); } } else if(opType == "loadxml") { codecMsg.loadXML(param1); @@ -2133,8 +2132,8 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons getOperatedServer()->getReactingAnswers()->dump(); } else { codecMsg.loadXML(param1); - updateOperatedRealmNodeWithMessage(codecMsg); - anna::diameter::codec::Message *message = getOperatedRealm()->getCodecEngine()->createMessage(param1); // loads xml again, lesser of two evils + updateOperatedOriginHostWithMessage(codecMsg); + anna::diameter::codec::Message *message = getOperatedHost()->getCodecEngine()->createMessage(param1); // loads xml again, lesser of two evils LOGDEBUG(anna::Logger::debug(message->asXMLString(), ANNA_FILE_LOCATION)); if(message->isRequest()) @@ -2159,8 +2158,8 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons getOperatedEntity()->getReactingAnswers()->dump(); } else { codecMsg.loadXML(param1); - updateOperatedRealmNodeWithMessage(codecMsg); - anna::diameter::codec::Message *message = getOperatedRealm()->getCodecEngine()->createMessage(param1); // loads xml again, lesser of two evils + updateOperatedOriginHostWithMessage(codecMsg); + anna::diameter::codec::Message *message = getOperatedHost()->getCodecEngine()->createMessage(param1); // loads xml again, lesser of two evils LOGDEBUG(anna::Logger::debug(message->asXMLString(), ANNA_FILE_LOCATION)); if(message->isRequest()) @@ -2190,7 +2189,7 @@ throw() { result->createAttribute("StartTime", a_start_time.asString()); result->createAttribute("SecondsLifeTime", anna::time::functions::lapsedMilliseconds() / 1000); // Diameter: - for (realm_nodes_it it = a_nodes.begin(); it != a_nodes.end(); it++) { + for (origin_hosts_it it = a_originHosts.begin(); it != a_originHosts.end(); it++) { it->second->asXML(result); } diff --git a/example/diameter/launcher/Launcher.hpp b/example/diameter/launcher/Launcher.hpp index 2101948..af8a07a 100644 --- a/example/diameter/launcher/Launcher.hpp +++ b/example/diameter/launcher/Launcher.hpp @@ -43,16 +43,16 @@ namespace anna { } class TestManager; -class RealmNode; +class OriginHost; class MyDiameterEntity; class MyLocalServer; class MyDiameterEngine; -// RealmNode resources -class RealmNode; -typedef std::map realm_nodes_t; -typedef std::map::const_iterator realm_nodes_it; -typedef std::map::iterator realm_nodes_nc_it; +// OriginHost resources +class OriginHost; +typedef std::map origin_hosts_t; +typedef std::map::const_iterator origin_hosts_it; +typedef std::map::iterator origin_hosts_nc_it; class Launcher : public anna::comm::Application { @@ -68,9 +68,9 @@ class Launcher : public anna::comm::Application { MyCounterRecorderClock *a_counterRecorderClock; // Nodes deployment: - realm_nodes_t a_nodes; - RealmNode *a_workingNode; - RealmNode *a_operatedRealm; // auxiliary for eventOperation + origin_hosts_t a_originHosts; + OriginHost *a_workingNode; + OriginHost *a_operatedHost; // auxiliary for eventOperation // comm resources: anna::comm::ServerSocket* a_httpServerSocket; // HTTP @@ -90,13 +90,13 @@ public: void startServices() throw(anna::RuntimeException); bool setWorkingNode(const std::string &name) throw(); - RealmNode *getRealmNode(const std::string &realmName) const throw(anna::RuntimeException); - RealmNode *getRealmNode(const anna::diameter::codec::Message &message) const throw(anna::RuntimeException); - bool uniqueRealm() const throw() { return (a_nodes.size() == 1); } + OriginHost *getOriginHost(const std::string &oh) const throw(anna::RuntimeException); + OriginHost *getOriginHost(const anna::diameter::codec::Message &message) const throw(anna::RuntimeException); + bool uniqueOriginHost() const throw() { return (a_originHosts.size() == 1); } - // Operated realm for communication resources smart assignment //////////////////////////////////////////////////////////// - void updateOperatedRealmNodeWithMessage(const anna::diameter::codec::Message &message) throw(anna::RuntimeException); - RealmNode *getOperatedRealm() const throw(anna::RuntimeException); + // Operated host for communication resources smart assignment //////////////////////////////////////////////////////////// + void updateOperatedOriginHostWithMessage(const anna::diameter::codec::Message &message) throw(anna::RuntimeException); + OriginHost *getOperatedHost() const throw(anna::RuntimeException); MyDiameterEntity *getOperatedEntity() const throw(anna::RuntimeException); MyLocalServer *getOperatedServer() const throw(anna::RuntimeException); MyDiameterEngine *getOperatedEngine() const throw(anna::RuntimeException); diff --git a/example/diameter/launcher/MyDiameterEntity.cpp b/example/diameter/launcher/MyDiameterEntity.cpp index 6dcf797..5e78ab3 100644 --- a/example/diameter/launcher/MyDiameterEntity.cpp +++ b/example/diameter/launcher/MyDiameterEntity.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include @@ -33,7 +33,7 @@ void MyDiameterEntity::eventRequestRetransmission(const anna::diameter::comm::Cl // Performance stats: Launcher& my_app = static_cast (anna::app::functions::getApp()); - RealmNode * my_node = my_app.getRealmNode(getEngine()->getRealm()); + OriginHost * my_node = my_app.getOriginHost(getEngine()->getOriginHost()); // CommandId: anna::diameter::CommandId cid = anna::diameter::codec::functions::getCommandId(request->getBody()); LOGDEBUG @@ -99,7 +99,7 @@ throw(anna::RuntimeException) { LOGMETHOD(anna::TraceMethod tm("launcher::MyDiameterEntity", "eventRequest", ANNA_FILE_LOCATION)); // Performance stats: Launcher& my_app = static_cast (anna::app::functions::getApp()); - RealmNode * my_node = my_app.getRealmNode(getEngine()->getRealm()); + OriginHost * my_node = my_app.getOriginHost(getEngine()->getOriginHost()); // CommandId: anna::diameter::CommandId cid = anna::diameter::codec::functions::getCommandId(message); @@ -183,7 +183,7 @@ void MyDiameterEntity::eventResponse(const anna::diameter::comm::Response &respo throw(anna::RuntimeException) { LOGMETHOD(anna::TraceMethod tm("launcher::MyDiameterEntity", "eventResponse", ANNA_FILE_LOCATION)); Launcher& my_app = static_cast (anna::app::functions::getApp()); - RealmNode * my_node = my_app.getRealmNode(getEngine()->getRealm()); + OriginHost * my_node = my_app.getOriginHost(getEngine()->getOriginHost()); anna::diameter::comm::ClassCode::_v code = response.getClassCode(); anna::diameter::comm::Response::ResultCode::_v result = response.getResultCode(); anna::diameter::comm::Message* request = const_cast(response.getRequest()); @@ -279,7 +279,7 @@ throw(anna::RuntimeException) { LOGMETHOD(anna::TraceMethod tm("launcher::MyDiameterEntity", "eventUnknownResponse", ANNA_FILE_LOCATION)); // Performance stats: Launcher& my_app = static_cast (anna::app::functions::getApp()); - RealmNode * my_node = my_app.getRealmNode(getEngine()->getRealm()); + OriginHost * my_node = my_app.getOriginHost(getEngine()->getOriginHost()); // CommandId: anna::diameter::CommandId cid = anna::diameter::codec::functions::getCommandId(message); LOGDEBUG @@ -302,7 +302,7 @@ throw(anna::RuntimeException) { LOGMETHOD(anna::TraceMethod tm("launcher::MyDiameterEntity", "eventDPA", ANNA_FILE_LOCATION)); // Performance stats: Launcher& my_app = static_cast (anna::app::functions::getApp()); - RealmNode * my_node = my_app.getRealmNode(getEngine()->getRealm()); + OriginHost * my_node = my_app.getOriginHost(getEngine()->getOriginHost()); // CommandId: anna::diameter::CommandId cid = anna::diameter::codec::functions::getCommandId(message); LOGDEBUG diff --git a/example/diameter/launcher/MyLocalServer.cpp b/example/diameter/launcher/MyLocalServer.cpp index 513cdb4..7d34b46 100644 --- a/example/diameter/launcher/MyLocalServer.cpp +++ b/example/diameter/launcher/MyLocalServer.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include @@ -29,7 +29,7 @@ throw(anna::RuntimeException) { LOGMETHOD(anna::TraceMethod tm("launcher::MyLocalServer", "eventRequest", ANNA_FILE_LOCATION)); // Performance stats: Launcher& my_app = static_cast (anna::app::functions::getApp()); - RealmNode * my_node = my_app.getRealmNode(getEngine()->getRealm()); + OriginHost * my_node = my_app.getOriginHost(getEngine()->getOriginHost()); anna::diameter::codec::Engine *codecEngine = my_node->getCodecEngine(); // CommandId: @@ -90,7 +90,7 @@ throw(anna::RuntimeException) { // Decode try { codecMsg.decode(message, answer_message); } catch(anna::RuntimeException &ex) { ex.trace(); } - answer_message->setStandardToAnswer(codecMsg, my_node->getMyDiameterEngine()->getHost(), my_node->getMyDiameterEngine()->getRealm()); + answer_message->setStandardToAnswer(codecMsg, my_node->getMyDiameterEngine()->getOriginHost(), my_node->getMyDiameterEngine()->getOriginRealm()); analysisOK = (answer_message->getResultCode() == anna::diameter::helpers::base::AVPVALUES__Result_Code::DIAMETER_SUCCESS); } @@ -143,7 +143,7 @@ void MyLocalServer::eventResponse(const anna::diameter::comm::Response &response throw(anna::RuntimeException) { LOGMETHOD(anna::TraceMethod tm("launcher::MyLocalServer", "eventResponse", ANNA_FILE_LOCATION)); Launcher& my_app = static_cast (anna::app::functions::getApp()); - RealmNode * my_node = my_app.getRealmNode(getEngine()->getRealm()); + OriginHost * my_node = my_app.getOriginHost(getEngine()->getOriginHost()); anna::diameter::comm::ClassCode::_v code = response.getClassCode(); anna::diameter::comm::Response::ResultCode::_v result = response.getResultCode(); anna::diameter::comm::Message* request = const_cast(response.getRequest()); @@ -237,7 +237,7 @@ throw(anna::RuntimeException) { LOGMETHOD(anna::TraceMethod tm("launcher::MyLocalServer", "eventUnknownResponse", ANNA_FILE_LOCATION)); // Performance stats: Launcher& my_app = static_cast (anna::app::functions::getApp()); - RealmNode * my_node = my_app.getRealmNode(getEngine()->getRealm()); + OriginHost * my_node = my_app.getOriginHost(getEngine()->getOriginHost()); // CommandId: anna::diameter::CommandId cid = anna::diameter::codec::functions::getCommandId(message); LOGDEBUG @@ -259,7 +259,7 @@ throw(anna::RuntimeException) { LOGMETHOD(anna::TraceMethod tm("launcher::MyLocalServer", "eventDPA", ANNA_FILE_LOCATION)); // Performance stats: Launcher& my_app = static_cast (anna::app::functions::getApp()); - RealmNode * my_node = my_app.getRealmNode(getEngine()->getRealm()); + OriginHost * my_node = my_app.getOriginHost(getEngine()->getOriginHost()); // CommandId: anna::diameter::CommandId cid = anna::diameter::codec::functions::getCommandId(message); LOGDEBUG diff --git a/example/diameter/launcher/RealmNode.cpp b/example/diameter/launcher/OriginHost.cpp similarity index 84% rename from example/diameter/launcher/RealmNode.cpp rename to example/diameter/launcher/OriginHost.cpp index ca6cfce..32044b9 100644 --- a/example/diameter/launcher/RealmNode.cpp +++ b/example/diameter/launcher/OriginHost.cpp @@ -18,7 +18,7 @@ #include // Process -#include +#include #include @@ -30,10 +30,10 @@ namespace anna { } } -RealmNode::RealmNode(const std::string &originRealm, unsigned int applicationId, const anna::diameter::stack::Dictionary *baseProtocolDictionary) : - a_originRealm(originRealm), a_applicationId(applicationId) { +OriginHost::OriginHost(const std::string &originHost, unsigned int applicationId, const anna::diameter::stack::Dictionary *baseProtocolDictionary) : + a_originHost(originHost), a_applicationId(applicationId) { - std::string commEngineName = a_originRealm + "_DiameterCommEngine"; + std::string commEngineName = a_originHost + "_DiameterCommEngine"; a_commEngine = new MyDiameterEngine(commEngineName.c_str(), baseProtocolDictionary); a_commEngine->setAutoBind(false); // allow to create client-sessions without binding them, in order to set timeouts. a_codecEngine = anna::diameter::codec::EngineManager::instantiate().getCodecEngine(applicationId); @@ -65,22 +65,22 @@ RealmNode::RealmNode(const std::string &originRealm, unsigned int applicationId, } -void RealmNode::createEntity(const std::string &entityRepresentation, const anna::Millisecond &bindTimeout, const anna::Millisecond &applicationTimeout) throw(anna::RuntimeException) { +void OriginHost::createEntity(const std::string &entityRepresentation, const anna::Millisecond &bindTimeout, const anna::Millisecond &applicationTimeout) throw(anna::RuntimeException) { anna::socket_v servers = anna::functions::getSocketVectorFromString(entityRepresentation); - std::string entityDescription = "Launcher diameter entity for "; entityDescription += a_originRealm; + std::string entityDescription = "Launcher diameter entity for "; entityDescription += a_originHost; a_entity = (MyDiameterEntity*)(a_commEngine->createEntity(servers, entityDescription)); a_entity->setClassCodeTimeout(anna::diameter::comm::ClassCode::Bind, bindTimeout); a_entity->setClassCodeTimeout(anna::diameter::comm::ClassCode::ApplicationMessage, applicationTimeout); } -void RealmNode::startDiameterServer(const std::string &serverRepresentation, int sessions, const anna::Millisecond &inactivityTimeout) throw(anna::RuntimeException) { +void OriginHost::startDiameterServer(const std::string &serverRepresentation, int sessions, const anna::Millisecond &inactivityTimeout) throw(anna::RuntimeException) { //if(sessions <= 0) return; negative implies no limit for accepted connections std::string address; int port; anna::functions::getAddressAndPortFromSocketLiteral(serverRepresentation, address, port); - std::string serverDescription = "Launcher diameter local server for "; serverDescription += a_originRealm; + std::string serverDescription = "Launcher diameter local server for "; serverDescription += a_originHost; a_diameterServer = (MyLocalServer*)(a_commEngine->createLocalServer(address, port, sessions)); // we could set sessions = 0, and after application run(), use setMaxConnections(real sessions) // over the local server in order to start it. @@ -89,7 +89,7 @@ void RealmNode::startDiameterServer(const std::string &serverRepresentation, int a_diameterServer->setAllowedInactivityTime(inactivityTimeout); } -anna::diameter::comm::Message *RealmNode::createCommMessage() throw(anna::RuntimeException) { +anna::diameter::comm::Message *OriginHost::createCommMessage() throw(anna::RuntimeException) { anna::diameter::comm::Message *result = a_commMessages.create(); result->setRetries(a_requestRetransmissions); if (a_requestRetransmissions > 0) result->setOnExpiry(anna::diameter::comm::Message::OnExpiry::Retransmit); @@ -97,19 +97,19 @@ anna::diameter::comm::Message *RealmNode::createCommMessage() throw(anna::Runtim } -void RealmNode::releaseCommMessage(anna::diameter::comm::Message *msg) throw() { +void OriginHost::releaseCommMessage(anna::diameter::comm::Message *msg) throw() { a_commMessages.release(msg); } -void RealmNode::writeLogFile(const anna::DataBlock & db, const std::string &logExtension, const std::string &detail) const throw() { +void OriginHost::writeLogFile(const anna::DataBlock & db, const std::string &logExtension, const std::string &detail) const throw() { anna::diameter::codec::Message codecMsg; try { codecMsg.decode(db); } catch(anna::RuntimeException &ex) { ex.trace(); } writeLogFile(codecMsg, logExtension, detail); } // Already decoded: -void RealmNode::writeLogFile(const anna::diameter::codec::Message &decodedMessage, const std::string &logExtension, const std::string &detail) const throw() { +void OriginHost::writeLogFile(const anna::diameter::codec::Message &decodedMessage, const std::string &logExtension, const std::string &detail) const throw() { // Open target file: std::string targetFile = a_logFile; @@ -147,7 +147,7 @@ void RealmNode::writeLogFile(const anna::diameter::codec::Message &decodedMessag } if(a_dumpLog) { - std::string name = getMyDiameterEngine()->getRealm(); + std::string name = getMyDiameterEngine()->getOriginHost(); name += "."; name += anna::functions::asString(decodedMessage.getHopByHop()); name += "."; @@ -168,7 +168,7 @@ void RealmNode::writeLogFile(const anna::diameter::codec::Message &decodedMessag out.close(); } -void RealmNode::writeBurstLogFile(const std::string &buffer) throw() { +void OriginHost::writeBurstLogFile(const std::string &buffer) throw() { std::ofstream out(a_burstLogFile.c_str(), std::ifstream::out | std::ifstream::app); out.write(buffer.c_str(), buffer.size()); out.close(); // close() will be called when the object is destructed (i.e., when it goes out of scope). @@ -176,7 +176,7 @@ void RealmNode::writeBurstLogFile(const std::string &buffer) throw() { // earlier than it goes out of scope. } -int RealmNode::clearBurst() throw() { +int OriginHost::clearBurst() throw() { int size = a_burstMessages.size(); if(size) { @@ -199,14 +199,14 @@ int RealmNode::clearBurst() throw() { return size; } -int RealmNode::loadBurstMessage(const anna::DataBlock & db) throw(anna::RuntimeException) { +int OriginHost::loadBurstMessage(const anna::DataBlock & db) throw(anna::RuntimeException) { anna::diameter::comm::Message *msg = createCommMessage(); msg->setBody(db); a_burstMessages[a_burstLoadIndx++] = msg; return (a_burstLoadIndx - 1); } -int RealmNode::stopBurst() throw() { +int OriginHost::stopBurst() throw() { if(!a_burstActive) { std::string msg = "Burst launch is already stopped. Nothing done"; std::cout << msg << std::endl; @@ -219,7 +219,7 @@ int RealmNode::stopBurst() throw() { return (a_burstMessages.size() - (*a_burstDeliveryIt).first); } -int RealmNode::popBurst(int releaseAmount) throw() { +int OriginHost::popBurst(int releaseAmount) throw() { if(!a_burstActive) { std::string msg = "Burst launch is stopped. Nothing done"; std::cout << msg << std::endl; @@ -239,7 +239,7 @@ int RealmNode::popBurst(int releaseAmount) throw() { return a_burstPopCounter; } -int RealmNode::pushBurst(int loadAmount) throw() { +int OriginHost::pushBurst(int loadAmount) throw() { if(a_burstMessages.size() == 0) { std::string msg = "Burst data not found (empty list). Ignoring burst launch"; std::cout << msg << std::endl; @@ -263,7 +263,7 @@ int RealmNode::pushBurst(int loadAmount) throw() { return count; } -int RealmNode::sendBurst(int loadAmount) throw() { +int OriginHost::sendBurst(int loadAmount) throw() { if(a_burstMessages.size() == 0) { std::string msg = "Burst data not found (empty list). Ignoring burst launch"; std::cout << msg << std::endl; @@ -286,7 +286,7 @@ int RealmNode::sendBurst(int loadAmount) throw() { return count; } -int RealmNode::startBurst(int initialLoad) throw() { +int OriginHost::startBurst(int initialLoad) throw() { if(initialLoad < 1) { std::string msg = "No initial load is specified. Ignoring burst start"; std::cout << msg << std::endl; @@ -300,7 +300,7 @@ int RealmNode::startBurst(int initialLoad) throw() { return (pushBurst(initialLoad)); } -bool RealmNode::sendBurstMessage(bool anyway) throw() { +bool OriginHost::sendBurstMessage(bool anyway) throw() { if(!anyway && !burstActive()) return false; if(a_burstPopCounter > 0) { @@ -364,7 +364,7 @@ bool RealmNode::sendBurstMessage(bool anyway) throw() { return result; } -std::string RealmNode::lookBurst(int order) const throw() { +std::string OriginHost::lookBurst(int order) const throw() { if (order == -1) order = a_burstDeliveryIt->first; @@ -381,7 +381,7 @@ std::string RealmNode::lookBurst(int order) const throw() { return result; } -std::string RealmNode::gotoBurst(int order) throw() { +std::string OriginHost::gotoBurst(int order) throw() { std::string result = "Position not found for order provided ("; std::map::iterator it = a_burstMessages.find(order - 1); @@ -395,12 +395,13 @@ std::string RealmNode::gotoBurst(int order) throw() { return result; } -anna::xml::Node* RealmNode::asXML(anna::xml::Node* parent) const +anna::xml::Node* OriginHost::asXML(anna::xml::Node* parent) const throw() { - anna::xml::Node* result = parent->createChild("RealmNode"); + anna::xml::Node* result = parent->createChild("OriginHost"); - result->createAttribute("OriginRealm", a_originRealm); + result->createAttribute("originHost", a_originHost); result->createAttribute("ApplicationId", a_applicationId); + result->createAttribute("originRealm", a_commEngine->getOriginRealm()); result->createAttribute("LogFile", a_logFile); result->createAttribute("SplitLog", a_splitLog ? "yes" : "no"); result->createAttribute("DetailedLog", a_detailedLog ? "yes" : "no"); @@ -414,7 +415,7 @@ throw() { return result; } -std::string RealmNode::asXMLString() const throw() { +std::string OriginHost::asXMLString() const throw() { anna::xml::Node root("root"); return anna::xml::Compiler().apply(asXML(&root)); } diff --git a/example/diameter/launcher/RealmNode.hpp b/example/diameter/launcher/OriginHost.hpp similarity index 94% rename from example/diameter/launcher/RealmNode.hpp rename to example/diameter/launcher/OriginHost.hpp index 7f239ca..6f27f95 100644 --- a/example/diameter/launcher/RealmNode.hpp +++ b/example/diameter/launcher/OriginHost.hpp @@ -6,8 +6,8 @@ // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE // -#ifndef example_diameter_launcher_RealmNode_hpp -#define example_diameter_launcher_RealmNode_hpp +#ifndef example_diameter_launcher_OriginHost_hpp +#define example_diameter_launcher_OriginHost_hpp // Standard #include @@ -40,7 +40,7 @@ class MyDiameterEngine; class MyLocalServer; -class RealmNode { +class OriginHost { MyDiameterEngine *a_commEngine; MyDiameterEntity *a_entity; // we could get it finding the unique instante within comm engine, but it is more comfortable assign here. @@ -52,7 +52,7 @@ class RealmNode { anna::Recycler a_commMessages; // main - std::string a_originRealm; + std::string a_originHost; unsigned int a_applicationId; // Timming @@ -77,10 +77,10 @@ class RealmNode { int a_burstPopCounter; public: - RealmNode(const std::string &originRealm, unsigned int applicationId, const anna::diameter::stack::Dictionary *baseProtocolDictionary); - ~RealmNode() {;} + OriginHost(const std::string &originHost, unsigned int applicationId, const anna::diameter::stack::Dictionary *baseProtocolDictionary); + ~OriginHost() {;} - const std::string &getName() const throw() { return a_originRealm; } + const std::string &getName() const throw() { return a_originHost; } // Core resources: MyDiameterEngine* getMyDiameterEngine() const throw() { return a_commEngine; } diff --git a/example/diameter/launcher/deployments/advanced/services.msk b/example/diameter/launcher/deployments/advanced/services.msk index 67cc434..315bcd4 100644 --- a/example/diameter/launcher/deployments/advanced/services.msk +++ b/example/diameter/launcher/deployments/advanced/services.msk @@ -3,6 +3,6 @@ - + diff --git a/example/diameter/launcher/deployments/ft-client/services.msk b/example/diameter/launcher/deployments/ft-client/services.msk index cf6d7e3..86af47d 100644 --- a/example/diameter/launcher/deployments/ft-client/services.msk +++ b/example/diameter/launcher/deployments/ft-client/services.msk @@ -3,6 +3,6 @@ - + diff --git a/example/diameter/launcher/deployments/ft-client/tests/go.sh b/example/diameter/launcher/deployments/ft-client/tests/go.sh index 0bf18a2..f4137aa 100755 --- a/example/diameter/launcher/deployments/ft-client/tests/go.sh +++ b/example/diameter/launcher/deployments/ft-client/tests/go.sh @@ -8,8 +8,8 @@ tmpdir=$(mktemp -d) SCR_BN=`basename $0` OPER_SCR=../operation.sh RESULT_LOG=result.log -realm=`cat ../services.xml | grep originRealm | awk -F'originRealm=' '{ print $2 }' | cut -d\" -f2` -RECV_LOG=../${realm}.launcher.log.recvfe +host=`cat ../services.xml | grep originHost | awk -F'originHost=' '{ print $2 }' | cut -d\" -f2` +RECV_LOG=../${host}.launcher.log.recvfe ############# # FUNCTIONS # diff --git a/example/diameter/launcher/deployments/st-client/configure.sh b/example/diameter/launcher/deployments/st-client/configure.sh index 622ec79..d174de6 100755 --- a/example/diameter/launcher/deployments/st-client/configure.sh +++ b/example/diameter/launcher/deployments/st-client/configure.sh @@ -103,7 +103,7 @@ echo "ADML SYSTEM TEST CONFIGURATION WIZARD" echo "=====================================" echo [ -d ADMLS ] && _exit "ADMLS directory still exists. Please remove it to continue (perhaps you have to 'pkill ADML' before) !" -[ ! -d realms ] && _exit "Missing realms configuration (expecting '$PWD/realms' directory) !" +[ ! -d services ] && _exit "Missing services configuration (expecting '$PWD/services' directory) !" calculate_deployment_layout @@ -179,7 +179,7 @@ echo "Ready to clone/start the ADML instances: press ENTER to continue, CTRL+C t read dummy # Update services.xml regarding the number of client connections: -cd realms +cd services cp services.msk services.xml sed -i 's/__CLIENT_CONNECTIONS__/'$G_ADML_CONNECTIONS'/g' services.xml cd - >/dev/null @@ -196,7 +196,7 @@ do cp ../../.run-one.sh run.sh sed -i 's/^EXE=.*/EXE=ADML-'$instance'/' run.sh ln -s ../../ADML-launcher ADML-$instance - for xml in `ls ../../realms/*xml`; do ln -s $xml; done + for xml in `ls ../../services/*xml`; do ln -s $xml; done cd - >/dev/null done diff --git a/example/diameter/launcher/deployments/st-client/operation_all.sh b/example/diameter/launcher/deployments/st-client/operation_all.sh index 7d9eeb0..8811381 100755 --- a/example/diameter/launcher/deployments/st-client/operation_all.sh +++ b/example/diameter/launcher/deployments/st-client/operation_all.sh @@ -13,6 +13,7 @@ do dn_op=`dirname $op` cd $dn_op echo -n "Instance `basename $dn_op`: " + 0>launcher.trace ./operation.sh $@ cd - >/dev/null done diff --git a/example/diameter/launcher/deployments/st-client/realms_example/services.msk b/example/diameter/launcher/deployments/st-client/realms_example/services.msk deleted file mode 100644 index dc06824..0000000 --- a/example/diameter/launcher/deployments/st-client/realms_example/services.msk +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/example/diameter/launcher/deployments/st-client/realms_example/README b/example/diameter/launcher/deployments/st-client/services_example/README similarity index 94% rename from example/diameter/launcher/deployments/st-client/realms_example/README rename to example/diameter/launcher/deployments/st-client/services_example/README index 1ddd49b..abb8743 100644 --- a/example/diameter/launcher/deployments/st-client/realms_example/README +++ b/example/diameter/launcher/deployments/st-client/services_example/README @@ -4,7 +4,7 @@ Content README: this file. services.msk: services with some possible parseable variables: - __CLIENT_CONNECTIONS__: Number of client conections from a specific realm to the + __CLIENT_CONNECTIONS__: Number of client conections from a specific host to the corresponding diameter entity. cerGx.xml: CER file for Gx referenced in the services specification. cerRx.xml: CER file for Rx referenced in the services specification. diff --git a/example/diameter/launcher/deployments/st-client/realms_example/cerGx.xml b/example/diameter/launcher/deployments/st-client/services_example/cerGx.xml similarity index 74% rename from example/diameter/launcher/deployments/st-client/realms_example/cerGx.xml rename to example/diameter/launcher/deployments/st-client/services_example/cerGx.xml index b5caf20..29b0fbe 100644 --- a/example/diameter/launcher/deployments/st-client/realms_example/cerGx.xml +++ b/example/diameter/launcher/deployments/st-client/services_example/cerGx.xml @@ -1,6 +1,6 @@ - - + + diff --git a/example/diameter/launcher/deployments/st-client/realms_example/cerRx.xml b/example/diameter/launcher/deployments/st-client/services_example/cerRx.xml similarity index 75% rename from example/diameter/launcher/deployments/st-client/realms_example/cerRx.xml rename to example/diameter/launcher/deployments/st-client/services_example/cerRx.xml index e79ce98..e16b236 100644 --- a/example/diameter/launcher/deployments/st-client/realms_example/cerRx.xml +++ b/example/diameter/launcher/deployments/st-client/services_example/cerRx.xml @@ -1,6 +1,6 @@ - - + + diff --git a/example/diameter/launcher/deployments/st-client/realms_example/dictionaryBase.xml b/example/diameter/launcher/deployments/st-client/services_example/dictionaryBase.xml similarity index 100% rename from example/diameter/launcher/deployments/st-client/realms_example/dictionaryBase.xml rename to example/diameter/launcher/deployments/st-client/services_example/dictionaryBase.xml diff --git a/example/diameter/launcher/deployments/st-client/realms_example/dictionaryGx.xml b/example/diameter/launcher/deployments/st-client/services_example/dictionaryGx.xml similarity index 100% rename from example/diameter/launcher/deployments/st-client/realms_example/dictionaryGx.xml rename to example/diameter/launcher/deployments/st-client/services_example/dictionaryGx.xml diff --git a/example/diameter/launcher/deployments/st-client/realms_example/dictionaryRx.xml b/example/diameter/launcher/deployments/st-client/services_example/dictionaryRx.xml similarity index 100% rename from example/diameter/launcher/deployments/st-client/realms_example/dictionaryRx.xml rename to example/diameter/launcher/deployments/st-client/services_example/dictionaryRx.xml diff --git a/example/diameter/launcher/deployments/st-client/services_example/services.msk b/example/diameter/launcher/deployments/st-client/services_example/services.msk new file mode 100644 index 0000000..51b50f3 --- /dev/null +++ b/example/diameter/launcher/deployments/st-client/services_example/services.msk @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/example/diameter/launcher/main.cpp b/example/diameter/launcher/main.cpp index 2d44b3a..b603dee 100644 --- a/example/diameter/launcher/main.cpp +++ b/example/diameter/launcher/main.cpp @@ -35,7 +35,7 @@ int main(int argc, const char** argv) { commandLine.add("tmDir", anna::CommandLine::Argument::Optional, "Test manager directory. By default is the current execution directory. Warning: report files could be dump during system testing (see help for management operation 'test|report|result'); take care about the possible accumulation of files"); commandLine.add("cntRecordPeriod", anna::CommandLine::Argument::Optional, "Counters record procedure period in milliseconds. If missing, default value of 300000 (5 minutes) will be assigned. Value of 0 disables the record procedure."); commandLine.add("logStatisticSamples", anna::CommandLine::Argument::Optional, "Log statistics samples for the provided concept id list, over './sample..csv' files. For example: \"1,2\" will log concepts 1 and 2. Reserved word \"all\" activates all registered statistics concept identifiers. That ids are shown at context dump (see help to get it)."); - commandLine.add("disableLogs", anna::CommandLine::Argument::Optional, "Overrides every realm configuration regarding traffic log in order to disable it and ease production or system test startup.", false); + commandLine.add("disableLogs", anna::CommandLine::Argument::Optional, "Overrides every node configuration regarding traffic log in order to disable it and ease production or system test startup.", false); // Communications commandLine.add("reconnectionPeriod", anna::CommandLine::Argument::Optional, "Milliseconds to recover diameter client-session when server connection has been broken. If missing, default value of 10000 will be assigned"); diff --git a/example/diameter/launcher/resources/scripts/clone.sh b/example/diameter/launcher/resources/scripts/clone.sh index d392097..c9b7a66 100755 --- a/example/diameter/launcher/resources/scripts/clone.sh +++ b/example/diameter/launcher/resources/scripts/clone.sh @@ -216,12 +216,18 @@ do echo -n . r_file=`readlink -f $file` dn_r_file=`dirname $r_file` - #bn_dn_r_file=`basename $dn_r_file` - #echo "Programming group $bn_dn_r_file ..." - $OPERATION -f $r_file >/dev/null + #$OPERATION -f $r_file >/dev/null + $OPERATION -f $r_file > $dn_r_file/result.txt res=$? - #$OPERATION -f $r_file > $dn_r_file/result.txt - [ $res -ne 0 ] && _exit "Exception detected programming a testcase:\n\n`cat $r_file`" + if [ $res -ne 0 ] + then + bn_dn_r_file=`basename $dn_r_file` + exception_dir=$ADML_DIR/exception_stuff_${bn_dn_r_file} + rm -rf $exception_dir + cp -r $dn_r_file $exception_dir + cp $ADML_DIR/launcher.trace $exception_dir + _exit "Exception detected programming a testcase. Check for '$exception_dir'" + fi rm -rf $dn_r_file & done diff --git a/example/diameter/launcher/resources/services_examples/balancer.xml b/example/diameter/launcher/resources/services_examples/balancer.xml index d7bfbc6..b7c6a9e 100644 --- a/example/diameter/launcher/resources/services_examples/balancer.xml +++ b/example/diameter/launcher/resources/services_examples/balancer.xml @@ -3,7 +3,7 @@ - - + + diff --git a/example/diameter/launcher/resources/services_examples/client.xml b/example/diameter/launcher/resources/services_examples/client.xml index dfbb943..908c1b7 100644 --- a/example/diameter/launcher/resources/services_examples/client.xml +++ b/example/diameter/launcher/resources/services_examples/client.xml @@ -3,6 +3,6 @@ - + diff --git a/example/diameter/launcher/resources/services_examples/dummy.xml b/example/diameter/launcher/resources/services_examples/dummy.xml index f1602be..e64626c 100644 --- a/example/diameter/launcher/resources/services_examples/dummy.xml +++ b/example/diameter/launcher/resources/services_examples/dummy.xml @@ -3,6 +3,6 @@ - + diff --git a/example/diameter/launcher/resources/services_examples/multi-client.xml b/example/diameter/launcher/resources/services_examples/multi-client.xml index aa884eb..c677e93 100644 --- a/example/diameter/launcher/resources/services_examples/multi-client.xml +++ b/example/diameter/launcher/resources/services_examples/multi-client.xml @@ -6,9 +6,9 @@ - - - - + + + + diff --git a/example/diameter/launcher/resources/services_examples/server.xml b/example/diameter/launcher/resources/services_examples/server.xml index b58ec6a..9c4000f 100644 --- a/example/diameter/launcher/resources/services_examples/server.xml +++ b/example/diameter/launcher/resources/services_examples/server.xml @@ -3,6 +3,6 @@ - + diff --git a/example/diameter/launcher/resources/services_examples/services.dtd b/example/diameter/launcher/resources/services_examples/services.dtd index dee3f1e..c1bc9da 100755 --- a/example/diameter/launcher/resources/services_examples/services.dtd +++ b/example/diameter/launcher/resources/services_examples/services.dtd @@ -19,14 +19,13 @@ --> - +