mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Gary Williams
20.27.2012 947f30ad4e7241fe6b3e2ab9dd7d319ed550f4d1
opendj-sdk/opends/tests/staf-tests/shared/python/common.py
@@ -58,7 +58,8 @@
            "md5_hash" ,
            "value_not_string" ,
            "get_system_uid" ,
            "date_compare"
            "date_compare" ,
            "tail_logfile"
            ]
class format_testcase:
@@ -889,3 +890,18 @@
    return "Less"
  else:
    return "Equal"
def tail_logfile(log_file,from_time):
  from java.text import SimpleDateFormat
  import re
  pattern=re.compile("\[(.*)\]")
  formatter = SimpleDateFormat("dd/MMM/yy:H:m:s Z")
  for line in log_file[1].split('\n'):
    mymatch = pattern.match(line)
    if mymatch:
      timestamp=mymatch.group(1)
      timestamp_object = formatter.parse(timestamp)
      if date_compare(from_time,timestamp_object) == 'Less':
        print line