Module: check_mk
Branch: master
Commit: 0059c4dc4a95a941fcc50df2a3b0372df80d3e94
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0059c4dc4a95a9…
Author: Florian Kromer <fk(a)mathias-kettner.de>
Date: Mon Nov 26 14:07:24 2018 +0100
add diskstat regression tests
add known possible info inputs
Change-Id: Ic449a8dfb0469b0797ed6a3e028bedfcb1d921a3
---
.../generictests/datasets/diskstat_extended.py | 115 +++++++++++++++
.../checks/generictests/datasets/diskstat_long.py | 157 +++++++++++++++++++++
2 files changed, 272 insertions(+)
diff --git a/tests/unit/checks/generictests/datasets/diskstat_extended.py
b/tests/unit/checks/generictests/datasets/diskstat_extended.py
new file mode 100644
index 0000000..4159cb3
--- /dev/null
+++ b/tests/unit/checks/generictests/datasets/diskstat_extended.py
@@ -0,0 +1,115 @@
+
+
+checkname = 'diskstat'
+
+
+info = [['node_name', '1338931242'],
+ ['node_name',
+ '8',
+ '0',
+ 'sda',
+ '6142',
+ '327',
+ '219612',
+ '2244',
+ '3190',
+ '6233',
+ '74075',
+ '8206',
+ '0',
+ '6523',
+ '10446'],
+ ['node_name',
+ '8',
+ '1',
+ 'sda1',
+ '226',
+ '0',
+ '27481',
+ '3388',
+ '381',
+ '3',
+ '31472',
+ '35862',
+ '0',
+ '8123',
+ '39260',
+ '0',
+ '0',
+ '0',
+ '0'],
+ ['node_name',
+ '253',
+ '0',
+ 'dm-0',
+ '4579',
+ '0',
+ '181754',
+ '2343',
+ '9249',
+ '0',
+ '73960',
+ '259491',
+ '0',
+ '1208',
+ '261833'],
+ ['node_name',
+ '199',
+ '27000',
+ 'VxVM27000',
+ '131',
+ '0',
+ '990',
+ '61',
+ '11',
+ '0',
+ '21',
+ '29',
+ '0',
+ '89',
+ '90'],
+ ['node_name', '[dmsetup_info]'],
+ ['node_name', 'vg_zwei-lv_home', '253:2',
'vg_zwei', 'lv_home'],
+ ['node_name', 'vg_zwei-lv_swap', '253:1',
'vg_zwei', 'lv_swap'],
+ ['node_name', 'vg_zwei-lv_root', '253:0',
'vg_zwei', 'lv_root'],
+ ['node_name', '[vx_dsk]'],
+ ['node_name', 'c7', '6978',
'/dev/vx/dsk/datadg/lalavol'],
+ ['node_name', 'c7', '6979',
'/dev/vx/dsk/datadg/oravol']]
+
+
+discovery = {'': [('SUMMARY', 'diskstat_default_levels')]}
+
+
+checks = {'': [('SUMMARY',
+ 'default',
+ [(0, 'Utilization: 0.0%', []),
+ (0, 'Read: 0.00 B/s', []),
+ (0, 'Write: 0.00 B/s', []),
+ (0, 'Average Wait: 0.00 ms', []),
+ (0, 'Average Read Wait: 0.00 ms', []),
+ (0, 'Average Write Wait: 0.00 ms', []),
+ (0, 'Latency: 0.00 ms', []),
+ (0, 'Average Queue Length: 0.00', []),
+ (0,
+ '',
+ [('disk_average_read_request_size', 0.0, None, None, None,
None),
+ ('disk_average_read_wait', 0.0, None, None, None, None),
+ ('disk_average_request_size', 0.0, None, None, None, None),
+ ('disk_average_wait', 0.0, None, None, None, None),
+ ('disk_average_write_request_size',
+ 0.0,
+ None,
+ None,
+ None,
+ None),
+ ('disk_average_write_wait', 0.0, None, None, None, None),
+ ('disk_latency', 0.0, None, None, None, None),
+ ('disk_queue_length', 0.0, None, None, None, None),
+ ('disk_read_ios', 0.0, None, None, None, None),
+ ('disk_read_throughput', 0.0, None, None, None, None),
+ ('disk_utilization', 0.0, None, None, None, None),
+ ('disk_write_ios', 0.0, None, None, None, None),
+ ('disk_write_throughput', 0.0, None, None, None, None)])])]}
+
+
+extra_sections = {'': [None]}
\ No newline at end of file
diff --git a/tests/unit/checks/generictests/datasets/diskstat_long.py
b/tests/unit/checks/generictests/datasets/diskstat_long.py
new file mode 100644
index 0000000..2ec11ef
--- /dev/null
+++ b/tests/unit/checks/generictests/datasets/diskstat_long.py
@@ -0,0 +1,157 @@
+
+
+checkname = 'diskstat'
+
+
+info = [['node_name', '1300264105'],
+ ['node_name',
+ '8',
+ '0',
+ 'sda',
+ '111918756',
+ '929875',
+ '3960367050',
+ '349083041',
+ '20142495',
+ '1149711',
+ '1021234448',
+ '851284769',
+ '0',
+ '233177192',
+ '1197549009',
+ '0',
+ '0',
+ '0',
+ '0'],
+ ['node_name',
+ '8',
+ '1',
+ 'sda1',
+ '226',
+ '0',
+ '27481',
+ '3388',
+ '381',
+ '3',
+ '31472',
+ '35862',
+ '0',
+ '8123',
+ '39260',
+ '0',
+ '0',
+ '0',
+ '0'],
+ ['node_name',
+ '8',
+ '2',
+ 'sda2',
+ '111918500',
+ '929875',
+ '3960337473',
+ '349079568',
+ '201421141149708',
+ '1021202976',
+ '851248906',
+ '0',
+ '233176504',
+ '1197492420',
+ '0',
+ '0',
+ '0',
+ '0'],
+ ['node_name',
+ '253',
+ '0',
+ 'dm-0',
+ '883953',
+ '0',
+ '92124097',
+ '10287533',
+ '108572',
+ '0',
+ '2251672',
+ '809814',
+ '0',
+ '7545567',
+ '11097424',
+ '0',
+ '0',
+ '0',
+ '0'],
+ ['node_name',
+ '253',
+ '1',
+ 'dm-1',
+ '21046',
+ '0',
+ '172072',
+ '157766',
+ '164020',
+ '0',
+ '1312160',
+ '29292970',
+ '0',
+ '124138',
+ '29451007',
+ '0',
+ '0',
+ '0',
+ '0'],
+ ['node_name',
+ '253',
+ '2',
+ 'dm-2',
+ '750714',
+ '0',
+ '19747073',
+ '7702216',
+ '1445987',
+ '0',
+ '36811608',
+ '9817313',
+ '0',
+ '7159271',
+ '17520030',
+ '0',
+ '0',
+ '0',
+ '0']]
+
+
+discovery = {'': [('SUMMARY', 'diskstat_default_levels')]}
+
+
+checks = {'': [('SUMMARY',
+ 'default',
+ [(0, 'Utilization: 0.0%', []),
+ (0, 'Read: 0.00 B/s', []),
+ (0, 'Write: 0.00 B/s', []),
+ (0, 'Average Wait: 0.00 ms', []),
+ (0, 'Average Read Wait: 0.00 ms', []),
+ (0, 'Average Write Wait: 0.00 ms', []),
+ (0, 'Latency: 0.00 ms', []),
+ (0, 'Average Queue Length: 0.00', []),
+ (0,
+ '',
+ [('disk_average_read_request_size', 0.0, None, None, None,
None),
+ ('disk_average_read_wait', 0.0, None, None, None, None),
+ ('disk_average_request_size', 0.0, None, None, None, None),
+ ('disk_average_wait', 0.0, None, None, None, None),
+ ('disk_average_write_request_size',
+ 0.0,
+ None,
+ None,
+ None,
+ None),
+ ('disk_average_write_wait', 0.0, None, None, None, None),
+ ('disk_latency', 0.0, None, None, None, None),
+ ('disk_queue_length', 0.0, None, None, None, None),
+ ('disk_read_ios', 0.0, None, None, None, None),
+ ('disk_read_throughput', 0.0, None, None, None, None),
+ ('disk_utilization', 0.0, None, None, None, None),
+ ('disk_write_ios', 0.0, None, None, None, None),
+ ('disk_write_throughput', 0.0, None, None, None, None)])])]}
+
+
+extra_sections = {'': [None]}
\ No newline at end of file