Module: check_mk
Branch: master
Commit: 415ca52244866975087fd0cbe0952b36ac5c0ab6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=415ca522448669…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 15 14:05:45 2016 +0100
Tests: Fixed broken free listen port detection
---
.gitignore | 2 +-
tests/mkeventd/test_mkeventd_status.py | 2 ++
tests/testlib/__init__.py | 4 ++++
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 286015b..55dfa22 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,5 +26,5 @@ RemoteSystemsTempFiles
.DS_Store
.cache
tags
-mkeventd
+mkeventd/
tests/web/data/*
diff --git a/tests/mkeventd/test_mkeventd_status.py
b/tests/mkeventd/test_mkeventd_status.py
index 824657b..0d2fa5d 100644
--- a/tests/mkeventd/test_mkeventd_status.py
+++ b/tests/mkeventd/test_mkeventd_status.py
@@ -23,6 +23,7 @@ def test_command_reload(site, ec, core):
live = ensure_core_and_get_connection(site, ec, core)
old_t = live.query_value("GET eventconsolestatus\nColumns:
status_config_load_time\n")
+ print "Old config load time: %s" % old_t
assert old_t > time.time() - 86400
time.sleep(1) # needed to have at least one second after EC start
@@ -30,6 +31,7 @@ def test_command_reload(site, ec, core):
time.sleep(1) # needed to have at least one second after EC reload
new_t = live.query_value("GET eventconsolestatus\nColumns:
status_config_load_time\n")
+ print "New config load time: %s" % old_t
assert new_t > old_t
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index cf68a03..78391a0 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -380,6 +380,7 @@ class Site(object):
while sock.connect_ex(('127.0.0.1', port)) == 0:
print "Port %d is already used, trying next" % port
port += 1
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print "Using port %d" % port
self._livestatus_port = port
@@ -804,11 +805,14 @@ class CMKEventConsole(CMKWebSession):
def activate_changes(self, web):
old_t = web.site.live.query_value("GET eventconsolestatus\nColumns:
status_config_load_time\n")
+ print "Old config load time: %s" % old_t
assert old_t > time.time() - 86400
super(CMKEventConsole, self).activate_changes(allow_foreign_changes=True)
+ time.sleep(1)
new_t = web.site.live.query_value("GET eventconsolestatus\nColumns:
status_config_load_time\n")
+ print "Old config load time: %s" % old_t
assert new_t > old_t