From c6abf11e021ded0592bd6697040bde93cf64b022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20K=C3=A4stle?= Date: Mon, 28 Aug 2023 09:58:27 +0200 Subject: Enhance regex in test to be more tolerant to follow up text diff --git a/plugins/t/check_snmp.t b/plugins/t/check_snmp.t index 7d5abc2..576cc50 100644 --- a/plugins/t/check_snmp.t +++ b/plugins/t/check_snmp.t @@ -172,5 +172,5 @@ SKIP: { skip "no non invalid host defined", 2 if ( ! $hostname_invalid ); $res = NPTest->testCmd( "./check_snmp -H $hostname_invalid --ignore-mib-parsing-errors -C np_foobar -o system.sysUpTime.0 -w 1: -c 1:"); cmp_ok( $res->return_code, '==', 3, "Exit UNKNOWN with non responsive host" ); - like($res->output, '/External command error: .*(nosuchhost|Name or service not known|Unknown host)/', "String matches invalid host"); + like($res->output, '/External command error: .*(nosuchhost|Name or service not known|Unknown host).*/s', "String matches invalid host"); } -- cgit v0.10-9-g596f