Module: check_mk
Branch: master
Commit: 8b3454133f22bb6f4596064e25eee6092487141d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8b3454133f22bb…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Jan 29 18:10:44 2019 +0100
fixed another integration test: HOSTTAGS sorting
Change-Id: If4a4367d5de94e0de3d1a9a2d9b876c4b64cee5a
---
tests/integration/core/test_active_checks.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/tests/integration/core/test_active_checks.py
b/tests/integration/core/test_active_checks.py
index ba38195..c9da994 100644
--- a/tests/integration/core/test_active_checks.py
+++ b/tests/integration/core/test_active_checks.py
@@ -76,7 +76,9 @@ def test_active_check_macros(test_cfg, site, web, core):
macros = {
"$HOSTADDRESS$": "127.0.0.1",
"$HOSTNAME$": "test-host",
- "$_HOSTTAGS$": "/wato/ ip-v4 ip-v4-only lan no-agent no-snmp ping
prod site:%s wato" % site.id,
+ "$_HOSTTAGS$": " ".join(sorted(["/wato/",
"ip-v4", "ip-v4-only", "lan",
+ "no-agent", "no-snmp",
"ping",
+ "prod", "site:%s" % site.id,
"wato"])),
"$_HOSTADDRESS_4$": "127.0.0.1",
"$_HOSTADDRESS_6$": "",
"$_HOSTADDRESS_FAMILY$": "4",
@@ -132,6 +134,10 @@ def test_active_check_macros(test_cfg, site, web, core):
# TODO: Cleanup difference between nagios/cmc
if core == "nagios":
expected_output = expected_output.strip()
+ if var == "$_HOSTTAGS$":
+ splitted_output = plugin_output.split(" ")
+ plugin_output = splitted_output[0] + " " + "
".join(sorted(splitted_output[1:]))
+
assert expected_output == plugin_output, \
"Macro %s has wrong value (%r instead of %r)" % (var,
plugin_output, expected_output)