This commit is contained in:
Ren RenJuan 2014-01-11 00:58:45 +00:00
parent 5bbe878854
commit 13a7eaff72
6 changed files with 87 additions and 10 deletions

View File

@ -12,10 +12,10 @@ Cc=gcc
ifeq ($(LOCATION),authoring) ifeq ($(LOCATION),authoring)
ARTKLIB=-L/home/jdaugherty/clients/reg.de/git/ACTK1_0/lib 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 else
ARTKLIB=-L/home/jdaugherty/dnseppus/ACTK1_0/lib ARTKLIB=-L/home/jdaugherty/dnseppus/ACTK1_0/lib
ARTKINCL=-I/home/jdaugherty/dnseppus/ACTK1_0/common ARTKINCL=-I/home/jdaugherty/dnseppus/ACTK1_0
endif endif
SLIBS= -L/usr/lib $(BOSTLIB) $(LOG4LIB) $(ARTKLIB) -l boost_system -l boost_thread -l log4cpp -l ACTK1_0 SLIBS= -L/usr/lib $(BOSTLIB) $(LOG4LIB) $(ARTKLIB) -l boost_system -l boost_thread -l log4cpp -l ACTK1_0

View File

@ -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 { class ausRegEPPTK {
@ -8,8 +25,8 @@ class ausRegEPPTK {
public: int tkScenario; public: int tkScenario;
// See the Toolkit Overview. At this level supposedly it can do everything. // 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); bool didInit(const std::string propertiesFilePath);
void doOTEA();
}; };

View File

@ -26,7 +26,6 @@
namespace fsm = boost::statechart; namespace fsm = boost::statechart;
#include "ausRegTK.h"
#include "mdcommon.h" #include "mdcommon.h"
#include "mdevents.h" #include "mdevents.h"
#include "mdLogger.h" #include "mdLogger.h"
@ -34,6 +33,8 @@ namespace fsm = boost::statechart;
#include "mdState.h" #include "mdState.h"
#include "mdHost.h" #include "mdHost.h"
#include "ausRegTK.h"
#define MD_HAUSHALT 2000 // milliseconds between attention routine #define MD_HAUSHALT 2000 // milliseconds between attention routine
#define MD_LOCK_FILE "cliever-md.lock" #define MD_LOCK_FILE "cliever-md.lock"

View File

@ -141,6 +141,13 @@ enum mdDGtype {
N_MDDG_TYPES N_MDDG_TYPES
}; };
enum acTKScenario {
ACTK_ALONE = 0,
ACTK_INSECURE,
ACTK_OTEA,
N_ACTK_SCENARIOS
};
typedef typedef
struct MD_DG_TYPE { struct MD_DG_TYPE {
unsigned inBandOnly : 1; unsigned inBandOnly : 1;

View File

@ -126,7 +126,7 @@ void masterDaemon::dispatch(const mdIncoming &what) {
int masterDaemon::initAusRegTK(void) { int masterDaemon::initAusRegTK(void) {
int rc=OK; int rc=OK;
const std::string nil("etc/toolkit2.conf"); const std::string nil("/home/jdaugherty/dnseppus/etc/toolkit2.conf");
try { try {
@ -219,19 +219,32 @@ void masterDaemon::processEvent( const mdAPIFrame &thisFrame )
{ {
assert(EventSender<mdAPIFrame>::isSending()); assert(EventSender<mdAPIFrame>::isSending());
} }
void oteA() {
theseLogs->logNdebug(MAX_DEBUG,0,"OTE Connectivity Test BOJ.");
thisService->artk->doOTEA();
}
void masterDaemon::run() { void masterDaemon::run() {
deviceFactory = new mdHostFabrik(); deviceFactory = new mdHostFabrik();
fg = new mdDGChannel( thisService->io_, 0 ); fg = new mdDGChannel( thisService->io_, 0 );
if (initAusRegTK()) return; 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(); listen();
boost::thread work(mdWQ); boost::thread work(mdWQ);
assert(work.joinable()); assert(work.joinable());
theseLogs->logNdebug(MAX_DEBUG,0,"Master Daemon worker started, foreground async i/o service joins MD worker."); theseLogs->logNdebug(MAX_DEBUG,0,"Master Daemon worker started, foreground async i/o service joins MD worker.");
io_.run(); io_.run();
work.join(); work.join();
} }
void mdDGChannel::handle_receive_from(const boost::system::error_code& error, void mdDGChannel::handle_receive_from(const boost::system::error_code& error,

View File

@ -1,8 +1,13 @@
#define MD_AUSREG
#include "cliever-md.h" #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; bool did=false;
@ -16,3 +21,37 @@ bool ausRegEPPTK::didInit(const std::string propPath) {
return did; 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());
}
}