diff --git a/AusRegCliever/include/AC_OTE.h b/AusRegCliever/include/AC_OTE.h index 55226af..26db396 100644 --- a/AusRegCliever/include/AC_OTE.h +++ b/AusRegCliever/include/AC_OTE.h @@ -14,7 +14,6 @@ typedef auto_ptr AC_SESSION; static AC_SESSMGR ac_mgr; static AC_SESSION ac_sess; -namespace AC_OTE { static int nCases; @@ -58,18 +57,17 @@ namespace AC_OTE { void check() { - theseLogs->logN(2,"Queue (%d) Unextended check of %s",cmd++,thisName); DomainCheckCommand *c = new DomainCheckCommand(thisName); DomainCheckResponse *r = new DomainCheckResponse(); + theseLogs->logN(2,"Queue (%d) Unextended check of %s",cmd++,thisName); acq.push( new Transaction(c, r) ); } void checkClaims() { - theseLogs->logN(2,"(%d) Queue Claims type Check of %s",cmd++,thisName); DomainCheckCommand *c = new DomainCheckCommand(thisName); LPChkCmdExtension chkE(&claims); @@ -78,13 +76,14 @@ namespace AC_OTE { LPChkRespExtension chkRspE; r->registerExtension(&chkRspE); + theseLogs->logN(2,"(%d) Queue Claims type Check of %s",cmd++,thisName); acq.push(new Transaction(c, r)); } void create() { - theseLogs->logN(3," (%d) normal create %s in OTE %s.",cmd++, thisName, thisAccount); + theseLogs->logN(3,"(%d) Queue normal create of %s ( %s ).",cmd++, thisName, thisAccount); DomainCreateCommand *c = new DomainCreateCommand(thisName,pw,&RID, &tech, &ns, &admin, &billing); DomainCreateResponse *r = new DomainCreateResponse(); @@ -97,47 +96,46 @@ namespace AC_OTE { void createClaimOverride() { - theseLogs->logN(2,"(%d) Create %s w Notice ID test data (TCN).",++cmd,thisName); DomainCreateCommand *c = new DomainCreateCommand(thisName,pw,&RID, &tech, &ns, &admin, &billing); crtE1.setNoticeID(noticeID, notAfter, acceptedDate); c->appendExtension(crtE1); DomainCreateResponse *r; + theseLogs->logN(2,"(%d)Queue create %s w Notice ID test data (TCN).",++cmd,thisName); acq.push(new Transaction(c, r)); } void createContact() { - theseLogs->logN(0,"Create a Contact."); + theseLogs->logN(2,"(%d)Queue create contact %s.",++cmd,ctc.c_str()); ContactCreateCommand *c = new ContactCreateCommand(ctc,ctcPW,&ctcPO,ctcEmail); ContactCreateResponse *r = new ContactCreateResponse(); + theseLogs->logN(2,"(%d)Queue create contact %s.",++cmd,ctc.c_str()); acq.push(new Transaction(c, r)); } void dpmlCreate() { std::string dpmlName("face.dpml.zone"); - theseLogs->logN(2,"(%d) Create %s w ICANN SMD file.",++cmd,dpmlName.c_str()); - DomainCreateCommand *c = new DomainCreateCommand(dpmlName,pw,&RID, &tech, &ns, &admin, &billing); crtE2.setSMD(); c->appendExtension(crtE2); DomainCreateResponse *r = new DomainCreateResponse(); + theseLogs->logN(2,"(%d) Queue DPML block create %s w boitedetest.smd data.",++cmd,dpmlName.c_str()); acq.push(new Transaction(c, r)); } void sunriseCreate() { - theseLogs->logN(2,"(%d) Sunrise create %s with ICANN SMD test data.",++cmd,thisName); - DomainCreateCommand *c = new DomainCreateCommand(thisName,pw,&RID, &tech, &ns, &admin, &billing); c->appendExtension(crtE1); DomainCreateResponse *r = new DomainCreateResponse(); + theseLogs->logN(2,"(%d)Queue Sunrise create %s with ICANN SMD test data.",++cmd,thisName); acq.push(new Transaction(c, r)); } @@ -148,10 +146,9 @@ namespace AC_OTE { DomainTransferApproveCommand *c1 = new DomainTransferApproveCommand(thisName,ctcPW); DomainTransferResponse *r = new DomainTransferResponse(); - theseLogs->logN(4," %s (%d) %s -> %s.", (transferGainer ? "Request" : "Approve") ,cmd++, thisName,thatAccount); - thisTest = transferGainer ? new Transaction(c0, r) : new Transaction(c1, r) ; + theseLogs->logN(4,"Queue %s (%d) %s -> %s.", (transferGainer ? "Request" : "Approve") ,cmd++, thisName,thatAccount); acq.push(thisTest); } // transfer @@ -171,5 +168,4 @@ namespace AC_OTE { } -} // AC_OTE namespace #endif /* REGISTRY_X */ diff --git a/AusRegCliever/include/ausRegTK.h b/AusRegCliever/include/ausRegTK.h index 496ee69..f93d388 100644 --- a/AusRegCliever/include/ausRegTK.h +++ b/AusRegCliever/include/ausRegTK.h @@ -18,6 +18,10 @@ #include #endif +#define REGISTRY_HANDSHAKE 540 +#define MIN_TRANSQ_POLICY 256 + +namespace ACPRODINOTE { class ausRegEPPTK { friend class masterDaemon; @@ -42,3 +46,4 @@ class ausRegEPPTK { void registryXOTE(); }; +} diff --git a/AusRegCliever/include/masterDaemon.h b/AusRegCliever/include/masterDaemon.h index 8dbe984..9a5cbd6 100644 --- a/AusRegCliever/include/masterDaemon.h +++ b/AusRegCliever/include/masterDaemon.h @@ -44,7 +44,7 @@ public: sentCommands; #if (ARTKENABLED > 0) - ausRegEPPTK *artk; + ACPRODINOTE::ausRegEPPTK *artk; #endif masterDaemonConfig *cfg; mdDGChannel *bg,*fg; diff --git a/AusRegCliever/include/mdJSON.hpp b/AusRegCliever/include/mdJSON.hpp index 1a3136b..6ac7731 100644 --- a/AusRegCliever/include/mdJSON.hpp +++ b/AusRegCliever/include/mdJSON.hpp @@ -16,9 +16,13 @@ const void *parms; // JSON Value } testCase; +namespace ACPRODINOTE { + typedef std::map testCases; typedef std::map testFuncs; +} + #ifdef MD_JSON static Json::Value root; #else diff --git a/AusRegCliever/server/cliever-md.cpp b/AusRegCliever/server/cliever-md.cpp index 9b4b84d..6890fa5 100644 --- a/AusRegCliever/server/cliever-md.cpp +++ b/AusRegCliever/server/cliever-md.cpp @@ -213,3 +213,4 @@ void usage() { exit(1); } + diff --git a/AusRegCliever/server/masterDaemon.cpp b/AusRegCliever/server/masterDaemon.cpp index 85e9272..a0457f9 100644 --- a/AusRegCliever/server/masterDaemon.cpp +++ b/AusRegCliever/server/masterDaemon.cpp @@ -135,7 +135,7 @@ int masterDaemon::initAusRegTK(void) { theseLogs->logN(2,"Attaching AusRegistry EPP Toolkit %d at tkScenario %d.", ARTKENABLED, thisConfig->tkScenario); - artk = new ausRegEPPTK(); + artk = new ACPRODINOTE::ausRegEPPTK(); if (!artk->doNothing(cfg)) { theseLogs->logN(1,"Toolkit init failed."); rc = NOT_OK; @@ -402,5 +402,6 @@ void runAPILayer() { } theseLogs->logNdebug(1,0,"mainbus background thread exited."); - } + + diff --git a/AusRegCliever/server/masterDaemonConfig.cpp b/AusRegCliever/server/masterDaemonConfig.cpp index d632d15..d60d926 100644 --- a/AusRegCliever/server/masterDaemonConfig.cpp +++ b/AusRegCliever/server/masterDaemonConfig.cpp @@ -1,5 +1,6 @@ #include "cliever-md.h" + const char *mdStdErrs[] = { "No error detected.", "Required state/element missing.", "Already exists.", "Conflict detected.", "Not ready.", "Syntax error." }; diff --git a/AusRegCliever/server/mdAusReg.cpp b/AusRegCliever/server/mdAusReg.cpp index 4be7444..483bbd7 100644 --- a/AusRegCliever/server/mdAusReg.cpp +++ b/AusRegCliever/server/mdAusReg.cpp @@ -27,6 +27,8 @@ #include #include "mdJSON.hpp" +namespace ACPRODINOTE { + typedef boost::heap::priority_queue ACWQ; ACWQ acq; @@ -98,7 +100,7 @@ void ausRegEPPTK::doOTEA() for (hoops=0;hoops<7;hoops++) { sess->writeXML(TEST_SE); sess->read(); - sleep(857); + sleep(REGISTRY_HANDSHAKE); } } @@ -132,7 +134,7 @@ void ausRegEPPTK::registryXOTE() { // PROD in OTE theseLogs->logN(0,"Begin RegistryXOTE Session."); - AC_OTE::setFuncs(); + ACPRODINOTE::setFuncs(); fd = inotify_init(); @@ -221,11 +223,18 @@ void ausRegEPPTK::registryXOTE() { // PROD in OTE } void ausRegEPPTK::doPROD() { - int debug=1000000,hours=0,hoops,minutes=0,seconds=0,idleSeconds=0,lastSeconds=0,lastMinutes; + int debug=1000000,hours=0,hoops,minutes=0,seconds=0,idleSeconds=0,lastPolicyHandshake=0, + lastSeconds=0,lastMinutes,iqSize=acq.max_size(); string op("newInstance"); scenario(thisConfig->tkScenario,thisConfig->cfg_path); + if (iqSize < MIN_TRANSQ_POLICY) { + acq.reserve(MIN_TRANSQ_POLICY - iqSize); + iqSize=acq.max_size(); + theseLogs->logN(1,"Workq size: %d",iqSize); + } + try { Timer::setTime("20140101.010101"); auto_ptr manager(SessionManagerFactory::newInstance(&props)); @@ -235,13 +244,12 @@ void ausRegEPPTK::doPROD() op = "run (keep-alive)"; manager->run(); sess->open(); - ac_mgr = manager; - ac_sess = sess; +// ac_mgr = manager; +// ac_sess = sess; while ((1440 - minutes) > EODMARGIN) { - if (!acq.empty()) { idleSeconds = 0; - + if (!acq.empty()) { Transaction *tx = acq.top(); if (debug > 999) @@ -251,12 +259,17 @@ void ausRegEPPTK::doPROD() if (debug > 999) theseLogs->logN(2,"Tx completed @ minute %d second %d.",minutes,seconds); + idleSeconds = 0; acq.pop(); delete tx; } - if (idleSeconds >= (857 - PRODINOTESLEEP)) { idleSeconds = 0; + if (!lastPolicyHandshake || (seconds - lastPolicyHandshake >= (REGISTRY_HANDSHAKE - 5))) + {idleSeconds = 0; + if (debug > 99) + theseLogs->logN(3,"AC-Registry Policy Handshake %d:%d:%d.",hours-1,minutes,seconds); + lastPolicyHandshake = seconds; sess->writeXML(TEST_SE); sess->read(); } @@ -273,7 +286,7 @@ void ausRegEPPTK::doPROD() lastMinutes = minutes; } - if (debug > 9999 && !(seconds % 10)) + if (debug > 9999 && !(seconds % 30)) theseLogs->logN(3,"AC Production %d:%d:%d.",hours-1,minutes,seconds); } @@ -293,3 +306,4 @@ void ausRegEPPTK::doPROD() } } +} diff --git a/AusRegCliever/server/mdHost.cpp b/AusRegCliever/server/mdHost.cpp index 25635b0..7bdb3e7 100644 --- a/AusRegCliever/server/mdHost.cpp +++ b/AusRegCliever/server/mdHost.cpp @@ -332,3 +332,4 @@ void mdPeer::registerCmd(const char *cmdName,const mdIncoming &thisOne) { result->send(); } + diff --git a/AusRegCliever/server/mdJSON.cpp b/AusRegCliever/server/mdJSON.cpp index 3830922..b46a869 100644 --- a/AusRegCliever/server/mdJSON.cpp +++ b/AusRegCliever/server/mdJSON.cpp @@ -11,11 +11,12 @@ #include #include "mdJSON.hpp" -namespace AC_OTE { - extern testCases theseCases; - extern testFuncs theseFuncs; -} +namespace ACPRODINOTE { + extern testCases theseCases; + extern testFuncs theseFuncs; + +} using namespace std; static std::string @@ -74,7 +75,7 @@ bool mdJSON::run() if (strlen(thisItem) != 6) continue; if (debug > 100000) theseLogs->logN(1,"case %s.",thisItem); - if (!AC_OTE::theseFuncs[thisItem]) { + if (!ACPRODINOTE::theseFuncs[thisItem]) { theseLogs->logN(1,"No logic to bind to '%s', need it.",thisItem); return false; } @@ -82,9 +83,9 @@ bool mdJSON::run() // theseLogs->logN(1,"'%s' isn't an object, can't use.",thisItem); // continue; //} - AC_OTE::theseCases[nCases].parms = NULL; - AC_OTE::theseCases[nCases].fBody = AC_OTE::theseFuncs[thisItem]; - AC_OTE::theseCases[nCases++].caseName = thisItem; + ACPRODINOTE::theseCases[nCases].parms = NULL; + ACPRODINOTE::theseCases[nCases].fBody = ACPRODINOTE::theseFuncs[thisItem]; + ACPRODINOTE::theseCases[nCases++].caseName = thisItem; } catch (...) { @@ -94,15 +95,19 @@ bool mdJSON::run() theseLogs->logN(1,"%d cases bound, beginning execution.",nCases); - for (i=0;ilogN(2,"%d Begin setup of %s ",i+1,AC_OTE::theseCases[i].caseName ); - AC_OTE::theseCases[i].fBody(); - theseLogs->logN(2,"%d End setup of %s ",i+1,AC_OTE::theseCases[i].caseName ); + theseLogs->logN(2,"%d Begin setup of %s ",i+1,ACPRODINOTE::theseCases[i].caseName ); + ACPRODINOTE::theseCases[i].fBody(); + theseLogs->logN(2,"%d End setup of %s ",i+1,ACPRODINOTE::theseCases[i].caseName ); } + catch (exception e) + { + theseLogs->logN(2,"Case %s fault: %s ",ACPRODINOTE::theseCases[i].caseName, e.what()); + } catch (...) { - theseLogs->logN(1,"Test case execution exception in %s ",AC_OTE::theseCases[i].caseName ); + theseLogs->logN(1,"Unknown test case fault in %s ",ACPRODINOTE::theseCases[i].caseName ); } } theseLogs->logN(0,"Suite 'testSuite00' end execution."); diff --git a/AusRegCliever/server/mdState.cpp b/AusRegCliever/server/mdState.cpp index 99dbb6f..ae6412c 100644 --- a/AusRegCliever/server/mdState.cpp +++ b/AusRegCliever/server/mdState.cpp @@ -2,6 +2,7 @@ #include "cliever-md.h" #include "masterDaemon.h" + class mdResponse; using namespace std; @@ -150,3 +151,4 @@ void mdState::registerData(const char *dataName,const mdIncoming &thisOne) { result->send(); } +