MKCommModelTests
|
00001 #include "meshkit-test.h" 00002 00003 #define MOCK_CC_SCRIPT "./mockcc.py" 00004 #define MOCK_CC_TR_SCRIPT "./mockcctr.py" 00005 //#define CCRESPONSE_PY "../../src/heartbeat-sender/CCResponse.py" 00006 #define CCRESPONSE_PY "./CCResponse.updated.py" 00007 00009 class MKControlTests : public Test::Suite { 00010 public: 00011 00012 MKControlTests() { 00013 TEST_ADD(MKControlTests::testStart); 00014 TEST_ADD(MKControlTests::testSendTraceRouteRequest); 00015 // TEST_ADD(MKControlTests::testUpdateBSON1); 00016 TEST_ADD(MKControlTests::testUpdateBSONRoute1); 00017 TEST_ADD(MKControlTests::testCCListen1); 00018 } 00019 00020 static bool respondMockLatency(int requestID, int latency); 00021 static bool respondMockTraceRoute(int requestID, char *target); 00022 // static bool receiveMockResponse(int requestID, vector<ip4_t> route); 00023 // static bool sendMockResponse(int requestID, vector<ip4_t> route); 00024 static pid_t setupResponder(); 00025 static void killResponder(pid_t respondProc); 00026 00027 protected: 00028 00029 void setup(); 00030 void tear_down(); 00031 void testStart(); 00032 void testSendTraceRouteRequest(); 00033 void testUpdateBSONLatency1(); 00034 void testUpdateBSONRoute1(); 00035 void testCCListen1(); // Latency 00036 void testCCListen2(); // TraceRoute 00037 00038 00039 MKCommModel *cm; 00040 00041 }; 00042