Module: check_mk
Branch: master
Commit: b2fa43f19297620a778ca44da25cf00cc7d60dcc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b2fa43f1929762…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Fri Dec 14 15:33:08 2018 +0100
Generic tests using dict parameters now have to specify all key value pairs
Change-Id: I59d5755eceba9cb5d5e990d4504656be2b8073a9
---
.../datasets/apc_symmetra_regression.py | 2 +-
.../generictests/datasets/df_lnx_regression.py | 26 ++++++++--------------
tests/unit/checks/generictests/run.py | 3 +--
3 files changed, 11 insertions(+), 20 deletions(-)
diff --git a/tests/unit/checks/generictests/datasets/apc_symmetra_regression.py
b/tests/unit/checks/generictests/datasets/apc_symmetra_regression.py
index 1b670e5..accb558 100644
--- a/tests/unit/checks/generictests/datasets/apc_symmetra_regression.py
+++ b/tests/unit/checks/generictests/datasets/apc_symmetra_regression.py
@@ -29,7 +29,7 @@ checks = {'': [(None,
'Time remaining: 61 m',
[('runtime', 61.0, None, None, None, None)])]),
(None,
- {'battery_replace_state': 2},
+ {'capacity': (95, 80), 'calibration_state': 0,
'battery_replace_state': 2},
[(0, 'Battery status: normal', []),
(2, 'battery needs replacing', []),
(0, 'Output status: on line (calibration invalid)', []),
diff --git a/tests/unit/checks/generictests/datasets/df_lnx_regression.py
b/tests/unit/checks/generictests/datasets/df_lnx_regression.py
index 5d662c7..bfc8c34 100644
--- a/tests/unit/checks/generictests/datasets/df_lnx_regression.py
+++ b/tests/unit/checks/generictests/datasets/df_lnx_regression.py
@@ -1,19 +1,11 @@
-
-
checkname = 'df'
-
-info = [[u'/dev/sda4',
- u'ext4',
- u'143786696',
- u'101645524',
- u'34814148',
- u'75%',
- u'/'],
- [u'[df_inodes_start]'],
- [u'/dev/sda4', u'ext4', u'9142272', u'1654272',
u'7488000', u'19%', u'/'],
- [u'[df_inodes_end]']]
-
+info = [
+ [u'/dev/sda4', u'ext4', u'143786696', u'101645524',
u'34814148', u'75%', u'/'],
+ [u'[df_inodes_start]'],
+ [u'/dev/sda4', u'ext4', u'9142272', u'1654272',
u'7488000', u'19%', u'/'],
+ [u'[df_inodes_end]'],
+]
discovery = {'': [(u'/', {})]}
@@ -42,7 +34,7 @@ checks = {
),
]
),
- (u'/dev/sda4 /', {"subtract_reserved": True,
"show_reserved": True},
+ (u'/dev/sda4 /', {'trend_range': 24, 'show_levels':
'onmagic', 'inodes_levels': (10.0, 5.0), 'magic_normsize': 20,
'show_inodes': 'onlow', 'levels': (80.0, 90.0),
'show_reserved': True, 'subtract_reserved': True, 'levels_low':
(50.0, 60.0), 'trend_perfdata': True,},
[(0, '74.5% used (96.94 of 130.14 GB), additionally reserved for root:
6.99 GB,' \
' trend: 0.00 B / 24 hours',
[(u'/', 99263.20703125, 112333.35625, 126375.02578125, 0,
140416.6953125),
@@ -56,7 +48,7 @@ checks = {
),
]
),
- (u'/', {"show_reserved": True},
+ (u'/', {'trend_range': 24, 'show_levels':
'onmagic', 'inodes_levels': (10.0, 5.0), 'magic_normsize': 20,
'show_inodes': 'onlow', 'levels': (80.0, 90.0),
'show_reserved': True, 'levels_low': (50.0, 60.0),
'trend_perfdata': True},
[(0, '75.8% used (103.92 of 137.13 GB), therein reserved for root: 5.1%
(6.99 GB),' \
' trend: 0.00 B / 24 hours',
[(u'/', 106418.50390625, 112333.35625, 126375.02578125, 0,
140416.6953125),
@@ -69,7 +61,7 @@ checks = {
),
]
),
- (u'/dev/sda4 /', {"show_reserved": True},
+ (u'/dev/sda4 /', {'trend_range': 24, 'show_levels':
'onmagic', 'inodes_levels': (10.0, 5.0), 'magic_normsize': 20,
'show_inodes': 'onlow', 'levels': (80.0, 90.0),
'show_reserved': True, 'levels_low': (50.0, 60.0),
'trend_perfdata': True},
[(0, '75.8% used (103.92 of 137.13 GB), therein reserved for root: 5.1%
(6.99 GB),' \
' trend: 0.00 B / 24 hours',
[(u'/', 106418.50390625, 112333.35625, 126375.02578125, 0,
140416.6953125),
diff --git a/tests/unit/checks/generictests/run.py
b/tests/unit/checks/generictests/run.py
index 9f6c71a..bffcfc6 100644
--- a/tests/unit/checks/generictests/run.py
+++ b/tests/unit/checks/generictests/run.py
@@ -65,8 +65,7 @@ def get_check_merged_parameters(check, provided_p):
if provided_p is None:
return provided_p
if isinstance(provided_p, dict):
- default_p.update(provided_p)
- return default_p
+ return provided_p
if isinstance(provided_p, tuple):
return provided_p
raise DiscoveryParameterTypeError("unhandled: %r/%r" % (default_p,
provided_p))