212 lines
6.5 KiB
C++
212 lines
6.5 KiB
C++
#define MD_AUSREG
|
|
#include "cliever-md.h"
|
|
#include "session/SessionFactory.hpp"
|
|
#include "session/SessionManagerProperties.hpp"
|
|
#include "common/SystemProperties.hpp"
|
|
#include "session/Session.hpp"
|
|
#include "session/StatsManager.hpp"
|
|
#include "se/DomainCheckCommand.hpp"
|
|
#include "se/DomainCheckResponse.hpp"
|
|
#include "OTE/LPECheckCommand.hpp"
|
|
#include "OTE/LPECheckResponse.hpp"
|
|
#include "se/DomainCreateCommand.hpp"
|
|
#include "se/DomainCreateResponse.hpp"
|
|
#include "se/DomainRegistrantTransferCommand.hpp"
|
|
#include "se/DomainRegistrantTransferResponse.hpp"
|
|
#include "OTE/LPECreateCommand.hpp"
|
|
#include "OTE/LPECreateResponse.hpp"
|
|
|
|
using namespace std;
|
|
|
|
static TestEnvironment props;
|
|
|
|
static std::string TEST_SE =
|
|
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><epp xmlns=\"urn:ietf:params:xml:ns:epp-1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd\"><hello/></epp>";
|
|
|
|
// static void testExecuteParallelTransactions() throw (EPPException);
|
|
|
|
bool ausRegEPPTK::doNothing(const std::string propertiesFilePath) { // Just verify load
|
|
|
|
bool did=false;
|
|
|
|
try {
|
|
scenario( 0, propertiesFilePath ); // tkScenario 0 assumed
|
|
did = true;
|
|
}
|
|
catch(std::exception &e) {
|
|
theseLogs->logN(2,"Scenario %d TK Exception: %s .",tkScenario,e.what());
|
|
}
|
|
return did;
|
|
|
|
}
|
|
void ausRegEPPTK::doOTEA()
|
|
{
|
|
int hours,hoops;
|
|
string op("newInstance");
|
|
|
|
scenario(tkScenario,thisConfig->cfg_path);
|
|
|
|
try {
|
|
Timer::setTime("20140101.010101");
|
|
auto_ptr<SessionManager> manager(SessionManagerFactory::newInstance(&props));
|
|
auto_ptr<Session> sess(SessionFactory::newInstance(&props));
|
|
op = "startup";
|
|
manager->startup();
|
|
op = "run (keep-alive)";
|
|
manager->run();
|
|
sess->open();
|
|
|
|
for (hours=0;hours < 24;hours++) {
|
|
// Spawn the keep alive thread.
|
|
theseLogs->logN(1,"Send Test SEs on or about start OTE Test Hour %d.",hours);
|
|
|
|
for (hoops=0;hoops<7;hoops++) {
|
|
sess->writeXML(TEST_SE);
|
|
sess->read();
|
|
sleep(857);
|
|
}
|
|
|
|
}
|
|
sess->close();
|
|
manager->shutdown();
|
|
|
|
}
|
|
catch (EPPException& e)
|
|
{ const char *eMsg = e.getMessage().c_str();
|
|
const char *opNow = op.c_str();
|
|
theseLogs->logN(2,"EPP Exception during OTE A (%s): %s .",opNow,eMsg);
|
|
throw e;
|
|
}
|
|
catch (...)
|
|
{
|
|
theseLogs->logN(2,"General Exception during OTE A (%s).",op.c_str());
|
|
}
|
|
}
|
|
void ausRegEPPTK::doOTEB()
|
|
{
|
|
int cmd=0,thisAccount=0;
|
|
string op("newInstance");
|
|
|
|
scenario(tkScenario,thisConfig->cfg_path);
|
|
|
|
try {
|
|
Timer::setTime("20140101.010101");
|
|
auto_ptr<SessionManager> manager(SessionManagerFactory::newInstance(&props));
|
|
auto_ptr<Session> sess(SessionFactory::newInstance(&props));
|
|
op = "startup";
|
|
manager->startup();
|
|
op = "run (keep-alive)";
|
|
manager->run();
|
|
|
|
sess->open();
|
|
|
|
theseLogs->logN(1,"OTE Basic Access [Hello] (%d).",cmd++);
|
|
sess->writeXML(TEST_SE);
|
|
sess->read();
|
|
theseLogs->logN(1,"Begin Actual Tests.");
|
|
sleep(2);
|
|
theseLogs->logN(1,"(%d) Conventional check of thoughtcrime.biz",cmd++);
|
|
|
|
DomainCheckCommand baCommand_1("thoughtcrime.biz");
|
|
DomainCheckResponse baResponse_1;
|
|
|
|
theseLogs->logN(1,"(%d) LPE Check of test-validate.claimsgasix",cmd++);
|
|
|
|
LPECheckCommand baCommand_2("test-validate.claimsgasix");
|
|
LPECheckResponse baResponse_2;
|
|
|
|
theseLogs->logN(2,"(%d) Register <registrar>.ote using OTE Account %d.",cmd++,
|
|
thisAccount++);
|
|
|
|
const std::string pw("password");
|
|
const std::string RID("registrantID");
|
|
|
|
DomainCreateCommand baCommand_3("secura1.ote",pw,&RID);
|
|
DomainCreateResponse baResponse_3;
|
|
|
|
|
|
theseLogs->logN(2,"(%d) Transfer <registrar>.ote to OTE Account %d.",cmd++,
|
|
thisAccount++);
|
|
|
|
const XMLGregorianCalendar curExpDate;
|
|
const std::string kvListName;
|
|
const std::string explanation;
|
|
|
|
DomainRegistrantTransferCommand
|
|
baCommand_4("secura1.ote",curExpDate,kvListName,explanation);
|
|
DomainRegistrantTransferResponse baResponse_4;
|
|
|
|
theseLogs->logN(1,"(%d) Sunrise create with ICANN SMD test files.",cmd++);
|
|
|
|
LPECreateCommand baCommand_5("test-validate.claimsgasix",pw,&RID);
|
|
LPECreateResponse baResponse_5;
|
|
|
|
theseLogs->logN(1,"(%d) Attempt create subject to claims.",cmd++);
|
|
|
|
LPECreateCommand baCommand_6("test-validate.claimsgasix",pw,&RID);
|
|
LPECreateResponse baResponse_6;
|
|
|
|
theseLogs->logN(1,"End OTE Basic Access Tests.",cmd++);
|
|
|
|
sess->close();
|
|
manager->shutdown();
|
|
|
|
}
|
|
catch (EPPException& e)
|
|
{ const char *eMsg = e.getMessage().c_str();
|
|
const char *opNow = op.c_str();
|
|
theseLogs->logN(2,"EPP Exception during OTE B (%s): %s .",opNow,eMsg);
|
|
throw e;
|
|
}
|
|
catch (...)
|
|
{
|
|
theseLogs->logN(2,"General Exception during OTE B (%s).",op.c_str());
|
|
}
|
|
|
|
}
|
|
|
|
void ausRegEPPTK::doOTEP()
|
|
{
|
|
int hours,hoops;
|
|
string op("newInstance");
|
|
|
|
scenario(thisConfig->tkScenario,thisConfig->cfg_path);
|
|
|
|
try {
|
|
Timer::setTime("20140101.010101");
|
|
auto_ptr<SessionManager> manager(SessionManagerFactory::newInstance(&props));
|
|
auto_ptr<Session> sess(SessionFactory::newInstance(&props));
|
|
op = "startup";
|
|
manager->startup();
|
|
op = "run (keep-alive)";
|
|
manager->run();
|
|
sess->open();
|
|
|
|
for (hours=0;hours < 24;hours++) {
|
|
// Spawn the keep alive thread.
|
|
theseLogs->logN(1,"AC Production Hour %d.",hours);
|
|
|
|
// if thisEPPServer(mdStdDevIdx).vendor == "Donuts"
|
|
for (hoops=0;hoops<7;hoops++) {
|
|
sess->writeXML(TEST_SE);
|
|
sess->read();
|
|
sleep(857);
|
|
}
|
|
|
|
}
|
|
sess->close();
|
|
manager->shutdown();
|
|
|
|
}
|
|
catch (EPPException& e)
|
|
{ const char *eMsg = e.getMessage().c_str();
|
|
const char *opNow = op.c_str();
|
|
theseLogs->logN(2,"EPP Exception in Production (%s): %s .",opNow,eMsg);
|
|
throw e;
|
|
}
|
|
catch (...)
|
|
{
|
|
theseLogs->logN(2,"General Exception Production (%s).",op.c_str());
|
|
}
|
|
}
|