Module: check_mk
Branch: master
Commit: eda540f98c1ad486d758eae9f65128e259496c26
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eda540f98c1ad4…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Wed Feb 20 14:29:57 2019 +0100
raritan_pdu_*: add some regression tests
Change-Id: Id33caebd546e8c4485e904fa278ccae6ffa52632
---
.../datasets/raritan_pdu_ocprot_regression.py | 63 ++++++++++++++++++++++
.../datasets/raritan_pdu_outletcount_regression.py | 16 ++++++
.../datasets/raritan_pdu_plugs_regression.py | 22 ++++++++
3 files changed, 101 insertions(+)
diff --git a/tests/unit/checks/generictests/datasets/raritan_pdu_ocprot_regression.py
b/tests/unit/checks/generictests/datasets/raritan_pdu_ocprot_regression.py
new file mode 100644
index 0000000..ee4cb2c
--- /dev/null
+++ b/tests/unit/checks/generictests/datasets/raritan_pdu_ocprot_regression.py
@@ -0,0 +1,63 @@
+
+
+checkname = 'raritan_pdu_ocprot'
+
+
+info = [[[u'1.1.1', u'4', u'0'],
+ [u'1.1.15', u'1', u'0'],
+ [u'1.2.1', u'4', u'0'],
+ [u'1.2.15', u'1', u'0'],
+ [u'1.3.1', u'4', u'70'],
+ [u'1.3.15', u'1', u'0'],
+ [u'1.4.1', u'4', u'0'],
+ [u'1.4.15', u'1', u'0'],
+ [u'1.5.1', u'4', u'0'],
+ [u'1.5.15', u'1', u'0'],
+ [u'1.6.1', u'4', u'0'],
+ [u'1.6.15', u'1', u'0']],
+ [[u'1'],
+ [u'0'],
+ [u'1'],
+ [u'0'],
+ [u'1'],
+ [u'0'],
+ [u'1'],
+ [u'0'],
+ [u'1'],
+ [u'0'],
+ [u'1'],
+ [u'0']]]
+
+
+discovery = {'': [(u'C1',
'raritan_pdu_ocprot_current_default_levels'),
+ (u'C2', 'raritan_pdu_ocprot_current_default_levels'),
+ (u'C3', 'raritan_pdu_ocprot_current_default_levels'),
+ (u'C4', 'raritan_pdu_ocprot_current_default_levels'),
+ (u'C5', 'raritan_pdu_ocprot_current_default_levels'),
+ (u'C6', 'raritan_pdu_ocprot_current_default_levels')]}
+
+
+checks = {'': [(u'C1',
+ (14.0, 15.0),
+ [(0, 'Overcurrent protector is closed', []),
+ (0, 'Current: 0.0 A', [('current', 0.0, 14.0, 15.0,
None, None)])]),
+ (u'C2',
+ (14.0, 15.0),
+ [(0, 'Overcurrent protector is closed', []),
+ (0, 'Current: 0.0 A', [('current', 0.0, 14.0, 15.0,
None, None)])]),
+ (u'C3',
+ (14.0, 15.0),
+ [(0, 'Overcurrent protector is closed', []),
+ (0, 'Current: 7.0 A', [('current', 7.0, 14.0, 15.0,
None, None)])]),
+ (u'C4',
+ (14.0, 15.0),
+ [(0, 'Overcurrent protector is closed', []),
+ (0, 'Current: 0.0 A', [('current', 0.0, 14.0, 15.0,
None, None)])]),
+ (u'C5',
+ (14.0, 15.0),
+ [(0, 'Overcurrent protector is closed', []),
+ (0, 'Current: 0.0 A', [('current', 0.0, 14.0, 15.0,
None, None)])]),
+ (u'C6',
+ (14.0, 15.0),
+ [(0, 'Overcurrent protector is closed', []),
+ (0, 'Current: 0.0 A', [('current', 0.0, 14.0, 15.0,
None, None)])])]}
\ No newline at end of file
diff --git a/tests/unit/checks/generictests/datasets/raritan_pdu_outletcount_regression.py
b/tests/unit/checks/generictests/datasets/raritan_pdu_outletcount_regression.py
new file mode 100644
index 0000000..f2f581c
--- /dev/null
+++ b/tests/unit/checks/generictests/datasets/raritan_pdu_outletcount_regression.py
@@ -0,0 +1,16 @@
+
+
+checkname = 'raritan_pdu_outletcount'
+
+
+info = [['36']]
+
+
+discovery = {'': [(None, None)]}
+
+
+checks = {'': [(None,
+ {},
+ [(0,
+ 'Outlet Count is 36',
+ [('outletcount', 36, None, None, 0, None)])])]}
\ No newline at end of file
diff --git a/tests/unit/checks/generictests/datasets/raritan_pdu_plugs_regression.py
b/tests/unit/checks/generictests/datasets/raritan_pdu_plugs_regression.py
new file mode 100644
index 0000000..cfda104
--- /dev/null
+++ b/tests/unit/checks/generictests/datasets/raritan_pdu_plugs_regression.py
@@ -0,0 +1,22 @@
+
+
+checkname = 'raritan_pdu_plugs'
+
+
+info = [[u'1', u'', u'7'],
+ [u'36', u'FooName', u'7']]
+
+
+discovery = {'': [(u'1', 7),
+ (u'36', 7),
+ ]}
+
+
+checks = {
+ '': [
+ (u'1', 7, [(0, u'Status: on', [])]),
+ (u'36', 7, [(0, u'FooName, Status: on', [])]),
+ (u'1', 'on', [(0, u'Status: on', [])]),
+ (u'36', 5, [(2, u'FooName, Status: on', [])]),
+ ]
+}