result += "\n and test case reports will be written depending on this report option. Anyway, you could";
result += "\n use the 'look' operation to see the report.";
result += "\n";
+ result += "\n test|report-hex[|[yes]|no] Reports could include the diameter messages in hexadecimal format. Disabled by default.";
+ result += "\n";
result += "\n test|reset|<soft/hard>[|id] Reset the test case for id provided, all the tests when missing. It could be hard/soft:";
result += "\n - hard: you probably may need to stop the load rate before. This operation initializes";
result += "\n all test cases regardless their states.";
// test|ip-limit[|amount] In-progress limit of test cases. No new test cases will be launched over this value ...
// test|repeat[|[yes]|no] Restarts the programmed test cases when finished. Disabled by default: the testing ...
// test|report[|[yes]|no] Every time a test case is finished a report file in xml format will be created under ...
+ // test|report-hex[|[yes]|no] Reports could include the diameter messages in hexadecimal format. Disabled by default.
// test|goto|<id> Updates current test pointer position.
// test|look[|id] Show programmed test case for id provided, current when missing ...
// test|reset|<soft/hard>[|id] Reset the test case for id provided, all the tests when missing ...
testManager.setDumpReports((param2 == "yes"));
opt_response_content += (testManager.getDumpReports() ? "report enabled" : "report disabled");
}
+ else if(param1 == "report-hex") {
+ if (numParams > 2)
+ throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
+
+ if(param2 == "") param2 = "yes";
+ testManager.setDumpHex((param2 == "yes"));
+ opt_response_content += (testManager.getDumpHex() ? "report includes hexadecimal messages" : "report excludes hexadecimal messages");
+ }
else if(param1 == "goto") {
if (numParams > 2)
throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
}
if (a_bitR != "") {
- compare = (cid.first ? "1":"0");
+ compare = (cid.second ? "1":"0");
if (a_bitR != compare) return false;
}
a_timeController = NULL;
a_reportsDirectory = "./";
a_dumpReports = false;
+ a_dumpHexMessages = false;
a_synchronousAmount = 1;
a_poolRepeat = false;
a_inProgressCount = 0;
else
result->createAttribute("InProgressLimit", a_inProgressLimit);
result->createAttribute("DumpReports", (a_dumpReports ? "yes":"no"));
+ result->createAttribute("DumpHexMessages", (a_dumpHexMessages ? "yes":"no"));
result->createAttribute("ReportsDirectory", a_reportsDirectory);
if (a_clock) {
result->createAttribute("AsynchronousSendings", a_synchronousAmount);
// reports
std::string a_reportsDirectory;
bool a_dumpReports;
+ bool a_dumpHexMessages;
// Pool of test cases
test_pool_t a_testPool;
void setReportsDirectory(const std::string &rd) throw() { a_reportsDirectory = rd; }
const std::string &getReportsDirectory() const throw() { return a_reportsDirectory; }
+ void setDumpHex(bool dh) throw() { a_dumpHexMessages = dh; }
+ bool getDumpHex() const throw() { return a_dumpHexMessages; }
void setDumpReports(bool dr) throw() { a_dumpReports = dr; }
bool getDumpReports() const throw() { return a_dumpReports; }
throw() {
anna::xml::Node* result = TestStep::asXML(parent);
//parent->createChild("TestStepSendxml");
+ std::string msg = "", xmlmsg = "";
// Message
- std::string msg = "", xmlmsg = "";
- if (a_message.isEmpty()) {
- msg = "<empty>";
+ if (TestManager::instantiate().getDumpHex()) {
+ if (a_message.isEmpty()) {
+ msg = "<empty>";
+ }
+ else {
+ msg = "\n"; msg += a_message.asString(); msg += "\n";
+ }
}
- else {
- msg = "\n"; msg += a_message.asString(); msg += "\n";
- // Helper
+
+ if (!a_message.isEmpty()) {
try {
Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
static anna::diameter::codec::Message codecMsg(my_app.getCodecEngine());
}
}
- result->createAttribute("Message", msg);
+ if (msg != "") result->createAttribute("Message", msg);
if (xmlmsg != "") result->createAttribute("XMLMessage", xmlmsg);
result->createAttribute("Expired", (a_expired ? "yes":"no"));
+ if (a_waitForRequestStepNumber != -1)
+ result->createAttribute("WaitForRequestStepNumber", a_waitForRequestStepNumber);
return result;
}
throw() {
anna::xml::Node* result = TestStep::asXML(parent);
//parent->createChild("TestStepWait");
+ std::string msg = "", xmlmsg = "";
// Condition
a_condition.asXML(result);
+ // Message
+ if (TestManager::instantiate().getDumpHex()) {
+ if (a_message.isEmpty()) {
+ msg = "<empty>";
+ }
+ else {
+ msg = "\n"; msg += a_message.asString(); msg += "\n";
+ }
+ }
+
if (!a_message.isEmpty()) {
- // Message
- result->createAttribute("MatchedMessage", a_message.asString());
- // Helper
try {
Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
static anna::diameter::codec::Message codecMsg(my_app.getCodecEngine());
codecMsg.decode(a_message);
- result->createAttribute("MatchedXMLMessage", codecMsg.asXMLString());
+ xmlmsg = "\n"; xmlmsg += codecMsg.asXMLString(); xmlmsg += "\n";
}
catch (anna::RuntimeException &ex) {
ex.trace();
}
}
+ if (msg != "") result->createAttribute("MatchedMessage", msg);
+ if (xmlmsg != "") result->createAttribute("XMLMessage", xmlmsg);
+
return result;
}
anna::diameter::comm::ServerSession *a_serverSession;
public:
- TestStepWait(TestCase *testCase) : TestStep(testCase) { a_type = Type::Wait; a_clientSession = NULL; a_serverSession = NULL; }
+ TestStepWait(TestCase *testCase) : TestStep(testCase), a_message(true) { a_type = Type::Wait; a_clientSession = NULL; a_serverSession = NULL; }
~TestStepWait() {;}
// setter & getters
throw anna::RuntimeException("Not enough bytes to cover command header length", ANNA_FILE_LOCATION);
}
- static char source[4];
+ char source[4];
source[0] = (char)(hbh >> 24);
source[1] = (char)(hbh >> 16);
source[2] = (char)(hbh >> 8);
throw anna::RuntimeException("Not enough bytes to cover command header length", ANNA_FILE_LOCATION);
}
- static char source[4];
+ char source[4];
source[0] = (char)(ete >> 24);
source[1] = (char)(ete >> 16);
source[2] = (char)(ete >> 8);
throw anna::RuntimeException("Not enough bytes to cover command header length", ANNA_FILE_LOCATION);
}
- static char flags[1];
+ char flags[1];
flags[0] = *(db.getData() + 4);
if(activate) flags[0] |= Message::TBitMask; else flags[0] &= (~Message::TBitMask);
memcpy((char *)(db.getData() + 4), flags, 1);