X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=doctor_tests%2Fmain.py;fp=doctor_tests%2Fmain.py;h=111c93d6f9f48461aab6223d72f3cb538a0e1c9b;hb=5733b9ce1dcfb40e0ef6a956c0e6c092829fc6d6;hp=0ea9d36b9ed4c4e1cab0cab58346e5f1154e0b32;hpb=f8d5647530ead1b88834e941961f5fa939c0f082;p=doctor.git diff --git a/doctor_tests/main.py b/doctor_tests/main.py index 0ea9d36b..111c93d6 100644 --- a/doctor_tests/main.py +++ b/doctor_tests/main.py @@ -35,9 +35,6 @@ from doctor_tests.user import User LOG = doctor_log.Logger('doctor').getLogger() -# TODO (r-mibu): fix doctor logger or consider logfile option -LOG_FILE = LOG.handlers[0].baseFilename - class DoctorTest(object): @@ -109,7 +106,7 @@ class DoctorTest(object): # NOTE (umar) copy remote monitor.log file when monitor=collectd self.check_host_status(self.down_host.name, 'down') - notification_time = calculate_notification_time(LOG_FILE) + notification_time = calculate_notification_time(LOG.filename) if notification_time < 1 and notification_time > 0: LOG.info('doctor test successfully, notification_time=%s' % notification_time) else: @@ -162,19 +159,19 @@ class DoctorTest(object): test_dir = os.path.split(os.path.realpath(__file__))[0] reg = '(?<=doctor set link down at )\d+.\d+' - linkdown = float(match_rep_in_file(reg, LOG_FILE).group(0)) + linkdown = float(match_rep_in_file(reg, LOG.filename).group(0)) reg = '(.* doctor mark vm.* error at )(\d+.\d+)' - vmdown = float(match_rep_in_file(reg, LOG_FILE).group(2)) + vmdown = float(match_rep_in_file(reg, LOG.filename).group(2)) reg = '(.* doctor mark host.* down at )(\d+.\d+)' - hostdown = float(match_rep_in_file(reg, LOG_FILE).group(2)) + hostdown = float(match_rep_in_file(reg, LOG.filename).group(2)) reg = '(?<=doctor monitor detected at )\d+.\d+' - detected = float(match_rep_in_file(reg, LOG_FILE).group(0)) + detected = float(match_rep_in_file(reg, LOG.filename).group(0)) reg = '(?<=doctor consumer notified at )\d+.\d+' - notified = float(match_rep_in_file(reg, LOG_FILE).group(0)) + notified = float(match_rep_in_file(reg, LOG.filename).group(0)) # TODO(yujunz) check the actual delay to verify time sync status # expected ~1s delay from $trigger to $linkdown