Module: check_mk
Branch: master
Commit: 98e9a7926a8888f24444e62ac2ce0af42326ee91
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=98e9a7926a8888…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 15 11:30:22 2017 +0100
Add some debug information to unreachable notification test
Change-Id: I9d1cb7dc635d8401d61652629ad6c6167a427bad
---
tests/notifications/test_unreachable_notifications.py | 4 +++-
tests/testlib/__init__.py | 7 +++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/tests/notifications/test_unreachable_notifications.py
b/tests/notifications/test_unreachable_notifications.py
index 8717275..42c40e9 100644
--- a/tests/notifications/test_unreachable_notifications.py
+++ b/tests/notifications/test_unreachable_notifications.py
@@ -62,8 +62,10 @@ def scenario(request, web, site):
}
web.set_ruleset("extra_host_conf:notification_options", rule_result)
- # Make nagios check more often for incoming commands
+ # Make nagios check more often for incoming commands and add more
+ # details to the log
site.write_file("etc/nagios/nagios.d/zzz_test_unreachable_notifications.cfg",
+ "log_passive_checks=1\n"
"command_check_interval=1s\n")
web.activate_changes()
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index 1feac9b..869ccb8 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -256,6 +256,8 @@ class Site(object):
schedule_ts = time.time()
time.sleep(0.1)
+ print "last_check_before", last_check_before, "schedule_ts",
schedule_ts
+
self.live.command("[%d] PROCESS_HOST_CHECK_RESULT;%s;%d;%s" %
(schedule_ts, hostname, state, output))
last_check, host_state = self.live.query_row(
@@ -271,8 +273,9 @@ class Site(object):
print "processing host check result took %0.2f seconds" % (time.time()
- schedule_ts)
assert last_check > last_check_before, \
- "Check result not processed within %d seconds (%d, %d)" % \
- (wait_timeout, last_check, last_check_before)
+ "Check result not processed within %d seconds (last check before
reschedule: %d, " \
+ "scheduled at: %d, last check: %d)" % \
+ (wait_timeout, last_check_before, schedule_ts, last_check)
assert host_state == expected_state, \
"Expected %d state, got %d state" % (expected_state, host_state)