version 1.9, 2008/06/26 18:32:47
|
version 1.10, 2008/08/07 18:04:06
|
|
|
// | // |
// Executing the Client | // Executing the Client |
// | // |
int rc = system(act_command.getCString()); |
int commandRc = system(act_command.getCString()); |
// | // |
// Continue even if the client failed to Execute | // Continue even if the client failed to Execute |
// This failure is validated with Tolerance level later | // This failure is validated with Tolerance level later |
// | // |
if (rc) |
if (commandRc) |
{ | { |
log_file<<"Command failed to Execute."<<endl; | log_file<<"Command failed to Execute."<<endl; |
if (verboseEnabled) | if (verboseEnabled) |
|
|
outPrintWriter<<StressTestControllerCommand::COMMAND_NAME<< | outPrintWriter<<StressTestControllerCommand::COMMAND_NAME<< |
"::Getting client PID's and status. "<<endl; | "::Getting client PID's and status. "<<endl; |
} | } |
int rc = _getClientPIDs(actual_client,log_file); |
int getClientPidRc = _getClientPIDs(actual_client,log_file); |
if (!rc) |
if (!getClientPidRc) |
{ | { |
outPrintWriter<< | outPrintWriter<< |
"Failed to communicate with clients."<<endl; | "Failed to communicate with clients."<<endl; |
|
|
// | // |
// Retreive all the client PIDs | // Retreive all the client PIDs |
// | // |
int rc = _getClientPIDs(actual_client,log_file); |
int getClientPidRc = _getClientPIDs(actual_client,log_file); |
| |
// | // |
// Get Current Time | // Get Current Time |
|
|
// End tests when failed to acquire the Client PID or | // End tests when failed to acquire the Client PID or |
// status. | // status. |
// | // |
if (!rc) |
if (!getClientPidRc) |
{ | { |
outPrintWriter<< | outPrintWriter<< |
"Failed to communicate with clients."<<endl; | "Failed to communicate with clients."<<endl; |
|
|
stop_file.close(); | stop_file.close(); |
#ifndef PEGASUS_OS_TYPE_WINDOWS | #ifndef PEGASUS_OS_TYPE_WINDOWS |
// one more way to stop the clients. | // one more way to stop the clients. |
int rc = |
int killRc = |
kill(clientPIDs[clientID+instanceID], SIGINT); | kill(clientPIDs[clientID+instanceID], SIGINT); |
if (rc) |
if (killRc) |
{ | { |
outPrintWriter<<"FAILED to stop client:("<< | outPrintWriter<<"FAILED to stop client:("<< |
clientID+instanceID<<")"<<endl; | clientID+instanceID<<")"<<endl; |
|
|
log_file<<" Restarted on "<< | log_file<<" Restarted on "<< |
strTime<<endl; | strTime<<endl; |
} | } |
int rc = system(act_command.getCString()); |
int commandRc = |
if (rc) |
system(act_command.getCString()); |
|
if (commandRc) |
{ | { |
log_file<<"Command failed to Execute."<< | log_file<<"Command failed to Execute."<< |
endl; | endl; |
|
|
// | // |
// get all the clientPIDs before it is stopped. | // get all the clientPIDs before it is stopped. |
// | // |
int rc = _getClientPIDs(actual_client,log_file); |
int getClientPidRc = _getClientPIDs(actual_client,log_file); |
if (!rc) |
if (!getClientPidRc) |
{ | { |
outPrintWriter<<"Failed to communicate with clients."<<endl; | outPrintWriter<<"Failed to communicate with clients."<<endl; |
log_file<<StressTestControllerCommand::COMMAND_NAME<< | log_file<<StressTestControllerCommand::COMMAND_NAME<< |
|
|
stop_file.close(); | stop_file.close(); |
#ifndef PEGASUS_OS_TYPE_WINDOWS | #ifndef PEGASUS_OS_TYPE_WINDOWS |
// Another way to stop the client | // Another way to stop the client |
int rc = 0; |
int killRc = kill(clientPIDs[i], SIGINT); |
rc = kill(clientPIDs[i], SIGINT); |
if (killRc) |
if (rc) |
|
{ | { |
if (verboseEnabled) | if (verboseEnabled) |
{ | { |