lists.checkmk.com
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
List overview
Download
Checkmk git commits
March 2019
----- 2024 -----
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
checkmk-commits@lists.checkmk.com
17 participants
451 discussions
Start a n
N
ew thread
Moved walk backend conditions to single place
by Lars Michelsen
Module: check_mk Branch: master Commit: c2c3a718c16108ebdd299109a11369f320f877e7 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c2c3a718c16108…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Feb 28 09:33:18 2019 +0100 Moved walk backend conditions to single place CMK-1736 Change-Id: Ia111c4a0da64093f1fc8d65c58beddecd8d8643f --- cmk_base/snmp.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmk_base/snmp.py b/cmk_base/snmp.py index 50e3e48..9a69677 100644 --- a/cmk_base/snmp.py +++ b/cmk_base/snmp.py @@ -502,10 +502,7 @@ def _get_snmpwalk(host_config, check_plugin_name, oid, fetchoid, column, use_snm rowinfo = _get_cached_snmpwalk(host_config.hostname, fetchoid) if rowinfo is None: - if _enforce_stored_walks or config.is_usewalk_host(host_config.hostname): - rowinfo = StoredWalkSNMPBackend().walk(host_config, fetchoid) - else: - rowinfo = _perform_snmpwalk(host_config, check_plugin_name, oid, fetchoid) + rowinfo = _perform_snmpwalk(host_config, check_plugin_name, oid, fetchoid) if is_cachable: _save_snmpwalk_cache(host_config.hostname, fetchoid, rowinfo) @@ -522,7 +519,10 @@ def _perform_snmpwalk(host_config, check_plugin_name, base_oid, fetchoid): snmp_contexts = [None] for context_name in snmp_contexts: - if config.is_inline_snmp_host(host_config.hostname): + if _enforce_stored_walks or config.is_usewalk_host(host_config.hostname): + rows = StoredWalkSNMPBackend().walk(host_config, fetchoid) + + elif config.is_inline_snmp_host(host_config.hostname): rows = inline_snmp.walk( host_config, check_plugin_name, fetchoid, base_oid, context_name=context_name) else:
5 years, 4 months
1
0
0
0
Move stored walk handling to StoredWalkSNMPBackend
by Lars Michelsen
Module: check_mk Branch: master Commit: f84925334acc17b60b406dfc15248d7534019a4e URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f84925334acc17…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Feb 28 08:30:19 2019 +0100 Move stored walk handling to StoredWalkSNMPBackend CMK-1736 Change-Id: I84cda4bdfc61750af4cd4567c125e216ddb16ae0 --- cmk_base/snmp.py | 205 +++++++++++++++++++++++++++---------------------------- 1 file changed, 102 insertions(+), 103 deletions(-) diff --git a/cmk_base/snmp.py b/cmk_base/snmp.py index 61ba291..3617797 100644 --- a/cmk_base/snmp.py +++ b/cmk_base/snmp.py @@ -324,7 +324,7 @@ class SNMPBackendFactory(object): class StoredWalkSNMPBackend(cmk_base.snmp_utils.ABCSNMPBackend): def get(self, host_config, oid, context_name=None): - walk = _get_stored_snmpwalk(host_config.hostname, oid) + walk = self.walk(host_config, oid) # get_stored_snmpwalk returns all oids that start with oid but here # we need an exact match @@ -336,6 +336,106 @@ class StoredWalkSNMPBackend(cmk_base.snmp_utils.ABCSNMPBackend): return None + def walk(self, host_config, oid): + if oid.startswith("."): + oid = oid[1:] + + if oid.endswith(".*"): + oid_prefix = oid[:-2] + dot_star = True + else: + oid_prefix = oid + dot_star = False + + path = cmk.utils.paths.snmpwalks_dir + "/" + host_config.hostname + + console.vverbose(" Loading %s from %s\n" % (oid, path)) + + rowinfo = [] + + # New implementation: use binary search + def to_bin_string(oid): + try: + return tuple(map(int, oid.strip(".").split("."))) + except: + raise MKGeneralException("Invalid OID %s" % oid) + + def compare_oids(a, b): + aa = to_bin_string(a) + bb = to_bin_string(b) + if len(aa) <= len(bb) and bb[:len(aa)] == aa: + result = 0 + else: + result = cmp(aa, bb) + return result + + if host_config.hostname in _g_walk_cache: + lines = _g_walk_cache[host_config.hostname] + else: + try: + lines = file(path).readlines() + except IOError: + raise MKSNMPError("No snmpwalk file %s" % path) + _g_walk_cache[host_config.hostname] = lines + + begin = 0 + end = len(lines) + hit = None + while end - begin > 0: + current = (begin + end) / 2 + parts = lines[current].split(None, 1) + comp = parts[0] + hit = compare_oids(oid_prefix, comp) + if hit == 0: + break + elif hit == 1: # we are too low + begin = current + 1 + else: + end = current + + if hit != 0: + return [] # not found + + def collect_until(index, direction): + rows = [] + # Handle case, where we run after the end of the lines list + if index >= len(lines): + if direction > 0: + return [] + else: + index -= 1 + while True: + line = lines[index] + parts = line.split(None, 1) + o = parts[0] + if o.startswith('.'): + o = o[1:] + if o == oid or o.startswith(oid_prefix + "."): + if len(parts) > 1: + try: + value = cmk_base.agent_simulator.process(parts[1]) + except: + value = parts[1] # agent simulator missing in precompiled mode + else: + value = "" + # Fix for missing starting oids + rows.append(('.' + o, classic_snmp.strip_snmp_value(value))) + index += direction + if index < 0 or index >= len(lines): + break + else: + break + return rows + + rowinfo = collect_until(current, -1) + rowinfo.reverse() + rowinfo += collect_until(current + 1, 1) + + if dot_star: + return [rowinfo[0]] + + return rowinfo + def walk_for_export(host_config, oid): if config.is_inline_snmp_host(host_config.hostname): @@ -403,7 +503,7 @@ def _get_snmpwalk(host_config, check_plugin_name, oid, fetchoid, column, use_snm if rowinfo is None: if _enforce_stored_walks or config.is_usewalk_host(host_config.hostname): - rowinfo = _get_stored_snmpwalk(host_config.hostname, fetchoid) + rowinfo = StoredWalkSNMPBackend().walk(host_config, fetchoid) else: rowinfo = _perform_snmpwalk(host_config, check_plugin_name, oid, fetchoid) @@ -591,107 +691,6 @@ def _snmpwalk_cache_path(hostname, fetchoid): return os.path.join(cmk.utils.paths.var_dir, "snmp_cache", hostname, fetchoid) -def _get_stored_snmpwalk(hostname, oid): - if oid.startswith("."): - oid = oid[1:] - - if oid.endswith(".*"): - oid_prefix = oid[:-2] - dot_star = True - else: - oid_prefix = oid - dot_star = False - - path = cmk.utils.paths.snmpwalks_dir + "/" + hostname - - console.vverbose(" Loading %s from %s\n" % (oid, path)) - - rowinfo = [] - - # New implementation: use binary search - def to_bin_string(oid): - try: - return tuple(map(int, oid.strip(".").split("."))) - except: - raise MKGeneralException("Invalid OID %s" % oid) - - def compare_oids(a, b): - aa = to_bin_string(a) - bb = to_bin_string(b) - if len(aa) <= len(bb) and bb[:len(aa)] == aa: - result = 0 - else: - result = cmp(aa, bb) - return result - - if hostname in _g_walk_cache: - lines = _g_walk_cache[hostname] - else: - try: - lines = file(path).readlines() - except IOError: - raise MKSNMPError("No snmpwalk file %s" % path) - _g_walk_cache[hostname] = lines - - begin = 0 - end = len(lines) - hit = None - while end - begin > 0: - current = (begin + end) / 2 - parts = lines[current].split(None, 1) - comp = parts[0] - hit = compare_oids(oid_prefix, comp) - if hit == 0: - break - elif hit == 1: # we are too low - begin = current + 1 - else: - end = current - - if hit != 0: - return [] # not found - - def collect_until(index, direction): - rows = [] - # Handle case, where we run after the end of the lines list - if index >= len(lines): - if direction > 0: - return [] - else: - index -= 1 - while True: - line = lines[index] - parts = line.split(None, 1) - o = parts[0] - if o.startswith('.'): - o = o[1:] - if o == oid or o.startswith(oid_prefix + "."): - if len(parts) > 1: - try: - value = cmk_base.agent_simulator.process(parts[1]) - except: - value = parts[1] # agent simulator missing in precompiled mode - else: - value = "" - # Fix for missing starting oids - rows.append(('.' + o, classic_snmp.strip_snmp_value(value))) - index += direction - if index < 0 or index >= len(lines): - break - else: - break - return rows - - rowinfo = collect_until(current, -1) - rowinfo.reverse() - rowinfo += collect_until(current + 1, 1) - - if dot_star: - return [rowinfo[0]] - - return rowinfo - - #. # .--Main modes----------------------------------------------------------. # | __ __ _ _ |
5 years, 4 months
1
0
0
0
Fix snmp test problems
by Lars Michelsen
Module: check_mk Branch: master Commit: 010895dc26ad01d50ad23e2f5ac53fd6ed31a295 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=010895dc26ad01…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Mar 1 11:29:43 2019 +0100 Fix snmp test problems * snmpsimd shebang was too long (128 linux kernel limit). Start command with explicit interpreter. * Improve error handling in case snmpsimd fails on startup Change-Id: I5f1d8ee602c2064a9dadb0835f0c8632d6572299 --- tests/integration/cmk_base/snmp/test_snmp.py | 33 ++++++++++++++++++---------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/tests/integration/cmk_base/snmp/test_snmp.py b/tests/integration/cmk_base/snmp/test_snmp.py index 4de34fe..3a3127b 100644 --- a/tests/integration/cmk_base/snmp/test_snmp.py +++ b/tests/integration/cmk_base/snmp/test_snmp.py @@ -38,15 +38,14 @@ def monkeymodule(request): def snmpsim(site, request, tmp_path_factory): tmp_path = tmp_path_factory.getbasetemp() - cmd = "%s/.venv/bin/snmpsimd.py" % cmk_path() + snmpsimd_path = "%s/.venv/bin/snmpsimd.py" % cmk_path() source_data_dir = Path(request.fspath.dirname) / "snmp_data" log.set_verbosity(2) debug.enable() - - p = subprocess.Popen( - [ - cmd, + cmd = [ + "%s/.venv/bin/python" % cmk_path() + snmpsimd_path, #"--log-level=error", "--cache-dir", str(tmp_path / "snmpsim"), @@ -59,7 +58,9 @@ def snmpsim(site, request, tmp_path_factory): "--v3-user=authOnlyUser", "--v3-auth-key=authOnlyUser", "--v3-auth-proto=MD5", - ], + ] + + p = subprocess.Popen(cmd, close_fds=True, # Silence the very noisy output. May be useful to enable this for debugging tests #stdout=open(os.devnull, "w"), @@ -82,13 +83,21 @@ def snmpsim(site, request, tmp_path_factory): # Ensure that snmpsim is ready for clients before starting with the tests def is_listening(): + if p.poll() is not None: + raise Exception("snmpsimd died. Exit code: %d" % p.poll()) + num_sockets = 0 - for e in os.listdir("/proc/%d/fd" % p.pid): - try: - if os.readlink("/proc/%d/fd/%s" % (p.pid, e)).startswith("socket:"): - num_sockets += 1 - except OSError: - pass + try: + for e in os.listdir("/proc/%d/fd" % p.pid): + try: + if os.readlink("/proc/%d/fd/%s" % (p.pid, e)).startswith("socket:"): + num_sockets += 1 + except OSError: + pass + except OSError: + if p.poll() is None: + raise + raise Exception("snmpsimd died. Exit code: %d" % p.poll()) if num_sockets < 2: return False
5 years, 4 months
1
0
0
0
Fixed syntax error
by Lars Michelsen
Module: check_mk Branch: master Commit: 43c85a7ddbf259d03280b4939351f9ff09255cd5 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=43c85a7ddbf259…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Mar 1 11:48:40 2019 +0100 Fixed syntax error Change-Id: I196d96c496c8fa8288e7672b85e16b864b090741 --- tests/integration/cmk_base/snmp/test_snmp.py | 36 +++++++++++++++------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/tests/integration/cmk_base/snmp/test_snmp.py b/tests/integration/cmk_base/snmp/test_snmp.py index 3a3127b..67a32e1 100644 --- a/tests/integration/cmk_base/snmp/test_snmp.py +++ b/tests/integration/cmk_base/snmp/test_snmp.py @@ -1,3 +1,4 @@ +# pylint: disable=redefined-outer-name import subprocess import logging import os @@ -44,23 +45,24 @@ def snmpsim(site, request, tmp_path_factory): log.set_verbosity(2) debug.enable() cmd = [ - "%s/.venv/bin/python" % cmk_path() - snmpsimd_path, - #"--log-level=error", - "--cache-dir", - str(tmp_path / "snmpsim"), - "--data-dir", - str(source_data_dir), - # TODO: Fix port allocation to prevent problems with parallel tests - #"--agent-unix-endpoint=" - "--agent-udpv4-endpoint=127.0.0.1:1337", - "--agent-udpv6-endpoint=[::1]:1337", - "--v3-user=authOnlyUser", - "--v3-auth-key=authOnlyUser", - "--v3-auth-proto=MD5", - ] - - p = subprocess.Popen(cmd, + "%s/.venv/bin/python" % cmk_path(), + snmpsimd_path, + #"--log-level=error", + "--cache-dir", + str(tmp_path / "snmpsim"), + "--data-dir", + str(source_data_dir), + # TODO: Fix port allocation to prevent problems with parallel tests + #"--agent-unix-endpoint=" + "--agent-udpv4-endpoint=127.0.0.1:1337", + "--agent-udpv6-endpoint=[::1]:1337", + "--v3-user=authOnlyUser", + "--v3-auth-key=authOnlyUser", + "--v3-auth-proto=MD5", + ] + + p = subprocess.Popen( + cmd, close_fds=True, # Silence the very noisy output. May be useful to enable this for debugging tests #stdout=open(os.devnull, "w"),
5 years, 4 months
1
0
0
0
ucs_c_rack_server: consider model in agent output
by Florian Kromer
Module: check_mk Branch: master Commit: 79e3f0657a5ec29f19ef6a99369231518757e48f URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=79e3f0657a5ec2…
Author: Florian Kromer <fk(a)mathias-kettner.de> Date: Thu Feb 28 17:47:35 2019 +0100 ucs_c_rack_server: consider model in agent output Change-Id: I6e1e237c05da554aa312539a2bda674d23ba686a --- checks/ucs_c_rack_server_fans | 4 ++-- tests/unit/checks/generictests/datasets/ucs_c_rack_server_fans.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/checks/ucs_c_rack_server_fans b/checks/ucs_c_rack_server_fans index d8ad8f5..ae7f66a 100644 --- a/checks/ucs_c_rack_server_fans +++ b/checks/ucs_c_rack_server_fans @@ -26,7 +26,7 @@ # exemplary agent output (separator is <TAB> and is tabulator): # <<<ucs_c_rack_server_fans:sep(9)>>> -# equipmentFan<TAB>dn sys/rack-unit-1/fan-module-1-1/fan-1<TAB>id 1<TAB>operability operable +# equipmentFan<TAB>dn sys/rack-unit-1/fan-module-1-1/fan-1<TAB>id 1<TAB>model <TAB>operability operable def parse_ucs_c_rack_server_fans(info): @@ -39,7 +39,7 @@ def parse_ucs_c_rack_server_fans(info): "").replace("rack-unit-", "Rack Unit ").replace( "/fan-module-", " Module ").replace( "/fan-", " ") - parsed[fan] = {'operability': key_value_pairs[2][1]} + parsed[fan] = {'operability': key_value_pairs[3][1]} except (IndexError, ValueError): pass diff --git a/tests/unit/checks/generictests/datasets/ucs_c_rack_server_fans.py b/tests/unit/checks/generictests/datasets/ucs_c_rack_server_fans.py index c09c517..1d9bd04 100644 --- a/tests/unit/checks/generictests/datasets/ucs_c_rack_server_fans.py +++ b/tests/unit/checks/generictests/datasets/ucs_c_rack_server_fans.py @@ -6,22 +6,27 @@ checkname = 'ucs_c_rack_server_fans' info = [['equipmentFan', 'dn sys/rack-unit-1/fan-module-1-1/fan-1', 'id 1', + 'model ', 'operability operable'], ['equipmentFan', 'dn sys/rack-unit-1/fan-module-1-1/fan-2', 'id 2', + 'model ', 'operability operable'], ['equipmentFan', 'dn sys/rack-unit-2/fan-module-1-1/fan-1', 'id 1', + 'model ', 'operability operable'], ['equipmentFan', 'dn sys/rack-unit-2/fan-module-1-1/fan-2', 'id 2', + 'model ', 'operability bla'], ['equipmentFan', 'dn sys/rack-unit-2/fan-module-1-1/fan-3', 'id 3', + 'model ', 'operability blub']]
5 years, 4 months
1
0
0
0
Fix bug in recent commit
by Lars Michelsen
Module: check_mk Branch: master Commit: 249ad0da76ba60e80bc3b886e68c1afd01238072 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=249ad0da76ba60…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Mar 1 10:34:53 2019 +0100 Fix bug in recent commit Change-Id: I92c5eca26833fdec461bde8bd5d82a96473282b4 --- pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index 501ac70..915adc5 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,7 +3,7 @@ testpaths = tests # -p no:cacheprovider -> Disable caching. This is needed to make the # integration tests work which are executed as site user. # --durations=10: Show the 10 slowest tests -addopts = -p no:stepwise -p no:cacheprovider -r -v --maxfail=1 --durations=10 +addopts = -p no:stepwise -p no:cacheprovider -rs -v --maxfail=1 --durations=10 # Register some markers to classify the tests # TODO: Are they used? Clean them up markers =
5 years, 4 months
1
0
0
0
pytest: Do not print out captured outputs by default
by Lars Michelsen
Module: check_mk Branch: master Commit: bed0408d82f6a88ff8f9be589ba45a4ed2988f0d URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bed0408d82f6a8…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Mar 1 09:55:15 2019 +0100 pytest: Do not print out captured outputs by default Change-Id: Ided548215e29c8ba0df4941a9ad844293af52fe2 --- pytest.ini | 2 +- tests/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pytest.ini b/pytest.ini index 915adc5..501ac70 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,7 +3,7 @@ testpaths = tests # -p no:cacheprovider -> Disable caching. This is needed to make the # integration tests work which are executed as site user. # --durations=10: Show the 10 slowest tests -addopts = -p no:stepwise -p no:cacheprovider -rs -v --maxfail=1 --durations=10 +addopts = -p no:stepwise -p no:cacheprovider -r -v --maxfail=1 --durations=10 # Register some markers to classify the tests # TODO: Are they used? Clean them up markers = diff --git a/tests/Makefile b/tests/Makefile index 00b701d..9f376ba 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -4,7 +4,7 @@ NODE_MODULES := ../node_modules PIPENV := PIPENV_VENV_IN_PROJECT=true pipenv BANDIT := $(PIPENV) run bandit COVERAGE := $(PIPENV) run coverage -PYTEST := $(PIPENV) run py.test -s -vv +PYTEST := $(PIPENV) run py.test -vv YAPF := $(PIPENV) run yapf .PHONY: help pipenv-check test-bandit test-docker test-format-python \
5 years, 4 months
1
0
0
0
Capture pretty verbose outpu produced by tests
by Lars Michelsen
Module: check_mk Branch: master Commit: 8936ec32bec68e87cbf456d953b48799e8629858 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8936ec32bec68e…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Mar 1 09:49:36 2019 +0100 Capture pretty verbose outpu produced by tests Change-Id: I00fa1396f65fefe22aa8b5c41146517723ddc290 --- tests/integration/cmk_base/test_data_sources.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/integration/cmk_base/test_data_sources.py b/tests/integration/cmk_base/test_data_sources.py index a6e1aa6..e1a4401 100644 --- a/tests/integration/cmk_base/test_data_sources.py +++ b/tests/integration/cmk_base/test_data_sources.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# pylint: disable=redefined-outer-name # These tests verify the behaviour of the Check_MK base methods # that do the actual checking/discovery/inventory work. Especially # the default caching and handling of global options affecting the @@ -319,28 +320,31 @@ def test_mode_check_explicit_host_no_cache(test_cfg, monkeypatch): assert _counter_run == 2 -def test_mode_dump_agent_explicit_host(test_cfg, monkeypatch): +def test_mode_dump_agent_explicit_host(test_cfg, monkeypatch, capsys): _patch_data_source_run(monkeypatch) cmk_base.modes.check_mk.mode_dump_agent("ds-test-host1") assert _counter_run == 2 + assert "<<<check_mk>>>" in capsys.readouterr().out -def test_mode_dump_agent_explicit_host_cache(test_cfg, monkeypatch): +def test_mode_dump_agent_explicit_host_cache(test_cfg, monkeypatch, capsys): try: _patch_data_source_run(monkeypatch, _may_use_cache_file=True, _use_outdated_cache_file=True) cmk_base.modes.check_mk.option_cache() cmk_base.modes.check_mk.mode_dump_agent("ds-test-host1") assert _counter_run == 2 + assert "<<<check_mk>>>" in capsys.readouterr().out finally: # TODO: Can't the mode clean this up on it's own? cmk_base.data_sources.abstract.DataSource.set_use_outdated_cache_file(False) -def test_mode_dump_agent_explicit_host_no_cache(test_cfg, monkeypatch): +def test_mode_dump_agent_explicit_host_no_cache(test_cfg, monkeypatch, capsys): _patch_data_source_run(monkeypatch, _no_cache=True, _max_cachefile_age=0) cmk_base.modes.check_mk.option_no_cache() # --no-cache cmk_base.modes.check_mk.mode_dump_agent("ds-test-host1") assert _counter_run == 2 + assert "<<<check_mk>>>" in capsys.readouterr().out @pytest.mark.parametrize(("scan"), [
5 years, 4 months
1
0
0
0
Disable test for teh moment
by Lars Michelsen
Module: check_mk Branch: master Commit: 42aaf4525c107377c718e8370937eb9e90b3013b URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=42aaf4525c1073…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Mar 1 09:27:48 2019 +0100 Disable test for teh moment Change-Id: I26cbc92b28867061136d300cace9d96c4b100abe --- tests/integration/cmk_base/test_services_prediction.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integration/cmk_base/test_services_prediction.py b/tests/integration/cmk_base/test_services_prediction.py index c7a7ff9..0146868 100644 --- a/tests/integration/cmk_base/test_services_prediction.py +++ b/tests/integration/cmk_base/test_services_prediction.py @@ -74,6 +74,7 @@ def test_get_rrd_data(cfg_setup, date, period, result): assert (step, len(data)) == result +(a)pytest.mark.xfail @pytest.mark.parametrize('now, params', [ (1543503360.0, { 'period': 'wday',
5 years, 4 months
1
0
0
0
Fixed missing information in error message
by Lars Michelsen
Module: check_mk Branch: master Commit: 221214d592e4c0457890ede54af34decad0fc177 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=221214d592e4c0…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Mar 1 07:50:21 2019 +0100 Fixed missing information in error message Change-Id: Idd2b0f7a871b5a618d37d20fac318aa9a4d5be79 --- cmk/gui/wato/pages/services.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmk/gui/wato/pages/services.py b/cmk/gui/wato/pages/services.py index 0d797b3..fa26e1b 100644 --- a/cmk/gui/wato/pages/services.py +++ b/cmk/gui/wato/pages/services.py @@ -348,7 +348,7 @@ class AutomationServiceDiscoveryJob(AutomationCommand): _("Host %s does not exist on remote site %s. This " "may be caused by a failed configuration synchronization. Have a look at " "the <a href=\"wato.py?folder=&mode=changelog\">activate changes page</a> " - "for further information.")) + "for further information.") % (host_name, config.omd_site())) host.need_permission("read") options = json.loads(html.get_ascii_input("options"))
5 years, 4 months
1
0
0
0
← Newer
1
...
42
43
44
45
46
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Results per page:
10
25
50
100
200