mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-20 21:57:10 -04:00
make snmp tests more reliable
snmp tests fail if the snmp daemon runs systemd, then the process with 1 has arguments. Convert the test into a regex which works for sysv and systemd. Signed-off-by: Sven Nierlein <sven@nierlein.de>
This commit is contained in:
parent
9daeceaed3
commit
b3dee5c4bf
1 changed files with 3 additions and 3 deletions
|
|
@ -154,9 +154,9 @@ SKIP: {
|
|||
cmp_ok( $res->return_code, '==', 0, "Timetick used as a string");
|
||||
like($res->output, '/^SNMP OK - Timeticks:\s\(\d+\)\s+(?:\d+ days?,\s+)?\d+:\d+:\d+\.\d+\s.*$/', "Timetick used as a string, result printed rather than parsed");
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o HOST-RESOURCES-MIB::hrSWRunParameters.1");
|
||||
cmp_ok( $res->return_code, '==', 0, "Timetick used as a string");
|
||||
is( $res->output, 'SNMP OK - "" | ', "snmp response without datatype" );
|
||||
$res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o HOST-RESOURCES-MIB::hrSWRunName.1");
|
||||
cmp_ok( $res->return_code, '==', 0, "snmp response without datatype");
|
||||
like( $res->output, '/^SNMP OK - "(systemd|init)" \| $/', "snmp response without datatype" );
|
||||
}
|
||||
|
||||
SKIP: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue