version 1.1.2.1, 2006/04/18 03:37:36
|
version 1.1.2.2, 2006/04/24 19:29:05
|
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Aruran (aruran.shanmug@in.ibm.com) & Melvin (msolomon@in.ibm.com), IBM |
// Author: Aruran (aruran.shanmug@in.ibm.com) & Melvin (msolomon@in.ibm.com), |
// for PEP# 241 |
// IBM for PEP# 241 |
// Modified By: | // Modified By: |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
|
|
#include <Pegasus/Common/TimeValue.h> | #include <Pegasus/Common/TimeValue.h> |
#include <signal.h> | #include <signal.h> |
| |
#ifdef PEGASUS_PLATFORM_WIN32_IX86_MSVC |
#ifdef PEGASUS_OS_TYPE_WINDOWS |
#include <windows.h> /* DWORD etc. */ | #include <windows.h> /* DWORD etc. */ |
typedef DWORD pid_t; | typedef DWORD pid_t; |
#include <process.h> /* getpid() and others */ |
#include <process.h> /* getpid() and others. */ |
#elif !defined(PEGASUS_OS_OS400) | #elif !defined(PEGASUS_OS_OS400) |
#include <unistd.h> | #include <unistd.h> |
#endif | #endif |
|
|
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
// StressTest Client Status types |
/** StressTest Client Status types. */ |
enum CStatus | enum CStatus |
{ | { |
CLIENT_PASS, | CLIENT_PASS, |
|
|
CLIENT_UNKNOWN | CLIENT_UNKNOWN |
}; | }; |
| |
|
#ifndef PEGASUS_STRESSTESTCLIENT_LINKAGE |
|
# ifdef PEGASUS_OS_TYPE_WINDOWS |
|
# ifdef PEGASUS_STRESSTESTCLIENT_INTERNAL |
|
# define PEGASUS_STRESSTESTCLIENT_LINKAGE PEGASUS_EXPORT |
|
# else |
|
# define PEGASUS_STRESSTESTCLIENT_LINKAGE PEGASUS_IMPORT |
|
# endif |
|
# else |
|
# define PEGASUS_STRESSTESTCLIENT_LINKAGE |
|
# endif |
|
#endif |
|
|
/** The TestStressTestClient class holds the common functionality for all the | /** The TestStressTestClient class holds the common functionality for all the |
stress test clients. | stress test clients. |
*/ | */ |
class PEGASUS_CLIENT_LINKAGE TestStressTestClient |
class PEGASUS_STRESSTESTCLIENT_LINKAGE TestStressTestClient |
{ | { |
|
|
public: | public: |
|
|
/** Constructor. */ | /** Constructor. */ |
TestStressTestClient(); | TestStressTestClient(); |
| |
/* This method is use to get all the options that are passed through command line. */ |
/* This method is use to get all the options that are passed through |
|
command line. |
int GetOptions( OptionManager& om, |
*/ |
|
int GetOptions( |
|
OptionManager& om, |
int& argc, | int& argc, |
char** argv, | char** argv, |
OptionRow* clientOptionsTable, | OptionRow* clientOptionsTable, |
Uint32 clientOptionCount |
Uint32 clientOptionCount); |
); |
|
| |
/** This method is used by clients to register client specific required options |
/** This method is used by clients to register client specific required |
to the option table. All these options are taken as mandatory one. |
options to the option table. All these options are taken as mandatory |
|
one. |
*/ | */ |
OptionRow* generateClientOptions( | OptionRow* generateClientOptions( |
OptionRow* clientOptionsTable, Uint32 clientOptionCount,Uint32& totalOptionCount); |
OptionRow* clientOptionsTable, |
|
Uint32 clientOptionCount, |
|
Uint32& totalOptionCount); |
| |
/** This method is used by the clients to connect to the server. If useSSL is |
/** This method is used by the clients to connect to the server. If useSSL |
true then an SSL connection will be atemped with the userName and passWord that |
is true then an SSL connection will be atemped with the userName and |
is passed in. If localConnection is true a connectLocal connection will be |
passWord that is passed in. If localConnection is true a connectLocal |
attempted. All parameters are required. |
connection will be attempted. All parameters are required. |
*/ | */ |
void connectClient( | void connectClient( |
CIMClient *client, | CIMClient *client, |
|
|
Uint32 timeout, | Uint32 timeout, |
Boolean verboseTest); | Boolean verboseTest); |
| |
/** This method is used by the clients to log information which are required for controller |
/** This method is used by the clients to log information which are |
reference. It logs the inofrmation with Client ID and status of the client |
required for controller reference. It logs the inofrmation with |
in the PID File log file. |
Client ID and status of the client in the PID File log file. |
*/ |
*/ |
void logInfo(String clientid, pid_t clientPid, int clientStatus, |
void logInfo( |
String &pidfile); |
String clientId, |
|
pid_t clientPid, |
|
int clientStatus, |
|
String &pidFile); |
| |
/** This method is used to take the client process start time. |
/** This method is used to take the client process start time. */ |
*/ |
|
void startTime(); | void startTime(); |
| |
/** This method is used to check the time stamp for logging information about the |
/** This method is used to check the time stamp for logging information |
success or failure. |
about the success or failure. |
*/ | */ |
Boolean checkTime(); | Boolean checkTime(); |
| |
/** This method is used to log the information about the client's success or failure percentage |
/** This method is used to log the information about the client's success |
at a specific interval of time. |
or failure percentage at a specific interval of time. |
*/ | */ |
void logErrorPercentage( Uint32 successCount, Uint32 totalCount, pid_t clientPid, |
void logErrorPercentage( |
String &clientlog, char client[] ); |
Uint32 successCount, |
|
Uint32 totalCount, |
|
pid_t clientPid, |
|
String &clientLog, |
|
char client[]); |
| |
/** This method is used to log the informations of client logs to the client log file |
/** This method is used to log the informations of client logs to the |
|
client log file. |
*/ | */ |
void errorLog( pid_t clientPid, String &clientlog, String &Message ); |
void errorLog(pid_t clientPid, String &clientLog, String &message); |
| |
//Timer details |
/** Timer details. */ |
Uint64 startMilliseconds; | Uint64 startMilliseconds; |
Uint64 nowMilliseconds; | Uint64 nowMilliseconds; |
Uint64 nextCheckupInMillisecs; | Uint64 nextCheckupInMillisecs; |
|
|
Uint32 optionCount; | Uint32 optionCount; |
}; | }; |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
|
#endif /* TestStressTestClient_h */ |
#endif /* TestStressTestClient_h |
|
*/ |
|
|
|
|
|