(file) Return to StressTestControllerMain.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / test / StressTestController

Diff for /pegasus/test/StressTestController/StressTestControllerMain.cpp between version 1.2 and 1.6

version 1.2, 2006/04/27 18:47:13 version 1.6, 2008/02/22 19:23:48
Line 29 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: John Alex  
 //  
 // Modified By:  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #include <iostream> #include <iostream>
Line 54 
Line 50 
  // getpid() and others  // getpid() and others
  typedef DWORD pid_t;  typedef DWORD pid_t;
  #include <process.h>  #include <process.h>
 #elif !defined(PEGASUS_OS_OS400)  #else
  #include <unistd.h>  #include <unistd.h>
 #endif #endif
  
Line 99 
Line 95 
     char strTime[256];     char strTime[256];
     struct tm tmTime;     struct tm tmTime;
     int rc;     int rc;
     String fileName = String::EMPTY;      String fileName;
     ofstream log_file;     ofstream log_file;
  
  
     tmTime = getCurrentActualTime();     tmTime = getCurrentActualTime();
     strftime(strTime,256,"%d%m%Y%H%M%S.",&tmTime);     strftime(strTime,256,"%d%m%Y%H%M%S.",&tmTime);
  
     StressTestControllerCommand command=StressTestControllerCommand();      StressTestControllerCommand command;
  
     //     //
     // Generate log files and PID files     // Generate log files and PID files
Line 116 
Line 112 
         cout<<StressTestControllerCommand::COMMAND_NAME\         cout<<StressTestControllerCommand::COMMAND_NAME\
             <<"::Failed to generate required files for tests. "<<endl;             <<"::Failed to generate required files for tests. "<<endl;
         command.removeUnusedFiles();         command.removeUnusedFiles();
         exit (Command::RC_ERROR);          return Command::RC_ERROR;
     }     }
  
     //     //
Line 129 
Line 125 
        log_file.close();        log_file.close();
        cout<<"Cannot get file "<<command.getStressTestLogFile()<<endl;        cout<<"Cannot get file "<<command.getStressTestLogFile()<<endl;
        command.removeUnusedFiles();        command.removeUnusedFiles();
        exit (Command::RC_ERROR);         return Command::RC_ERROR;
     }     }
     strftime(strTime,256,"%d/%m/%Y at %H:%M:%S\n",&tmTime);     strftime(strTime,256,"%d/%m/%Y at %H:%M:%S\n",&tmTime);
     log_file<<StressTestControllerCommand::COMMAND_NAME\     log_file<<StressTestControllerCommand::COMMAND_NAME\
Line 178 
Line 174 
  
         log_file.close();         log_file.close();
         command.removeUnusedFiles();         command.removeUnusedFiles();
         exit (Command::RC_ERROR);          return Command::RC_ERROR;
     }     }
     catch (...)     catch (...)
     {     {
Line 188 
Line 184 
             "::Unknown exception caught when setting commands."<<endl;             "::Unknown exception caught when setting commands."<<endl;
         log_file.close();         log_file.close();
         command.removeUnusedFiles();         command.removeUnusedFiles();
         exit (Command::RC_ERROR);          return Command::RC_ERROR;
     }     }
  
     //     //
Line 204 
Line 200 
         // Log file not required when help or verbose is opted.         // Log file not required when help or verbose is opted.
         //         //
         FileSystem::removeFile(command.getStressTestLogFile());         FileSystem::removeFile(command.getStressTestLogFile());
         exit (rc);          return rc;
     }     }
  
     String filename;     String filename;
Line 226 
Line 222 
             //             //
             // Check for file in default directory as well             // Check for file in default directory as well
             //             //
             fileName = String::EMPTY;              fileName = StressTestControllerCommand::DEFAULT_CFGDIR;
             fileName.append(StressTestControllerCommand::DEFAULT_CFGDIR);  
             fileName.append(filename);             fileName.append(filename);
  
             if (!FileSystem::exists(fileName))             if (!FileSystem::exists(fileName))
Line 237 
Line 232 
                 cerr << "\" does not exist."<<endl;                 cerr << "\" does not exist."<<endl;
                 log_file.close();                 log_file.close();
                 command.removeUnusedFiles();                 command.removeUnusedFiles();
                 exit (Command::RC_ERROR);                  return Command::RC_ERROR;
             }             }
             log_file<<StressTestControllerCommand::COMMAND_NAME<<             log_file<<StressTestControllerCommand::COMMAND_NAME<<
                 "::Using config file: "<<fileName<<endl;                 "::Using config file: "<<fileName<<endl;
Line 257 
Line 252 
         //         //
         // Use default file in default dir.         // Use default file in default dir.
         //         //
         fileName = String::EMPTY;          fileName = StressTestControllerCommand::DEFAULT_CFGDIR;
         fileName.append(StressTestControllerCommand::DEFAULT_CFGDIR);  
         fileName.append(StressTestControllerCommand::FILENAME);         fileName.append(StressTestControllerCommand::FILENAME);
         //         //
         // Use hard coded default configuration values if default conf. file         // Use hard coded default configuration values if default conf. file
Line 317 
Line 311 
             ": " << msg <<  endl;             ": " << msg <<  endl;
         log_file.close();         log_file.close();
         command.removeUnusedFiles();         command.removeUnusedFiles();
         exit (Command::RC_ERROR);          return Command::RC_ERROR;
   
     }     }
     catch (Exception& e )     catch (Exception& e )
     {     {
Line 331 
Line 324 
         cerr << msg <<  endl;         cerr << msg <<  endl;
         log_file.close();         log_file.close();
         command.removeUnusedFiles();         command.removeUnusedFiles();
         exit (Command::RC_ERROR);          return Command::RC_ERROR;
     }     }
     catch (...)     catch (...)
     {     {
Line 341 
Line 334 
             "::Unknown exception caught when acquiring configuration."<<endl;             "::Unknown exception caught when acquiring configuration."<<endl;
         log_file.close();         log_file.close();
         command.removeUnusedFiles();         command.removeUnusedFiles();
         exit (Command::RC_ERROR);          return Command::RC_ERROR;
     }     }
  
     log_file << StressTestControllerCommand::COMMAND_NAME <<     log_file << StressTestControllerCommand::COMMAND_NAME <<
Line 372 
Line 365 
             "::Failed to Generate Client Commands."<<  endl;             "::Failed to Generate Client Commands."<<  endl;
         log_file.close();         log_file.close();
         command.removeUnusedFiles();         command.removeUnusedFiles();
         exit (Command::RC_ERROR);          return Command::RC_ERROR;
     }     }
  
     //     //
Line 424 
Line 417 
     cout <<" Client log:     "<<     cout <<" Client log:     "<<
         FileSystem::extractFileName(command.getStressClientLogFile())<<endl;         FileSystem::extractFileName(command.getStressClientLogFile())<<endl;
     log_file.close();     log_file.close();
     exit (rc);  
     return rc;     return rc;
 } /* main */ } /* main */


Legend:
Removed from v.1.2  
changed lines
  Added in v.1.6

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2