Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For adding syslog support in PTL we will have to make changes in two files-  log_utils.py and pbs_testlib.py. We should make sure that the user running the tests will  have permissions to read syslog file and decompress it. For eg - in test bed machine pbsroot shoud be able to read from syslog file. 

 

Changes in log_utils.py

Changes in this file are related to the format of the recorded datetime and getting the path to the syslog file. Syslog records the datetime in a different format than local logs. According to the format we will have to do changes to reading the datetime.

Some syslog files are compressed. Even if we can derectly read a compressed file (eg .bz file) from python, but I would prefer if we decompress it so that rest of the code in PTL for reading files will work without any changes. 

 


1) Check is file is compressed. Decompress it to same location with same name. This will have to run everytime we want to do log_match().

if sys_log_file == compressed

...

    _sys_log_path_ = decompressed_file_path.


 

2) Date format. 

Change regular expression ‘tm_re ’ to match the date format of the syslog file.

...

1) Change log_file path from local logs to syslog. The local log file are in 4 locations- server, mom, sched, comm. For syslog since there is only one file, we only have to point it to that file. Path to the log file can be set through a environment variable before starting the PTL tests or through the test script. If the path is not set the default path "/var/log/messages" will be taken

sys_log_file_path= sys_log_path_

 

def init_logfile_path

   if PBS_SYSLOG=1

...

     path_log_file= __local_path__

 

 

Note- Def 'def log_lines' returns the last n lines of the log file.

...