version 1.1.2.2, 2006/04/24 19:15:09
|
version 1.1.2.3, 2006/04/27 15:08:33
|
|
|
// For Windows | // For Windows |
// | // |
#ifdef PEGASUS_OS_TYPE_WINDOWS | #ifdef PEGASUS_OS_TYPE_WINDOWS |
#include <windows.h> /* for DWORD etc. */ |
// for DWORD etc. |
typedef DWORD pid_t; /* getpid() and others */ |
#include <windows.h> |
|
// getpid() and others |
|
typedef DWORD pid_t; |
#include <process.h> | #include <process.h> |
#elif !defined(PEGASUS_OS_OS400) | #elif !defined(PEGASUS_OS_OS400) |
#include <unistd.h> | #include <unistd.h> |
|
|
| |
| |
/** | /** |
* Message resource name |
Message resource name |
*/ | */ |
| |
static const char REQUIRED_ARGS_MISSING [] = | static const char REQUIRED_ARGS_MISSING [] = |
|
|
"Clients.cimuser.CIMUserCommand..ERR_USAGE"; | "Clients.cimuser.CIMUserCommand..ERR_USAGE"; |
| |
| |
|
// |
// exclude main from the Pegasus Namespace | // exclude main from the Pegasus Namespace |
|
// |
PEGASUS_USING_PEGASUS; | PEGASUS_USING_PEGASUS; |
PEGASUS_USING_STD; | PEGASUS_USING_STD; |
| |
|
|
exit (Command::RC_ERROR); | exit (Command::RC_ERROR); |
} | } |
| |
|
// |
// open the log file | // open the log file |
|
// |
OpenAppend(log_file,command.getStressTestLogFile()); | OpenAppend(log_file,command.getStressTestLogFile()); |
| |
if (!log_file) | if (!log_file) |
|
|
exit (Command::RC_ERROR); | exit (Command::RC_ERROR); |
} | } |
| |
|
// |
// For help or version options execute usage/version and | // For help or version options execute usage/version and |
// exit | // exit |
|
// |
if ((command.getOperationType() == OPERATION_TYPE_HELP) | if ((command.getOperationType() == OPERATION_TYPE_HELP) |
||(command.getOperationType() == OPERATION_TYPE_VERSION)) | ||(command.getOperationType() == OPERATION_TYPE_VERSION)) |
{ | { |
|
|
// | // |
if (!FileSystem::exists(filename)) | if (!FileSystem::exists(filename)) |
{ | { |
|
// |
// Check for file in default directory as well | // Check for file in default directory as well |
|
// |
fileName = String::EMPTY; | fileName = String::EMPTY; |
fileName.append(StressTestControllerCommand::DEFAULT_CFGDIR); | fileName.append(StressTestControllerCommand::DEFAULT_CFGDIR); |
fileName.append(filename); | fileName.append(filename); |
|
|
} | } |
catch (...) | catch (...) |
{ | { |
// throw what was caught |
|
log_file<<StressTestControllerCommand::COMMAND_NAME<< | log_file<<StressTestControllerCommand::COMMAND_NAME<< |
"::Unknown exception caught when acquiring configuration."<<endl; | "::Unknown exception caught when acquiring configuration."<<endl; |
cerr<<StressTestControllerCommand::COMMAND_NAME<< | cerr<<StressTestControllerCommand::COMMAND_NAME<< |
|
|
log_file << StressTestControllerCommand::COMMAND_NAME <<endl; | log_file << StressTestControllerCommand::COMMAND_NAME <<endl; |
log_file << " Preparing to execute Clients on "<<strTime<<endl; | log_file << " Preparing to execute Clients on "<<strTime<<endl; |
| |
|
// |
// Begin to run stress Tests | // Begin to run stress Tests |
|
// |
rc = command.execute (cout, cerr); | rc = command.execute (cout, cerr); |
| |
// | // |
|
|
cout << "::successfully completed on "<<strTime<<endl; | cout << "::successfully completed on "<<strTime<<endl; |
} | } |
cout <<"IMPORTANT: "; | cout <<"IMPORTANT: "; |
cout <<"Please check the Controller and the Client log file" |
cout <<"Please check the Controller log file for additional info and the" |
<<endl; |
|
cout <<" for individual errors which may or may not have caused" |
|
<<endl; | <<endl; |
cout <<" a stress test failure. "<< endl; |
cout <<" Client log file for individual errors which may or may " |
|
<<"not have "<< endl; |
|
cout <<" caused a stress test failure. "<< endl; |
cout <<" Log Directory:"<<endl; | cout <<" Log Directory:"<<endl; |
cout <<" "<< | cout <<" "<< |
FileSystem::extractFilePath(command.getStressTestLogFile())<<endl; | FileSystem::extractFilePath(command.getStressTestLogFile())<<endl; |