Code Review
/
doctor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
fix to get logfile
[doctor.git]
/
doctor_tests
/
main.py
diff --git
a/doctor_tests/main.py
b/doctor_tests/main.py
index
de45510
..
b9a3443
100644
(file)
--- a/
doctor_tests/main.py
+++ b/
doctor_tests/main.py
@@
-33,7
+33,9
@@
from doctor_tests.scenario.network_failure import NetworkFault
from doctor_tests.user import User
from doctor_tests.user import User
-LOG = doctor_log.Logger('doctor').getLogger()
+Logger = doctor_log.Logger('doctor')
+LOG = Logger.getLogger()
+LogFile = Logger.getLogFilename()
class DoctorTest(object):
class DoctorTest(object):
@@
-106,7
+108,7
@@
class DoctorTest(object):
# NOTE (umar) copy remote monitor.log file when monitor=collectd
self.check_host_status(self.down_host.name, 'down')
# NOTE (umar) copy remote monitor.log file when monitor=collectd
self.check_host_status(self.down_host.name, 'down')
- notification_time = calculate_notification_time()
+ notification_time = calculate_notification_time(
LogFile
)
if notification_time < 1 and notification_time > 0:
LOG.info('doctor test successfully, notification_time=%s' % notification_time)
else:
if notification_time < 1 and notification_time > 0:
LOG.info('doctor test successfully, notification_time=%s' % notification_time)
else:
@@
-156,24
+158,22
@@
class DoctorTest(object):
self.fault.get_disable_network_log()
def run_profiler(self):
self.fault.get_disable_network_log()
def run_profiler(self):
- test_dir = os.path.split(os.path.realpath(__file__))[0]
-
log_file = '{0}/{1}'.format(test_dir, 'disable_network.log'
)
+
net_down_log_file = self.fault.get_disable_network_log(
)
reg = '(?<=doctor set link down at )\d+.\d+'
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,
net_down_
log_file).group(0))
- log_file = '{0}/{1}'.format(test_dir, 'doctor.log')
reg = '(.* doctor mark vm.* error at )(\d+.\d+)'
reg = '(.* doctor mark vm.* error at )(\d+.\d+)'
- vmdown = float(match_rep_in_file(reg,
log_f
ile).group(2))
+ vmdown = float(match_rep_in_file(reg,
LogF
ile).group(2))
reg = '(.* doctor mark host.* down at )(\d+.\d+)'
reg = '(.* doctor mark host.* down at )(\d+.\d+)'
- hostdown = float(match_rep_in_file(reg,
log_f
ile).group(2))
+ hostdown = float(match_rep_in_file(reg,
LogF
ile).group(2))
reg = '(?<=doctor monitor detected at )\d+.\d+'
reg = '(?<=doctor monitor detected at )\d+.\d+'
- detected = float(match_rep_in_file(reg,
log_f
ile).group(0))
+ detected = float(match_rep_in_file(reg,
LogF
ile).group(0))
reg = '(?<=doctor consumer notified at )\d+.\d+'
reg = '(?<=doctor consumer notified at )\d+.\d+'
- notified = float(match_rep_in_file(reg,
log_f
ile).group(0))
+ notified = float(match_rep_in_file(reg,
LogF
ile).group(0))
# TODO(yujunz) check the actual delay to verify time sync status
# expected ~1s delay from $trigger to $linkdown
# TODO(yujunz) check the actual delay to verify time sync status
# expected ~1s delay from $trigger to $linkdown