diff --git a/APIG/include/mdCommander.h b/APIG/include/mdCommander.h index 632b796..f5cecd6 100644 --- a/APIG/include/mdCommander.h +++ b/APIG/include/mdCommander.h @@ -23,7 +23,7 @@ struct { bool hasXML:1; bool reserved:7; - void bre[MAX_FSM]; + void *bre[MAX_FSM]; char *fsm[MAX_FSM]; // by which known at MD } eppState; diff --git a/AusRegCliever/Makefile b/AusRegCliever/Makefile index 245a537..889624a 100644 --- a/AusRegCliever/Makefile +++ b/AusRegCliever/Makefile @@ -76,8 +76,8 @@ CLFLAGS= -Wall -Wundef -Wpointer-arith -Wshadow \ -Wmissing-prototypes -Wnested-externs \ -Wstrict-prototypes -Waggregate-return -Wno-implicit -ACOBJS= build/cliever.o build/mdLogger.o build/masterDaemonConfig.o build/masterDaemon.o \ - build/mdHost.o build/mdState.o build/mdAusReg.o build/mdJSON.o +ACOBJS= build/mdAusReg.o build/cliever.o build/mdLogger.o build/masterDaemonConfig.o build/masterDaemon.o \ + build/mdHost.o build/mdState.o build/mdJSON.o MDOBJS= build/md.o build/mdLogger.o build/masterDaemonConfig.o build/masterDaemon.o \ build/mdHost.o build/mdState.o @@ -121,11 +121,11 @@ build/mdState.o: server/mdState.cpp include/mdState.h build/masterDaemon.o: server/masterDaemon.cpp include/masterDaemon.h $(CC) $(CFLAGS) server/masterDaemon.cpp -c -o build/masterDaemon.o $(SINCL) $(ARTKINCL) -build/mdJSON.o: server/mdJSON.cpp include/mdJSON.hpp include/RegistryXOTE.h +build/mdJSON.o: server/mdJSON.cpp include/mdJSON.hpp $(CC) $(CFLAGS) server/mdJSON.cpp -c -o build/mdJSON.o $(SINCL) $(ARTKINCL) -build/mdAusReg.o: server/mdAusReg.cpp include/ausRegTK.h - $(CC) $(CFLAGS) server/mdAusReg.cpp -c -o build/mdAusReg.o $(SINCL) $(ARTKINCL) $(ARTKLIB) -l libACTK1_0.so +build/mdAusReg.o: server/mdAusReg.cpp include/ausRegTK.h include/AC_OTE.h + $(CC) $(CFLAGS) server/mdAusReg.cpp -c -o build/mdAusReg.o $(SINCL) $(ARTKINCL) $(ARTKLIB) -l libACTK1_0.so build/ausreg-md: $(MDOBJS) $(CC) $(CFLAGS) -o build/ausreg-md $(SINCL) $(LIBS) $(MDOBJS) $(DLIBS) diff --git a/AusRegCliever/include/RegistryXOTE.h b/AusRegCliever/include/AC_OTE.h similarity index 71% rename from AusRegCliever/include/RegistryXOTE.h rename to AusRegCliever/include/AC_OTE.h index 8af4fc4..7ea7bb9 100644 --- a/AusRegCliever/include/RegistryXOTE.h +++ b/AusRegCliever/include/AC_OTE.h @@ -8,31 +8,18 @@ #ifndef REGISTRYOTE_H_ #define REGISTRYOTB_H_ - typedef void (*caseBody)(void); +typedef auto_ptr AC_SESSMGR; +typedef auto_ptr AC_SESSION; - typedef struct { - const char *caseName; - caseBody fBody; - const Json::Value *parms; - } testCase; - - typedef std::map testCases; - typedef std::map testFuncs; + static AC_SESSMGR ac_mgr; + static AC_SESSION ac_sess; namespace AC_OTE { - static TestEnvironment props; static int nCases; - testCases theseCases; - testFuncs theseFuncs; - - static std::string TEST_SE = - ""; - - - auto_ptr manager(SessionManagerFactory::newInstance(&props)); - auto_ptr sess(SessionFactory::newInstance(&props)); + testCases theseCases; + testFuncs theseFuncs; bool acTkInitialised = false, fatal = false, done = false, transferGainer; @@ -79,7 +66,7 @@ namespace AC_OTE { try { thisTest = Transaction(&oteCommand_1, &oteResponse_1); - manager->execute(thisTest); + ac_mgr->execute(thisTest); } catch(...) { @@ -102,7 +89,7 @@ namespace AC_OTE { try { thisTest = Transaction(&oteCommand_2, &oteResponse_2); - manager->execute(thisTest); + ac_mgr->execute(thisTest); theseLogs->logN(3,"(%d) Claims %s exist for %s.", cmd,(chkRspE.doClaimsExist() ? "do" : " do not "),thisName); if (chkRspE.doClaimsExist()) @@ -128,7 +115,7 @@ namespace AC_OTE { oteCommand_3(thisName,pw,&RID, &tech, &ns, &admin, &billing); DomainCreateResponse oteResponse_3; thisTest = Transaction(&oteCommand_3, &oteResponse_3); - manager->execute(thisTest); + ac_mgr->execute(thisTest); } @@ -146,7 +133,7 @@ namespace AC_OTE { try { thisTest = Transaction(&oteCommand_6, &oteResponse_6); - manager->execute(thisTest); + ac_mgr->execute(thisTest); } catch (EPPException& e) { const char *eMsg = e.getMessage().c_str(); @@ -170,7 +157,7 @@ namespace AC_OTE { try { thisTest = Transaction(&oteCommand_0, &oteResponse_0); - manager->execute(thisTest); + ac_mgr->execute(thisTest); } catch(const std::exception e) { @@ -194,7 +181,7 @@ namespace AC_OTE { try { thisTest = Transaction(&oteCommand_7, &oteResponse_7); - manager->execute(thisTest); + ac_mgr->execute(thisTest); } catch (EPPException& e) { const char *eMsg = e.getMessage().c_str(); @@ -219,7 +206,7 @@ namespace AC_OTE { try { thisTest = Transaction(&oteCommand_5, &oteResponse_5); - manager->execute(thisTest); + ac_mgr->execute(thisTest); } catch (EPPException& e) { const char *eMsg = e.getMessage().c_str(); @@ -248,7 +235,7 @@ namespace AC_OTE { thisTest = transferGainer ? Transaction(&oteCommand_4a, &oteResponse_4) : Transaction(&oteCommand_4b, &oteResponse_4) ; - manager->execute(thisTest); + ac_mgr->execute(thisTest); } catch(...) @@ -293,86 +280,5 @@ namespace AC_OTE { } } - -} // AC_OTE - -using namespace AC_OTE; - -bool ausRegEPPTK::registryXOTE() - { - bool debug=true; int i=0; - - if (!acTkInitialised) { - scenario(thisConfig->tkScenario,thisConfig->cfg_path); - acTkInitialised = true; - } - - const Json::Value suite = root["testSuite00"]; - - if (!suite) { - theseLogs->logN(0,"'testSuite00' suite root not found, need it."); - return true; - } - - for ( i = 0; i < suite.size(); ++i ) { const char *thisItem = suite[i].asString().c_str(); - if (debug) - theseLogs->logN(1,"item %.",thisItem); - if (strncmp(thisItem,"case",4)) continue; - if (strlen(thisItem) != 6) continue; - if (debug) - theseLogs->logN(1,"case %.",thisItem); - if (!theseFuncs[thisItem]) { - theseLogs->logN(0,"No logic to bind to '%s', need it."); - return false; - } - theseCases[AC_OTE::nCases].parms = &suite[i]; - theseCases[AC_OTE::nCases].fBody = theseFuncs[thisItem]; - theseCases[AC_OTE::nCases++].caseName = thisItem; - } - - while(!done) { - try { - - Timer::setTime("20140101.010101"); - - op = "startup"; - manager->startup(); - op = "run (keep-alive)"; - manager->run(); - - sess->open(); - - theseLogs->logN(2,"OTE %s [Hello] (%d).",thisAccount,cmd++); - sess->writeXML(TEST_SE); - sess->read(); - - for (i=0;ilogN(2,"%d (%s) Begin ",i,theseCases[i].caseName ); - theseCases[i].fBody(); - theseLogs->logN(2,"%d (%s) End ",i,theseCases[i].caseName ); - - } - - theseLogs->logN(0,"End OTE Session."); - theseLogs->logN(0,"Restart with toolkit scenario >= 5 for production ops."); - - sess->close(); - manager->shutdown(); - - } - catch (EPPException& e) - { const char *eMsg = e.getMessage().c_str(); - const char *opNow = op.c_str(); - theseLogs->logN(2,"Outer EPP Exception during OTE (%s): %s .",opNow,eMsg); - throw e; - } - catch (...) - { - theseLogs->logN(2,"Outer General Exception in OTE (%s).",op.c_str()); - } - - }// debug while -} - +} // AC_OTE namespace #endif /* REGISTRY_X */ diff --git a/AusRegCliever/include/ausRegTK.h b/AusRegCliever/include/ausRegTK.h index cff673d..496ee69 100644 --- a/AusRegCliever/include/ausRegTK.h +++ b/AusRegCliever/include/ausRegTK.h @@ -34,13 +34,11 @@ class ausRegEPPTK { ausRegEPPTK() { tkScenario=thisConfig->tkScenario; // Maybe R-R pair specific later daysRunning = 0; } + bool doNothing(const std::string propertiesFilePath); void doOTEA(); void doOTEB(); - void doOTEC(); - void doOTEP(); - bool registryXOTE(); - bool walkDontRun(); - bool walkAndRun(); + void doPROD(); + void registryXOTE(); }; diff --git a/AusRegCliever/include/donutsOTEB.h b/AusRegCliever/include/donutsOTEB.h index 08f7f4c..765f0a6 100644 --- a/AusRegCliever/include/donutsOTEB.h +++ b/AusRegCliever/include/donutsOTEB.h @@ -11,7 +11,7 @@ void ausRegEPPTK::doOTEB() { bool addDomains = false, debug=true, contactCreated = true, doTransfers = false, - transferGainer = false, doDPML=false; + transferGainer = false, doDPML=true; int cmd=0; const char *thatAccount="secura2-ote2", *thisAccount="secura1-ote"; @@ -77,18 +77,24 @@ void ausRegEPPTK::doOTEB() theseLogs->logN(1,"Continue OTE Transactions."); sleep(2); - theseLogs->logN(2,"(%d) Non-LPE check of %s",cmd++,name1); + theseLogs->logN(2,"(%d) Non-LPE check of %s",cmd++,name5); - DomainCheckCommand oteCommand_1(name1); + DomainCheckCommand oteCommand_1(name5); DomainCheckResponse oteResponse_1; try { thisTest = Transaction(&oteCommand_1, &oteResponse_1); manager->execute(thisTest); } - catch(...) + 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(0,"Case %d Failed, harness catch.",cmd++); + theseLogs->logN(1,"General Exception OTE B (%s).",op.c_str()); } theseLogs->logN(2,"(%d) Perform Claims type Check of %s",cmd++,name3); @@ -207,7 +213,7 @@ void ausRegEPPTK::doOTEB() } catch(...) { - theseLogs->logN(0,"Case %d Failed, harness catch.",cmd++); + theseLogs->logN(1,"Case %d Failed, harness catch.",cmd++); } } @@ -237,8 +243,9 @@ void ausRegEPPTK::doOTEB() } - theseLogs->logN(2,"(%d) Create %s w Notice ID test data (TCN).",++cmd,name3); + theseLogs->logN(2,"(%d) skip Create %s w Notice ID test data (TCN).",++cmd,name3); + if (0) { // done string noticeID("d85159710000000000000008692"), notAfter("2015-01-01T12:00:00Z"), acceptedDate("2014-01-27T19:00:00Z"); @@ -261,8 +268,9 @@ void ausRegEPPTK::doOTEB() { theseLogs->logN(1,"General Exception OTE B (%s).",op.c_str()); } + } - if (doDPML) { std::string dpmlName("face.dpml.zone"); + if (doDPML) { std::string dpmlName("face.dpml.zone"); theseLogs->logN(2,"(%d) Create %s w ICANN SMD file.",++cmd,dpmlName.c_str()); diff --git a/AusRegCliever/include/mdJSON.hpp b/AusRegCliever/include/mdJSON.hpp index 15f2dbf..9a54146 100644 --- a/AusRegCliever/include/mdJSON.hpp +++ b/AusRegCliever/include/mdJSON.hpp @@ -8,6 +8,23 @@ #ifndef MDJSON_HPP_ #define MDJSON_HPP_ + typedef void (*caseBody)(void); + + typedef struct { + const char *caseName; + caseBody fBody; + const Json::Value *parms; + } testCase; + + typedef std::map testCases; + typedef std::map testFuncs; + +#ifdef MD_JSON + static Json::Value root; +#else + extern Json::Value root; +#endif + class mdJSON { private: @@ -17,10 +34,12 @@ public: bool fatal; - mdJSON (char *fileName); + mdJSON() : fatal(false) {} bool parse(); bool didDie() {return fatal;} void die(){ fatal = true;} + void setPath(char *filePath); + bool run(); }; diff --git a/AusRegCliever/server/masterDaemon.cpp b/AusRegCliever/server/masterDaemon.cpp index e4629e4..8e7bc9c 100644 --- a/AusRegCliever/server/masterDaemon.cpp +++ b/AusRegCliever/server/masterDaemon.cpp @@ -244,23 +244,23 @@ void oteA() { #endif } -void oteC() { +void otePROD() { #if (ARTKENABLED > 0) int nthDay; theseLogs->logNdebug(MAX_DEBUG,0,"JSON Scripted Directory Monitor/Executor BOJ"); - thisService->artk->doOTEC(); + thisService->artk->registryXOTE(); theseLogs->logNdebug(MAX_DEBUG,0,"JSON Scripted Directory Monitor/Executor EOJ"); #endif } -void oteP() { +void fullProduction() { #if (ARTKENABLED > 0) int nthDay; for (nthDay=0;nthDay<30;nthDay++) { theseLogs->logNdebug(MAX_DEBUG,1,"AC Production SoD %d",nthDay); - thisService->artk->doOTEP(); + thisService->artk->doPROD(); theseLogs->logNdebug(MAX_DEBUG,1,"AC Production EoD %d",nthDay); thisService->artk->daysRunning = nthDay; @@ -292,15 +292,15 @@ void masterDaemon::run() { theseLogs->logNdebug(MAX_DEBUG,0,"OTE Basic Access Test EOJ."); } if (artk->tkScenario == ACTK_OTEC) { - boost::thread oteCrun(oteC); - assert(oteCrun.joinable()); - oteCrun.join(); + boost::thread prodInOTE(otePROD); + assert(prodInOTE.joinable()); + prodInOTE.join(); theseLogs->logNdebug(MAX_DEBUG,0,"OTE Full Access EOJ."); } if (artk->tkScenario == ACTK_PROD) { - boost::thread otePrun(oteC); - assert(otePrun.joinable()); - otePrun.join(); + boost::thread rxPROD(fullProduction); + assert(rxPROD.joinable()); + rxPROD.join(); theseLogs->logNdebug(MAX_DEBUG,0,"AC Production EOJ."); } #endif diff --git a/AusRegCliever/server/mdAusReg.cpp b/AusRegCliever/server/mdAusReg.cpp index a2eaff0..51f80c8 100644 --- a/AusRegCliever/server/mdAusReg.cpp +++ b/AusRegCliever/server/mdAusReg.cpp @@ -24,7 +24,8 @@ #include #include #include -#include "mdJSON.hpp"" +#include +#include "mdJSON.hpp" using namespace std; @@ -36,18 +37,21 @@ using namespace std; //char *name6 = "shady.ventures"; // //char *name7 = "hemmarhoid.camera"; // //char *name3 = "pricey.holdings"; // -char *name1 = "yoda.guru"; -char *name2 = "unicycles.bike"; -char *name3 = "test-validate.claimsgasix"; -char *name4 = "horny.singles"; -char *name5 = "atmospheric.lighting"; -char *name6 = "mushroomtheory.management"; +const char *name1 = "yoda.guru"; +const char *name2 = "unicycles.bike"; +const char *name3 = "test-validate.claimsgasix"; +const char *name4 = "horny.singles"; +const char *name5 = "atmospheric.lighting"; +const char *name6 = "mushroomtheory.management"; -static TestEnvironment props; + static TestEnvironment props; -static std::string TEST_SE = + static std::string TEST_SE = ""; + +#include "AC_OTE.h" + // static void testExecuteParallelTransactions() throw (EPPException); bool ausRegEPPTK::doNothing(const std::string propertiesFilePath) { // Just verify load @@ -108,38 +112,61 @@ void ausRegEPPTK::doOTEA() } } #include "donutsOTEB.h" -void ausRegEPPTK::doOTEC() { +void ausRegEPPTK::registryXOTE() { // PROD in OTE // This scenario generalizes OTEB so that its operations can be performed - // by json scripting. This is a quick and dirty which can be extended in - // obvious ways and monitors a directory for new or changed files. + // by json scripting. This is a quick and clean which is meant to allow + // a Registrar to begin quasi-production ops from the established OTE + // baseline. It's main use case is scripted OTE ops however, it's not + // meant to be actual production. bool actionableFileEvent,monitoring=true; - int length, i = 0; - int fd; - int wd; + int length, i = 0, mSleeps=0, nSleeps=0,debug=10000; + int fd, wd; char buffer[BUF_LEN]; - fd = inotify_init(); + string op("newInstance"); - if ( fd < 0 ) { - theseLogs->logN(0,"Fatal error, couldn't init inotify."); - return; - } + scenario(thisConfig->tkScenario,thisConfig->cfg_path); - theseLogs->logN(0,"Monitoring ./json for changes."); + try { + Timer::setTime("20140101.010101"); + auto_ptr manager(SessionManagerFactory::newInstance(&props)); + auto_ptr sess(SessionFactory::newInstance(&props)); + op = "startup"; + manager->startup(); + op = "run (keep-alive)"; + manager->run(); - wd = inotify_add_watch( fd, "./json", IN_MODIFY | IN_CREATE | IN_DELETE ); - length = read( fd, buffer, BUF_LEN ); + sess->open(); + theseLogs->logN(0,"Begin RegistryXOTE Session."); + sess->writeXML(TEST_SE); + sess->read(); - if ( length < 0 ) { + fd = inotify_init(); + + if ( fd < 0 ) { + theseLogs->logN(0,"Fatal error, couldn't init inotify."); + return; + } + + ac_mgr = manager; + ac_sess = sess; + + theseLogs->logN(0,"Monitoring ./json for changes."); + + wd = inotify_add_watch( fd, "./json", IN_MODIFY | IN_CREATE | IN_DELETE ); + length = read( fd, buffer, BUF_LEN ); + + if ( length < 0 ) { theseLogs->logN(0,"Fatal error, initial inotify read failed."); - } + } - while ( i < length && monitoring) - { actionableFileEvent = false; - struct inotify_event *event = ( struct inotify_event * ) &buffer[ i ]; - if ( event->len ) { - if ( event->mask & IN_CREATE ) { + while ( i < length && monitoring) + { actionableFileEvent = false; + struct inotify_event *event = ( struct inotify_event * ) &buffer[ i ]; + + if ( event->len ) { + if ( event->mask & IN_CREATE ) { if ( event->mask & IN_ISDIR ) { theseLogs->logN(1,"The directory %s was created.\n", event->name ); } @@ -147,16 +174,16 @@ void ausRegEPPTK::doOTEC() { theseLogs->logN(1,"The file %s was created.\n", event->name ); actionableFileEvent = true; } - } - else if ( event->mask & IN_DELETE ) { + } + else if ( event->mask & IN_DELETE ) { if ( event->mask & IN_ISDIR ) { theseLogs->logN(1,"The directory %s was deleted.\n", event->name ); } else { printf( "The file %s was deleted.\n", event->name ); } - } - else if ( event->mask & IN_MODIFY ) { + } + else if ( event->mask & IN_MODIFY ) { if ( event->mask & IN_ISDIR ) { theseLogs->logN(1, "The directory %s was modified.\n", event->name ); } @@ -164,12 +191,14 @@ void ausRegEPPTK::doOTEC() { theseLogs->logN(1, "The file %s was modified.\n", event->name ); actionableFileEvent = true; } - } - } - i += EVENT_SIZE + event->len; - if (actionableFileEvent) { mdJSON scriptor(event->name); - if (scriptor.parse()) { - if (registryXOTE()) { + } + + i += EVENT_SIZE + event->len; + if (actionableFileEvent) { char wxyz[100]; sprintf(wxyz,"./json/%s",event->name); + mdJSON scriptor; + scriptor.setPath(wxyz); + if (scriptor.parse()) { + if (scriptor.run()) { if (didDie) { monitoring = false; theseLogs->logN(1, "Run of %s fatal error. ./json monitoring stops.\n", event->name ); @@ -180,19 +209,50 @@ void ausRegEPPTK::doOTEC() { } else theseLogs->logN(1, " %s completed OK. ./json monitoring continues. \n", event->name ); + } + else { + theseLogs->logN(1, "Parse of %s failed. ,/json monitoring continues.\n", event->name ); + } } - else { - theseLogs->logN(1, "Parse of %s failed. ,/json monitoring continues.\n", event->name ); - } + +#define PRODINOTESLEEP 2 + + if (!(nSleeps % (60/PRODINOTESLEEP))) + theseLogs->logN(1,"Approximate AC PROD in OTE Hour %d.",(nSleeps/(60/PRODINOTESLEEP))); + + if (mSleeps == (857/PRODINOTESLEEP)) { + sess->writeXML(TEST_SE); + sess->read(); + mSleeps = 0; + } + + sleep(PRODINOTESLEEP); + nSleeps++; mSleeps++; + if (debug > 999) + theseLogs->logN(2,"nSleeps: %d mSleeps %d.",nSleeps,mSleeps); + + } // while monitoring + ( void ) inotify_rm_watch( fd, wd ); + ( void ) close( fd ); } - else sleep(1); + theseLogs->logN(0,"End PROD in OTE Session."); + + sess->close(); + manager->shutdown(); + } + catch (EPPException& e) + { const char *eMsg = e.getMessage().c_str(); + const char *opNow = op.c_str(); + theseLogs->logN(2,"Outer EPP Exception during PRODinOTE (%s): %s .",opNow,eMsg); + throw e; + } + catch (...) + { + theseLogs->logN(2,"Outer General Exception in OTE (%s).",op.c_str()); } - ( void ) inotify_rm_watch( fd, wd ); - ( void ) close( fd ); - } -void ausRegEPPTK::doOTEP() +void ausRegEPPTK::doPROD() { int hours,hoops; string op("newInstance"); diff --git a/AusRegCliever/server/mdJSON.cpp b/AusRegCliever/server/mdJSON.cpp index ffd9cf5..c2f66eb 100644 --- a/AusRegCliever/server/mdJSON.cpp +++ b/AusRegCliever/server/mdJSON.cpp @@ -6,39 +6,18 @@ */ #define MD_JSON #include "cliever-md.h" -#include "session/SessionFactory.hpp" -#include "session/SessionManagerProperties.hpp" -#include "session/Transaction.hpp" -#include "common/SystemProperties.hpp" -#include "session/Session.hpp" -#include "session/StatsManager.hpp" -#include "se/DomainCheckCommand.hpp" -#include "se/DomainCheckResponse.hpp" -#include "se/LPE/LPChkCmdExtension.hpp" -#include "se/LPE/LPChkRespExtension.hpp" -#include "se/LPE/LPCrtCmdExtension.hpp" -#include "se/LPE/LPCrtRespExtension.hpp" -#include "se/TransferOp.hpp" -#include "se/IntPostalInfo.hpp" -#include "se/ContactCreateCommand.hpp" -#include "se/ContactCreateResponse.hpp" -#include "se/DomainCreateCommand.hpp" -#include "se/DomainCreateResponse.hpp" -#include "se/DomainTransferApproveCommand.hpp" -#include "se/DomainTransferRequestCommand.hpp" -#include "se/DomainTransferResponse.hpp" -#include "mdJSON.hpp" - #include // sort #include #include +#include "mdJSON.hpp" - static Json::Value root; +namespace AC_OTE { + extern testCases theseCases; + extern testFuncs theseFuncs; +} using namespace std; -#include "RegistryXOTE.h" - static std::string readInputTestFile( const char *path ) { @@ -58,6 +37,55 @@ readInputTestFile( const char *path ) return text; } +bool mdJSON::run() +{ + bool done=false, debug=true; int i=0, nCases =0; + + const Json::Value suite = root["testSuite00"]; + + if (!suite) { + theseLogs->logN(0,"No 'testSuite00' suite root, can't run."); + return true; + } + + for ( i = 0; i < suite.size(); ++i ) { const char *thisItem = suite[i].asString().c_str(); + if (debug) + theseLogs->logN(1,"item %.",thisItem); + if (strncmp(thisItem,"case",4)) continue; + if (strlen(thisItem) != 6) continue; + if (debug) + theseLogs->logN(1,"case %.",thisItem); + if (!AC_OTE::theseFuncs[thisItem]) { + theseLogs->logN(0,"No logic to bind to '%s', need it."); + return false; + } + AC_OTE::theseCases[nCases].parms = &suite[i]; + AC_OTE::theseCases[nCases].fBody = AC_OTE::theseFuncs[thisItem]; + AC_OTE::theseCases[nCases++].caseName = thisItem; + } + + while(!done) { + try { + + for (i=0;ilogN(2,"%d (%s) Begin ",i,AC_OTE::theseCases[i].caseName ); + AC_OTE::theseCases[i].fBody(); + theseLogs->logN(2,"%d (%s) End ",i,AC_OTE::theseCases[i].caseName ); + + } + + theseLogs->logN(0,"End OTE Session."); + theseLogs->logN(0,"Restart with toolkit scenario >= 5 for production ops."); + + } + catch (...) + { + theseLogs->logN(0,"Inner JSON Execution in OTE "); + } + } +} + static bool parseValueTree( const std::string &input, const std::string &kind, Json::Value &root, const Json::Features &features) { @@ -99,9 +127,9 @@ bool mdJSON::parse() return value; } -mdJSON::mdJSON(char *fileName) { +void mdJSON::setPath(char *fileName) { -//rrj path = string(fileName); + path = string(fileName); } diff --git a/json/OTEC.json b/json/OTEC.json new file mode 100644 index 0000000..7b36aa6 --- /dev/null +++ b/json/OTEC.json @@ -0,0 +1,95 @@ + +{ + + "_comment" : "mdJSON.cpp will try to bind data and run if it recognizes the leading field name." + "_comment" : "I'm using convention of inserting a hyphen to disable a test case." + + "testSuite00": "Outer block of a set of inputs to mdJSON.cpp to be run by ausRegTK::registryXOTE()" + "testSuite00": "Repeat case name casexx as needed, to run needs logic bound in RegistryXOTE.h" + + "testSuite-00" : { + + "Registry" : "Donuts", + "AccountA" : "secura1-ote", + "AccountB" : "secura2-ote2", + + "case00" : "Create a contact" + "case-00" : { + + "cont_id": "renjuan", + "cont_pw": "Ab9dW@rd", + "cont_email": "juan@acm.org", + "cont-name": "Ren Ren-Juan", + "cont-city": "Niagara Falls", + "cont_street1: "2926 2nd Street", + "cont-province": NY", + "cont-postal-code": "14305", + "cont-guo": "US", + "cont-org": "American Kybernetik" + + } + + "case01" : "Conventional / Standard/ Unextended Check" + "case-01" : { + + "name" : "bestever.camera" + + } + + "case02" : "Check with Claims Extension" + "case-02" : { + + "name" : "unicycles.bike" + } + + "case03" : "Conventional / Standard / Unextended Create" + "case-03" : { + + "name" : "greedy.ventures" + + } + + "case04" : "DPML Create" + "case-04" : { + + "name" : "face.dpml.zone" + "smd-data" : "./smd/face-test.smd" + + } + + "case00" : "Create another contact" + "case-00" : { + + "cont_id": "renjuan2", + "cont_pw": "Ab9dW@rd", + "cont_email": "juan@acm.org", + "cont-name": "Ren Ren-Juan", + "cont-city": "Niagara Falls", + "cont_street1: "2926 2nd Street", + "cont-province": NY", + "cont-postal-code": "14305", + "cont-guo": "US", + "cont-org": "American Kybernetik" + + } + + "case04" : "DPML Create" + "case-04" : { + + "name" : "secura.dpml.zone" + "smd-data" : "./smd/secura-test.smd" + + } + + "case05" : "Create with TCN Override" + "case-05" : { + + "name" : "greedy.ventures" + "noticeID" : "" + "notBefore" : "" + "acceptedDate" : "" + + } + + } +} \ No newline at end of file