This commit is contained in:
parent
5bbe878854
commit
13a7eaff72
|
@ -12,10 +12,10 @@ Cc=gcc
|
|||
|
||||
ifeq ($(LOCATION),authoring)
|
||||
ARTKLIB=-L/home/jdaugherty/clients/reg.de/git/ACTK1_0/lib
|
||||
ARTKINCL=-I/home/jdaugherty/clients/reg.de/git/ACTK1_0/common
|
||||
ARTKINCL=-I/home/jdaugherty/clients/reg.de/git/ACTK1_0
|
||||
else
|
||||
ARTKLIB=-L/home/jdaugherty/dnseppus/ACTK1_0/lib
|
||||
ARTKINCL=-I/home/jdaugherty/dnseppus/ACTK1_0/common
|
||||
ARTKINCL=-I/home/jdaugherty/dnseppus/ACTK1_0
|
||||
endif
|
||||
|
||||
SLIBS= -L/usr/lib $(BOSTLIB) $(LOG4LIB) $(ARTKLIB) -l boost_system -l boost_thread -l log4cpp -l ACTK1_0
|
||||
|
|
|
@ -1,5 +1,22 @@
|
|||
#include <init.hpp>
|
||||
#ifdef MD_AUSREG
|
||||
#include "se/PollRequestCommand.hpp"
|
||||
#include "se/PollResponse.hpp"
|
||||
#include "session/Transaction.hpp"
|
||||
#include "session/SessionManagerFactory.hpp"
|
||||
#include "session/SessionManager.hpp"
|
||||
#include "session/Timer.hpp"
|
||||
#include "session/TestEnvironment.hpp"
|
||||
#endif
|
||||
|
||||
#include "common/init.hpp"
|
||||
|
||||
#ifdef MD_AUSREG
|
||||
#include "common/Test.hpp"
|
||||
#include <pthread.h>
|
||||
#include <memory>
|
||||
#include <unistd.h>
|
||||
#include <vector>
|
||||
#endif
|
||||
|
||||
class ausRegEPPTK {
|
||||
|
||||
|
@ -8,8 +25,8 @@ class ausRegEPPTK {
|
|||
public: int tkScenario;
|
||||
// See the Toolkit Overview. At this level supposedly it can do everything.
|
||||
|
||||
ausRegEPPTK() { tkScenario = 1; }
|
||||
ausRegEPPTK() { tkScenario = ACTK_OTEA; }
|
||||
bool didInit(const std::string propertiesFilePath);
|
||||
|
||||
void doOTEA();
|
||||
|
||||
};
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
namespace fsm = boost::statechart;
|
||||
|
||||
#include "ausRegTK.h"
|
||||
#include "mdcommon.h"
|
||||
#include "mdevents.h"
|
||||
#include "mdLogger.h"
|
||||
|
@ -34,6 +33,8 @@ namespace fsm = boost::statechart;
|
|||
#include "mdState.h"
|
||||
#include "mdHost.h"
|
||||
|
||||
#include "ausRegTK.h"
|
||||
|
||||
#define MD_HAUSHALT 2000 // milliseconds between attention routine
|
||||
#define MD_LOCK_FILE "cliever-md.lock"
|
||||
|
||||
|
|
|
@ -141,6 +141,13 @@ enum mdDGtype {
|
|||
N_MDDG_TYPES
|
||||
};
|
||||
|
||||
enum acTKScenario {
|
||||
ACTK_ALONE = 0,
|
||||
ACTK_INSECURE,
|
||||
ACTK_OTEA,
|
||||
N_ACTK_SCENARIOS
|
||||
};
|
||||
|
||||
typedef
|
||||
struct MD_DG_TYPE {
|
||||
unsigned inBandOnly : 1;
|
||||
|
|
|
@ -126,7 +126,7 @@ void masterDaemon::dispatch(const mdIncoming &what) {
|
|||
int masterDaemon::initAusRegTK(void) {
|
||||
|
||||
int rc=OK;
|
||||
const std::string nil("etc/toolkit2.conf");
|
||||
const std::string nil("/home/jdaugherty/dnseppus/etc/toolkit2.conf");
|
||||
|
||||
try {
|
||||
|
||||
|
@ -219,19 +219,32 @@ void masterDaemon::processEvent( const mdAPIFrame &thisFrame )
|
|||
{
|
||||
assert(EventSender<mdAPIFrame>::isSending());
|
||||
}
|
||||
void oteA() {
|
||||
|
||||
theseLogs->logNdebug(MAX_DEBUG,0,"OTE Connectivity Test BOJ.");
|
||||
thisService->artk->doOTEA();
|
||||
|
||||
}
|
||||
void masterDaemon::run() {
|
||||
|
||||
deviceFactory = new mdHostFabrik();
|
||||
fg = new mdDGChannel( thisService->io_, 0 );
|
||||
|
||||
if (initAusRegTK()) return;
|
||||
else switch(artk->tkScenario) {
|
||||
case ACTK_OTEA:
|
||||
boost::thread oteArun(oteA);
|
||||
assert(oteArun.joinable());
|
||||
oteArun.join();
|
||||
theseLogs->logNdebug(MAX_DEBUG,0,"OTE Connectivity Test EOJ.");
|
||||
break;
|
||||
}
|
||||
listen();
|
||||
boost::thread work(mdWQ);
|
||||
assert(work.joinable());
|
||||
theseLogs->logNdebug(MAX_DEBUG,0,"Master Daemon worker started, foreground async i/o service joins MD worker.");
|
||||
io_.run();
|
||||
work.join();
|
||||
|
||||
}
|
||||
|
||||
void mdDGChannel::handle_receive_from(const boost::system::error_code& error,
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
|
||||
#define MD_AUSREG
|
||||
#include "cliever-md.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
bool ausRegEPPTK::didInit(const std::string propPath) {
|
||||
static TestEnvironment props;
|
||||
|
||||
// static void testExecuteParallelTransactions() throw (EPPException);
|
||||
|
||||
bool ausRegEPPTK::didInit(const std::string propertiesFilePath) {
|
||||
|
||||
bool did=false;
|
||||
|
||||
|
@ -16,3 +21,37 @@ bool ausRegEPPTK::didInit(const std::string propPath) {
|
|||
return did;
|
||||
|
||||
}
|
||||
void ausRegEPPTK::doOTEA()
|
||||
{
|
||||
int hours;
|
||||
string op("newInstance");
|
||||
|
||||
scenario(tkScenario);
|
||||
|
||||
try {
|
||||
Timer::setTime("20070101.010101");
|
||||
auto_ptr<SessionManager> manager(SessionManagerFactory::newInstance(&props));
|
||||
op = "startup";
|
||||
manager->startup();
|
||||
op = "run (keep-alive)";
|
||||
|
||||
manager->run();
|
||||
for (hours=0;hours < 22;hours++) {
|
||||
// Spawn the keep alive thread.
|
||||
theseLogs->logN(1,"Start of OTE Test Hour %d.",hours);
|
||||
sleep(3630);
|
||||
}
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue