This commit is contained in:
parent
9cd15aedc4
commit
3b7799220e
|
@ -14,7 +14,6 @@ typedef auto_ptr<Session> AC_SESSION;
|
||||||
static AC_SESSMGR ac_mgr;
|
static AC_SESSMGR ac_mgr;
|
||||||
static AC_SESSION ac_sess;
|
static AC_SESSION ac_sess;
|
||||||
|
|
||||||
namespace AC_OTE {
|
|
||||||
|
|
||||||
static int nCases;
|
static int nCases;
|
||||||
|
|
||||||
|
@ -58,18 +57,17 @@ namespace AC_OTE {
|
||||||
|
|
||||||
void check() {
|
void check() {
|
||||||
|
|
||||||
theseLogs->logN(2,"Queue (%d) Unextended check of %s",cmd++,thisName);
|
|
||||||
|
|
||||||
DomainCheckCommand *c = new DomainCheckCommand(thisName);
|
DomainCheckCommand *c = new DomainCheckCommand(thisName);
|
||||||
DomainCheckResponse *r = new DomainCheckResponse();
|
DomainCheckResponse *r = new DomainCheckResponse();
|
||||||
|
|
||||||
|
theseLogs->logN(2,"Queue (%d) Unextended check of %s",cmd++,thisName);
|
||||||
acq.push( new Transaction(c, r) );
|
acq.push( new Transaction(c, r) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkClaims() {
|
void checkClaims() {
|
||||||
|
|
||||||
theseLogs->logN(2,"(%d) Queue Claims type Check of %s",cmd++,thisName);
|
|
||||||
|
|
||||||
DomainCheckCommand *c = new DomainCheckCommand(thisName);
|
DomainCheckCommand *c = new DomainCheckCommand(thisName);
|
||||||
LPChkCmdExtension chkE(&claims);
|
LPChkCmdExtension chkE(&claims);
|
||||||
|
@ -78,13 +76,14 @@ namespace AC_OTE {
|
||||||
LPChkRespExtension chkRspE;
|
LPChkRespExtension chkRspE;
|
||||||
r->registerExtension(&chkRspE);
|
r->registerExtension(&chkRspE);
|
||||||
|
|
||||||
|
theseLogs->logN(2,"(%d) Queue Claims type Check of %s",cmd++,thisName);
|
||||||
acq.push(new Transaction(c, r));
|
acq.push(new Transaction(c, r));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void create() {
|
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);
|
DomainCreateCommand *c = new DomainCreateCommand(thisName,pw,&RID, &tech, &ns, &admin, &billing);
|
||||||
DomainCreateResponse *r = new DomainCreateResponse();
|
DomainCreateResponse *r = new DomainCreateResponse();
|
||||||
|
|
||||||
|
@ -97,47 +96,46 @@ namespace AC_OTE {
|
||||||
|
|
||||||
void createClaimOverride() {
|
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);
|
DomainCreateCommand *c = new DomainCreateCommand(thisName,pw,&RID, &tech, &ns, &admin, &billing);
|
||||||
crtE1.setNoticeID(noticeID, notAfter, acceptedDate);
|
crtE1.setNoticeID(noticeID, notAfter, acceptedDate);
|
||||||
c->appendExtension(crtE1);
|
c->appendExtension(crtE1);
|
||||||
DomainCreateResponse *r;
|
DomainCreateResponse *r;
|
||||||
|
|
||||||
|
theseLogs->logN(2,"(%d)Queue create %s w Notice ID test data (TCN).",++cmd,thisName);
|
||||||
acq.push(new Transaction(c, r));
|
acq.push(new Transaction(c, r));
|
||||||
}
|
}
|
||||||
|
|
||||||
void createContact() {
|
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);
|
ContactCreateCommand *c = new ContactCreateCommand(ctc,ctcPW,&ctcPO,ctcEmail);
|
||||||
ContactCreateResponse *r = new ContactCreateResponse();
|
ContactCreateResponse *r = new ContactCreateResponse();
|
||||||
|
|
||||||
|
theseLogs->logN(2,"(%d)Queue create contact %s.",++cmd,ctc.c_str());
|
||||||
acq.push(new Transaction(c, r));
|
acq.push(new Transaction(c, r));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void dpmlCreate() { std::string dpmlName("face.dpml.zone");
|
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);
|
DomainCreateCommand *c = new DomainCreateCommand(dpmlName,pw,&RID, &tech, &ns, &admin, &billing);
|
||||||
crtE2.setSMD();
|
crtE2.setSMD();
|
||||||
c->appendExtension(crtE2);
|
c->appendExtension(crtE2);
|
||||||
DomainCreateResponse *r = new DomainCreateResponse();
|
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));
|
acq.push(new Transaction(c, r));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sunriseCreate() {
|
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);
|
DomainCreateCommand *c = new DomainCreateCommand(thisName,pw,&RID, &tech, &ns, &admin, &billing);
|
||||||
c->appendExtension(crtE1);
|
c->appendExtension(crtE1);
|
||||||
DomainCreateResponse *r = new DomainCreateResponse();
|
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));
|
acq.push(new Transaction(c, r));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -148,10 +146,9 @@ namespace AC_OTE {
|
||||||
DomainTransferApproveCommand *c1 = new DomainTransferApproveCommand(thisName,ctcPW);
|
DomainTransferApproveCommand *c1 = new DomainTransferApproveCommand(thisName,ctcPW);
|
||||||
DomainTransferResponse *r = new DomainTransferResponse();
|
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) ;
|
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);
|
acq.push(thisTest);
|
||||||
|
|
||||||
} // transfer
|
} // transfer
|
||||||
|
@ -171,5 +168,4 @@ namespace AC_OTE {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // AC_OTE namespace
|
|
||||||
#endif /* REGISTRY_X */
|
#endif /* REGISTRY_X */
|
||||||
|
|
|
@ -18,6 +18,10 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define REGISTRY_HANDSHAKE 540
|
||||||
|
#define MIN_TRANSQ_POLICY 256
|
||||||
|
|
||||||
|
namespace ACPRODINOTE {
|
||||||
class ausRegEPPTK {
|
class ausRegEPPTK {
|
||||||
|
|
||||||
friend class masterDaemon;
|
friend class masterDaemon;
|
||||||
|
@ -42,3 +46,4 @@ class ausRegEPPTK {
|
||||||
void registryXOTE();
|
void registryXOTE();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
sentCommands;
|
sentCommands;
|
||||||
|
|
||||||
#if (ARTKENABLED > 0)
|
#if (ARTKENABLED > 0)
|
||||||
ausRegEPPTK *artk;
|
ACPRODINOTE::ausRegEPPTK *artk;
|
||||||
#endif
|
#endif
|
||||||
masterDaemonConfig *cfg;
|
masterDaemonConfig *cfg;
|
||||||
mdDGChannel *bg,*fg;
|
mdDGChannel *bg,*fg;
|
||||||
|
|
|
@ -16,9 +16,13 @@
|
||||||
const void *parms; // JSON Value
|
const void *parms; // JSON Value
|
||||||
} testCase;
|
} testCase;
|
||||||
|
|
||||||
|
namespace ACPRODINOTE {
|
||||||
|
|
||||||
typedef std::map<int,testCase> testCases;
|
typedef std::map<int,testCase> testCases;
|
||||||
typedef std::map<string,caseBody> testFuncs;
|
typedef std::map<string,caseBody> testFuncs;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef MD_JSON
|
#ifdef MD_JSON
|
||||||
static Json::Value root;
|
static Json::Value root;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -213,3 +213,4 @@ void usage() {
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,7 @@ int masterDaemon::initAusRegTK(void) {
|
||||||
theseLogs->logN(2,"Attaching AusRegistry EPP Toolkit %d at tkScenario %d.",
|
theseLogs->logN(2,"Attaching AusRegistry EPP Toolkit %d at tkScenario %d.",
|
||||||
ARTKENABLED, thisConfig->tkScenario);
|
ARTKENABLED, thisConfig->tkScenario);
|
||||||
|
|
||||||
artk = new ausRegEPPTK();
|
artk = new ACPRODINOTE::ausRegEPPTK();
|
||||||
if (!artk->doNothing(cfg)) {
|
if (!artk->doNothing(cfg)) {
|
||||||
theseLogs->logN(1,"Toolkit init failed.");
|
theseLogs->logN(1,"Toolkit init failed.");
|
||||||
rc = NOT_OK;
|
rc = NOT_OK;
|
||||||
|
@ -402,5 +402,6 @@ void runAPILayer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
theseLogs->logNdebug(1,0,"mainbus background thread exited.");
|
theseLogs->logNdebug(1,0,"mainbus background thread exited.");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "cliever-md.h"
|
#include "cliever-md.h"
|
||||||
|
|
||||||
|
|
||||||
const char *mdStdErrs[] = { "No error detected.", "Required state/element missing.", "Already exists.",
|
const char *mdStdErrs[] = { "No error detected.", "Required state/element missing.", "Already exists.",
|
||||||
"Conflict detected.", "Not ready.", "Syntax error." };
|
"Conflict detected.", "Not ready.", "Syntax error." };
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
#include <json/json.h>
|
#include <json/json.h>
|
||||||
#include "mdJSON.hpp"
|
#include "mdJSON.hpp"
|
||||||
|
|
||||||
|
namespace ACPRODINOTE {
|
||||||
|
|
||||||
typedef boost::heap::priority_queue<Transaction *> ACWQ;
|
typedef boost::heap::priority_queue<Transaction *> ACWQ;
|
||||||
|
|
||||||
ACWQ acq;
|
ACWQ acq;
|
||||||
|
@ -98,7 +100,7 @@ void ausRegEPPTK::doOTEA()
|
||||||
for (hoops=0;hoops<7;hoops++) {
|
for (hoops=0;hoops<7;hoops++) {
|
||||||
sess->writeXML(TEST_SE);
|
sess->writeXML(TEST_SE);
|
||||||
sess->read();
|
sess->read();
|
||||||
sleep(857);
|
sleep(REGISTRY_HANDSHAKE);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -132,7 +134,7 @@ void ausRegEPPTK::registryXOTE() { // PROD in OTE
|
||||||
|
|
||||||
theseLogs->logN(0,"Begin RegistryXOTE Session.");
|
theseLogs->logN(0,"Begin RegistryXOTE Session.");
|
||||||
|
|
||||||
AC_OTE::setFuncs();
|
ACPRODINOTE::setFuncs();
|
||||||
|
|
||||||
fd = inotify_init();
|
fd = inotify_init();
|
||||||
|
|
||||||
|
@ -221,11 +223,18 @@ void ausRegEPPTK::registryXOTE() { // PROD in OTE
|
||||||
}
|
}
|
||||||
void ausRegEPPTK::doPROD()
|
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");
|
string op("newInstance");
|
||||||
|
|
||||||
scenario(thisConfig->tkScenario,thisConfig->cfg_path);
|
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 {
|
try {
|
||||||
Timer::setTime("20140101.010101");
|
Timer::setTime("20140101.010101");
|
||||||
auto_ptr<SessionManager> manager(SessionManagerFactory::newInstance(&props));
|
auto_ptr<SessionManager> manager(SessionManagerFactory::newInstance(&props));
|
||||||
|
@ -235,13 +244,12 @@ void ausRegEPPTK::doPROD()
|
||||||
op = "run (keep-alive)";
|
op = "run (keep-alive)";
|
||||||
manager->run();
|
manager->run();
|
||||||
sess->open();
|
sess->open();
|
||||||
ac_mgr = manager;
|
// ac_mgr = manager;
|
||||||
ac_sess = sess;
|
// ac_sess = sess;
|
||||||
|
|
||||||
while ((1440 - minutes) > EODMARGIN) {
|
while ((1440 - minutes) > EODMARGIN) {
|
||||||
|
|
||||||
if (!acq.empty()) { idleSeconds = 0;
|
if (!acq.empty()) {
|
||||||
|
|
||||||
Transaction *tx = acq.top();
|
Transaction *tx = acq.top();
|
||||||
|
|
||||||
if (debug > 999)
|
if (debug > 999)
|
||||||
|
@ -251,12 +259,17 @@ void ausRegEPPTK::doPROD()
|
||||||
if (debug > 999)
|
if (debug > 999)
|
||||||
theseLogs->logN(2,"Tx completed @ minute %d second %d.",minutes,seconds);
|
theseLogs->logN(2,"Tx completed @ minute %d second %d.",minutes,seconds);
|
||||||
|
|
||||||
|
idleSeconds = 0;
|
||||||
acq.pop();
|
acq.pop();
|
||||||
delete tx;
|
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->writeXML(TEST_SE);
|
||||||
sess->read();
|
sess->read();
|
||||||
}
|
}
|
||||||
|
@ -273,7 +286,7 @@ void ausRegEPPTK::doPROD()
|
||||||
lastMinutes = minutes;
|
lastMinutes = minutes;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug > 9999 && !(seconds % 10))
|
if (debug > 9999 && !(seconds % 30))
|
||||||
theseLogs->logN(3,"AC Production %d:%d:%d.",hours-1,minutes,seconds);
|
theseLogs->logN(3,"AC Production %d:%d:%d.",hours-1,minutes,seconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,3 +306,4 @@ void ausRegEPPTK::doPROD()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -332,3 +332,4 @@ void mdPeer::registerCmd(const char *cmdName,const mdIncoming &thisOne) {
|
||||||
result->send();
|
result->send();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,12 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "mdJSON.hpp"
|
#include "mdJSON.hpp"
|
||||||
|
|
||||||
namespace AC_OTE {
|
namespace ACPRODINOTE {
|
||||||
|
|
||||||
extern testCases theseCases;
|
extern testCases theseCases;
|
||||||
extern testFuncs theseFuncs;
|
extern testFuncs theseFuncs;
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
static std::string
|
static std::string
|
||||||
|
@ -74,7 +75,7 @@ bool mdJSON::run()
|
||||||
if (strlen(thisItem) != 6) continue;
|
if (strlen(thisItem) != 6) continue;
|
||||||
if (debug > 100000)
|
if (debug > 100000)
|
||||||
theseLogs->logN(1,"case %s.",thisItem);
|
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);
|
theseLogs->logN(1,"No logic to bind to '%s', need it.",thisItem);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -82,9 +83,9 @@ bool mdJSON::run()
|
||||||
// theseLogs->logN(1,"'%s' isn't an object, can't use.",thisItem);
|
// theseLogs->logN(1,"'%s' isn't an object, can't use.",thisItem);
|
||||||
// continue;
|
// continue;
|
||||||
//}
|
//}
|
||||||
AC_OTE::theseCases[nCases].parms = NULL;
|
ACPRODINOTE::theseCases[nCases].parms = NULL;
|
||||||
AC_OTE::theseCases[nCases].fBody = AC_OTE::theseFuncs[thisItem];
|
ACPRODINOTE::theseCases[nCases].fBody = ACPRODINOTE::theseFuncs[thisItem];
|
||||||
AC_OTE::theseCases[nCases++].caseName = thisItem;
|
ACPRODINOTE::theseCases[nCases++].caseName = thisItem;
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
|
@ -94,15 +95,19 @@ bool mdJSON::run()
|
||||||
|
|
||||||
theseLogs->logN(1,"%d cases bound, beginning execution.",nCases);
|
theseLogs->logN(1,"%d cases bound, beginning execution.",nCases);
|
||||||
|
|
||||||
for (i=0;i<AC_OTE::theseCases.size();i++) {
|
for (i=0;i<ACPRODINOTE::theseCases.size();i++) {
|
||||||
try{
|
try{
|
||||||
theseLogs->logN(2,"%d Begin setup of %s ",i+1,AC_OTE::theseCases[i].caseName );
|
theseLogs->logN(2,"%d Begin setup of %s ",i+1,ACPRODINOTE::theseCases[i].caseName );
|
||||||
AC_OTE::theseCases[i].fBody();
|
ACPRODINOTE::theseCases[i].fBody();
|
||||||
theseLogs->logN(2,"%d End setup of %s ",i+1,AC_OTE::theseCases[i].caseName );
|
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 (...)
|
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.");
|
theseLogs->logN(0,"Suite 'testSuite00' end execution.");
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include "cliever-md.h"
|
#include "cliever-md.h"
|
||||||
#include "masterDaemon.h"
|
#include "masterDaemon.h"
|
||||||
|
|
||||||
|
|
||||||
class mdResponse;
|
class mdResponse;
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@ -150,3 +151,4 @@ void mdState::registerData(const char *dataName,const mdIncoming &thisOne) {
|
||||||
result->send();
|
result->send();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue