Module: check_mk
Branch: master
Commit: 2117acac63c7062211e1364bca25895a1b3e9d58
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2117acac63c706…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Apr 5 13:09:29 2018 +0200
Synched test with latest EC changes.
Change-Id: I0d67d5ed5208030732910c3be792512a414c0497
---
tests/integration/cmk/ec/test_mkeventd_status.py | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/tests/integration/cmk/ec/test_mkeventd_status.py
b/tests/integration/cmk/ec/test_mkeventd_status.py
index 39a7517..981e0db 100644
--- a/tests/integration/cmk/ec/test_mkeventd_status.py
+++ b/tests/integration/cmk/ec/test_mkeventd_status.py
@@ -62,15 +62,21 @@ def event_status(settings, perfcounters):
@pytest.fixture(scope="function")
+def event_server(settings, config, perfcounters, event_status):
+ cmk.ec.main.g_event_server = cmk.ec.main.StatusServer(settings, perfcounters,
event_status)
+ return cmk.ec.main.g_event_server
+
+
+(a)pytest.fixture(scope="function")
def status_server(settings, config, perfcounters, event_status):
cmk.ec.main.g_status_server = cmk.ec.main.StatusServer(settings, perfcounters,
event_status)
return cmk.ec.main.g_status_server
-def test_handle_client(status_server, event_status):
+def test_handle_client(event_status, event_server, status_server):
s = FakeStatusSocket("GET events")
- status_server.handle_client(s, True, "127.0.0.1")
+ status_server.handle_client(event_server, s, True, "127.0.0.1")
response = s.get_response()
assert len(response) == 1
@@ -100,7 +106,7 @@ def test_mkevent_check_query_perf(config, status_server, event_status,
perfcount
#import cProfile, StringIO, pstats
#pr = cProfile.Profile()
#pr.enable()
- status_server.handle_client(s, True, "127.0.0.1")
+ status_server.handle_client(event_server, s, True, "127.0.0.1")
#pr.disable()
#ps = pstats.Stats(pr, stream=StringIO.StringIO())
#ps.dump_stats("/tmp/test_mkevent_check_query_perf.profile")