version 1.1, 2006/03/14 22:39:31
|
version 1.2, 2006/03/15 20:27:39
|
|
|
} | } |
} | } |
| |
int _beginTest(CIMClient& workClient, |
void _receiveExpectedTraps(CIMClient& workClient, |
Uint32 indicationSendCount, | Uint32 indicationSendCount, |
Uint32 runClientThreadCount) | Uint32 runClientThreadCount) |
{ | { |
| |
#ifdef PEGASUS_USE_NET_SNMP |
|
|
|
// Stop snmptrapd process if it is running |
|
_stopSnmptrapd(); |
|
|
|
// if trapLogFile exists, remove it |
|
_removeTrapLogFile(); |
|
|
|
FILE * trapInfo; |
|
|
|
try |
|
{ |
|
_startSnmptrapd(&trapInfo); |
|
} |
|
catch (Exception & e) |
|
{ |
|
cerr << e.getMessage() << endl; |
|
return (-1); |
|
} |
|
#else |
|
cerr << "Cannot create a trap receiver." << endl; |
|
return (-1); |
|
#endif |
|
|
|
CIMClient * clientConnections = new CIMClient[runClientThreadCount]; | CIMClient * clientConnections = new CIMClient[runClientThreadCount]; |
| |
// determine total number of indication send count | // determine total number of indication send count |
|
|
currentReceivedTrap1Count); | currentReceivedTrap1Count); |
PEGASUS_TEST_ASSERT(indicationSendCountTotal == | PEGASUS_TEST_ASSERT(indicationSendCountTotal == |
currentReceivedTrap2Count); | currentReceivedTrap2Count); |
|
} |
|
|
|
int _beginTest(CIMClient& workClient, |
|
Uint32 indicationSendCount, |
|
Uint32 runClientThreadCount) |
|
{ |
| |
#ifdef PEGASUS_USE_NET_SNMP | #ifdef PEGASUS_USE_NET_SNMP |
|
|
|
// Stop snmptrapd process if it is running |
|
_stopSnmptrapd(); |
|
|
|
// if trapLogFile exists, remove it |
|
_removeTrapLogFile(); |
|
|
|
FILE * trapInfo; |
|
|
|
try |
|
{ |
|
_startSnmptrapd(&trapInfo); |
|
} |
|
catch (Exception & e) |
|
{ |
|
cerr << e.getMessage() << endl; |
|
return (-1); |
|
} |
|
|
|
// Extended for all snmp implementation |
|
_receiveExpectedTraps(workClient, indicationSendCount, |
|
runClientThreadCount); |
|
|
// Stop snmptrapd process if it is running and remove procIdFile | // Stop snmptrapd process if it is running and remove procIdFile |
_stopSnmptrapd(); | _stopSnmptrapd(); |
| |
pclose(trapInfo); | pclose(trapInfo); |
#endif |
|
| |
// if error encountered then fail the test. | // if error encountered then fail the test. |
if (errorsEncountered.get()) | if (errorsEncountered.get()) |
|
|
cout << "+++++ passed all tests" << endl; | cout << "+++++ passed all tests" << endl; |
} | } |
| |
return 0; |
return (0); |
|
|
|
#else |
|
cerr << "Cannot create a trap receiver." << endl; |
|
return (-1); |
|
#endif |
} | } |
| |
int main (int argc, char** argv) | int main (int argc, char** argv) |