Module: check_mk
Branch: master
Commit: f8b5d21912f9792150dba53d3aef05a9c0168b87
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f8b5d21912f979…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Fri Jan 19 14:50:24 2018 +0100
Basic test for kernel.util
Change-Id: I3e4118dd892cb20bd3c6f89ecea8c2b53b0d6ddf
---
tests/checks/test_kernel_check.py | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/tests/checks/test_kernel_check.py b/tests/checks/test_kernel_check.py
new file mode 100644
index 0000000..f8c495b
--- /dev/null
+++ b/tests/checks/test_kernel_check.py
@@ -0,0 +1,19 @@
+import pytest
+import pprint
+from cmk_base.check_api import MKCounterWrapped
+import checktestlib
+
+pytestmark = pytest.mark.checks
+
+
+(a)pytest.mark.parametrize("time_to_info,params,predicate"cate", [
+(lambda t: [["cpu", 15*t, 10*t, 5*t, 5*t, 5*t, 5*t, 5*t]], {}, lambda cr:
True),
+])
+def test_kernel_util_check(check_manager, monkeypatch, time_to_info, params, predicate):
+ check = check_manager.get_check("kernel.util")
+ try:
+ list(check.run_check(None, params, time_to_info(0)))
+ except MKCounterWrapped:
+ pass
+ result = checktestlib.CheckResult(check.run_check(None, params, time_to_info(60)))
+ assert predicate(result)