From 93901d5ff10cd7fd915cc09d7c496cec49f82ce5 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Fri, 13 Jun 2014 14:20:14 +0200 Subject: tests: fping checks require being root or setuid root on the fping binary. Check this before running the test. Signed-off-by: Sven Nierlein --- plugins/t/check_fping.t | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'plugins/t') diff --git a/plugins/t/check_fping.t b/plugins/t/check_fping.t index 45a9be8a..08692e46 100644 --- a/plugins/t/check_fping.t +++ b/plugins/t/check_fping.t @@ -27,16 +27,18 @@ my $hostname_invalid = getTestParameter( "hostname_invalid", "NP_HOSTNAME_IN my $t; -if ( -x "./check_fping" ) -{ +my $fping = qx(which fping 2> /dev/null); +chomp($fping); +if( ! -x "./check_fping") { + $t += skipMissingCmd( "./check_fping", $tests ); +} +elsif ( $> != 0 && (!$fping || ! -u $fping)) { + $t += skipMsg( "./check_fping", $tests ); +} else { $t += checkCmd( "./check_fping $host_responsive", 0, $successOutput ); $t += checkCmd( "./check_fping $host_nonresponsive", [ 1, 2 ] ); $t += checkCmd( "./check_fping $hostname_invalid", [ 1, 2 ] ); } -else -{ - $t += skipMissingCmd( "./check_fping", $tests ); -} exit(0) if defined($Test::Harness::VERSION); exit($tests - $t); -- cgit v1.2.3-74-g34f1 From b35d12e931c6d330291f5c5f4847c33a122c63cb Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Tue, 24 Jun 2014 15:07:44 +0200 Subject: tests: always build and test on travis also make test is now working on travis-ci Signed-off-by: Sven Nierlein --- .travis.yml | 12 +++++++++- plugins/t/NPTest.cache.travis | 54 +++++++++++++++++++++++++++++++++++++++++++ plugins/t/check_ntp.t | 10 ++++---- plugins/t/check_snmp.t | 2 +- plugins/t/check_udp.t | 2 +- 5 files changed, 72 insertions(+), 8 deletions(-) create mode 100644 plugins/t/NPTest.cache.travis (limited to 'plugins/t') diff --git a/.travis.yml b/.travis.yml index 7a4c3c62..02fa084e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,14 +6,24 @@ before_install: install: - sudo apt-get install -qq --no-install-recommends perl autotools-dev libdbi-dev libldap2-dev libpq-dev libmysqlclient-dev libradiusclient-ng-dev libkrb5-dev libnet-snmp-perl procps + - sudo apt-get install -qq --no-install-recommends libdbi0-dev libdbd-sqlite3 libssl-dev dnsutils snmp-mibs-downloader + - sudo apt-get install -qq --no-install-recommends fping snmp netcat smbclient fping pure-ftpd apache2 postfix - sudo apt-get install -qq --no-install-recommends autoconf automake before_script: - tools/setup - ./configure + - make + - export NPTEST_CACHE="$(pwd)/plugins/t/NPTest.cache.travis" + - ssh-keygen -t dsa -N "" -f ~/.ssh/id_dsa + - cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys + - ssh-keyscan localhost >> ~/.ssh/known_hosts + - touch ~/.ssh/config + - sudo rm -f /usr/share/mibs/ietf/SNMPv2-PDU /usr/share/mibs/ietf/IPSEC-SPD-MIB /usr/share/mibs/ietf/IPATM-IPMC-MIB /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB + - sudo mkdir -p /var/lib/snmp/mib_indexes script: - - if [ "$COVERITY_SCAN_BRANCH" != 1 ]; then make; fi + - if [ "$COVERITY_SCAN_BRANCH" != 1 ]; then make test; fi notifications: irc: diff --git a/plugins/t/NPTest.cache.travis b/plugins/t/NPTest.cache.travis new file mode 100644 index 00000000..c1007deb --- /dev/null +++ b/plugins/t/NPTest.cache.travis @@ -0,0 +1,54 @@ +{ + 'MYSQL_LOGIN_DETAILS' => '-u root -d test', + 'NP_ALLOW_SUDO' => 'yes', + 'NP_DNS_SERVER' => '8.8.8.8', + 'NP_GOOD_NTP_SERVICE' => '', + 'NP_HOSTNAME_INVALID' => 'nosuchhost', + 'NP_HOSTNAME_VALID' => 'monitoringplugins.org', + 'NP_HOSTNAME_VALID_IP' => '130.133.8.40', + 'NP_HOSTNAME_VALID_REVERSE' => 'orwell.monitoring-plugins.org.', + 'NP_HOST_DHCP_RESPONSIVE' => '', + 'NP_HOST_NONRESPONSIVE' => '10.0.0.1', + 'NP_HOST_RESPONSIVE' => 'localhost', + 'NP_HOST_SMB' => '', + 'NP_HOST_SNMP' => '', + 'NP_HOST_TCP_FTP' => '', + 'NP_HOST_TCP_HPJD' => '', + 'NP_HOST_TCP_HTTP' => 'localhost', + 'NP_HOST_TCP_HTTP2' => 'labs.consol.de', + 'NP_HOST_TCP_IMAP' => 'imap.web.de', + 'NP_HOST_TCP_POP' => 'pop.web.de', + 'NP_HOST_TCP_SMTP' => 'localhost', + 'NP_HOST_TCP_SMTP_NOTLS' => '', + 'NP_HOST_TCP_SMTP_TLS' => '', + 'NP_INTERNET_ACCESS' => 'yes', + 'NP_MOUNTPOINT2_VALID' => '', + 'NP_MOUNTPOINT_VALID' => '/', + 'NP_MYSQL_SERVER' => 'localhost', + 'NP_HOST_UDP_TIME' => 'localhost', + 'NP_MYSQL_SOCKET' => '/var/run/mysqld/mysqld.sock', + 'NP_MYSQL_WITH_SLAVE' => '', + 'NP_MYSQL_WITH_SLAVE_LOGIN' => '', + 'NP_NO_NTP_SERVICE' => 'localhost', + 'NP_SMB_SHARE' => '', + 'NP_SMB_SHARE_DENY' => '', + 'NP_SMB_SHARE_SPC' => '', + 'NP_SMB_VALID_USER' => '', + 'NP_SMB_VALID_USER_PASS' => '', + 'NP_SNMP_COMMUNITY' => '', + 'NP_SSH_CONFIGFILE' => '~/.ssh/config', + 'NP_SSH_HOST' => 'localhost', + 'NP_SSH_IDENTITY' => '~/.ssh/id_dsa', + 'NP_HOST_TCP_JABBER' => 'jabber.org', + 'host_nonresponsive' => '10.0.0.1', + 'host_responsive' => 'localhost', + 'host_snmp' => '', + 'host_tcp_ftp' => '', + 'host_tcp_http' => 'localhost', + 'host_tcp_imap' => 'imap.nierlein.de', + 'host_tcp_smtp' => 'localhost', + 'hostname_invalid' => 'nosuchhost', + 'snmp_community' => '', + 'user_snmp' => '', + 'host_udp_time' => 'none', +} diff --git a/plugins/t/check_ntp.t b/plugins/t/check_ntp.t index 3eee6e17..74d890fa 100644 --- a/plugins/t/check_ntp.t +++ b/plugins/t/check_ntp.t @@ -23,12 +23,12 @@ my $no_ntp_service = getTestParameter( "NP_NO_NTP_SERVICE", "A host NOT providing the NTP service", "localhost" ); -my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE", +my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE", "The hostname of system not responsive to network requests", "10.0.0.1" ); -my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID", - "An invalid (not known to DNS) hostname", +my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID", + "An invalid (not known to DNS) hostname", "nosuchhost"); my $ntp_okmatch1 = '/^NTP\sOK:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs/'; @@ -43,7 +43,7 @@ my $ntp_nosuchhost = '/^check_ntp.*: Invalid hostname/address - ' . $hostname_in foreach my $plugin (@PLUGINS1) { SKIP: { - skip "No NTP server defined", 1 unless $ntp_service; + skip "No NTP server defined", 6 unless $ntp_service; $res = NPTest->testCmd( "./$plugin -H $ntp_service -w 1000 -c 2000" ); @@ -88,7 +88,7 @@ foreach my $plugin (@PLUGINS1) { foreach my $plugin (@PLUGINS2) { SKIP: { - skip "No NTP server defined", 1 unless $ntp_service; + skip "No NTP server defined", 6 unless $ntp_service; $res = NPTest->testCmd( "./$plugin -H $ntp_service -w 1000 -c 2000 -W 20 -C 21 -j 100000 -k 200000 -m 1: -n 0:" ); diff --git a/plugins/t/check_snmp.t b/plugins/t/check_snmp.t index c35d7821..2d6c44a7 100644 --- a/plugins/t/check_snmp.t +++ b/plugins/t/check_snmp.t @@ -45,7 +45,7 @@ is( $res->return_code, 3, "Invalid protocol" ); like( $res->output, "/check_snmp: Invalid SNMP version - 3c/" ); SKIP: { - skip "no snmp host defined", 38 if ( ! $host_snmp ); + skip "no snmp host defined", 48 if ( ! $host_snmp ); $res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o system.sysUpTime.0 -w 1: -c 1:"); cmp_ok( $res->return_code, '==', 0, "Exit OK when querying uptime" ); diff --git a/plugins/t/check_udp.t b/plugins/t/check_udp.t index 619cadfb..1f6fee70 100644 --- a/plugins/t/check_udp.t +++ b/plugins/t/check_udp.t @@ -62,7 +62,7 @@ SKIP: { cmp_ok( $res->return_code, '==', '2', "Hung waiting for response"); like ( $res->output, '/Socket timeout after 5 seconds/', "Timeout message"); like ( $duration, '/^[56]$/', "Timeout after 5 (possibly 6) seconds"); - my $read_nc = ; + my $read_nc = || ''; close NC; cmp_ok( $read_nc, 'eq', "foofoo", "Data received correctly" ); } -- cgit v1.2.3-74-g34f1 From e566021a54c500aa2ee0f17bfe4f95d1fd1be243 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Sat, 28 Jun 2014 22:05:25 +0200 Subject: tests: added check_dns performance data test Signed-off-by: Sven Nierlein --- plugins/t/check_dns.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/t') diff --git a/plugins/t/check_dns.t b/plugins/t/check_dns.t index 2c903db9..4ff553f7 100644 --- a/plugins/t/check_dns.t +++ b/plugins/t/check_dns.t @@ -10,7 +10,7 @@ use NPTest; plan skip_all => "check_dns not compiled" unless (-x "check_dns"); -plan tests => 13; +plan tests => 14; my $successOutput = '/DNS OK: [\.0-9]+ seconds? response time/'; @@ -54,6 +54,7 @@ cmp_ok( $res->return_code, '==', 2, "Critical threshold passed"); $res = NPTest->testCmd("./check_dns -H $hostname_valid -t 5 -w 0 -c 5"); cmp_ok( $res->return_code, '==', 1, "Warning threshold passed"); +like( $res->output, "/\|time=[\d\.]+s;0.0*;5\.0*;0\.0*/", "Output performance data OK" ); $res = NPTest->testCmd("./check_dns -H $hostname_invalid -t 1"); cmp_ok( $res->return_code, '==', 2, "Invalid $hostname_invalid"); -- cgit v1.2.3-74-g34f1 From 4277f47bffb65bafeb9b8e256dd7116ce747e850 Mon Sep 17 00:00:00 2001 From: abrist Date: Mon, 3 Mar 2014 12:42:33 -0500 Subject: check_jabber.t - fixed tests for new status output including hostname --- plugins/t/check_jabber.t | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/t') diff --git a/plugins/t/check_jabber.t b/plugins/t/check_jabber.t index 1aaf8125..7a708d5b 100644 --- a/plugins/t/check_jabber.t +++ b/plugins/t/check_jabber.t @@ -29,7 +29,7 @@ my $hostname_invalid = getTestParameter( ); -my $jabberOK = '/JABBER OK\s-\s\d+\.\d+\ssecond response time on port 5222/'; +my $jabberOK = '/JABBER OK\s-\s\d+\.\d+\ssecond response time on '.$host_tcp_jabber.' port 5222/'; my $jabberUnresponsive = '/CRITICAL\s-\sSocket timeout after\s\d+\sseconds/'; @@ -40,7 +40,7 @@ my $r; SKIP: { skip "No jabber server defined", 6 unless $host_tcp_jabber; - $r = NPTest->testCmd( "./check_jabber $host_tcp_jabber" ); + $r = NPTest->testCmd( "./check_jabber -H $host_tcp_jabber" ); is( $r->return_code, 0, "Connected okay"); like( $r->output, $jabberOK, "Output as expected" ); @@ -48,7 +48,7 @@ SKIP: { is( $r->return_code, 0, "Connected okay, within limits" ); like( $r->output, $jabberOK, "Output as expected" ); - $r = NPTest->testCmd( "./check_jabber $host_tcp_jabber -wt 9 -ct 9 -to 10" ); + $r = NPTest->testCmd( "./check_jabber -H $host_tcp_jabber -wt 9 -ct 9 -to 10" ); is( $r->return_code, 0, "Old syntax okay" ); like( $r->output, $jabberOK, "Output as expected" ); -- cgit v1.2.3-74-g34f1 From f54d10fe9ba202415c2001b1ec7c6eb4697c3d10 Mon Sep 17 00:00:00 2001 From: Mikael Falkvidd Date: Thu, 10 Jul 2014 14:25:23 +0200 Subject: check_procs: Add delay after forking in test Forking raises a race condition, where the parent might run the test before the child has had time to fork. If that happens, an error similar to this is produced: Failed test 'Output correct' at ./t/check_procs.t line 32. 'PROCS OK: 0 processes with args 'sleep 7' | processes=0;;;0;' doesn't match '/^PROCS OK: 1 process?/' Sleeping a bit should avoid the problem. It might be enough to sleep less than a second, but perl's built-in sleep function only supports integer seconds. In our build environment, the build failed 3 of 4 times before this patch. After the patch it failed 0 of 7 times. Signed-off-by: Mikael Falkvidd --- plugins/t/check_procs.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/t') diff --git a/plugins/t/check_procs.t b/plugins/t/check_procs.t index ca4acdd7..abe7284e 100644 --- a/plugins/t/check_procs.t +++ b/plugins/t/check_procs.t @@ -26,7 +26,7 @@ $result = NPTest->testCmd( "./check_procs -w 100000 -c 100000 -s Z" ); is( $result->return_code, 0, "Checking less than 100000 zombie processes" ); like( $result->output, '/^PROCS OK: [0-9]+ process(es)? with /', "Output correct" ); -if(fork() == 0) { exec("sleep 7"); } # fork a test process +if(fork() == 0) { exec("sleep 7"); } else { sleep(1) } # fork a test process in child and give child time to fork in parent $result = NPTest->testCmd( "./check_procs -a 'sleep 7'" ); is( $result->return_code, 0, "Parent process is ignored" ); like( $result->output, '/^PROCS OK: 1 process?/', "Output correct" ); -- cgit v1.2.3-74-g34f1 From 78d00d338a07ab0dd5ff052af96aab13a5ee93ae Mon Sep 17 00:00:00 2001 From: abrist Date: Mon, 3 Mar 2014 12:41:30 -0500 Subject: check_ntp.t - fixed tests for new status output closes #1236 and #1239 --- plugins/t/check_ntp.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/t') diff --git a/plugins/t/check_ntp.t b/plugins/t/check_ntp.t index 74d890fa..b8fc8fdf 100644 --- a/plugins/t/check_ntp.t +++ b/plugins/t/check_ntp.t @@ -35,8 +35,8 @@ my $ntp_okmatch1 = '/^NTP\sOK:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs/' my $ntp_warnmatch1 = '/^NTP\sWARNING:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs/'; my $ntp_critmatch1 = '/^NTP\sCRITICAL:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs/'; my $ntp_okmatch2 = '/^NTP\sOK:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs,\sjitter=[0-9]+\.[0-9]+,\sstratum=[0-9]{1,2},\struechimers=[0-9]+/'; -my $ntp_warnmatch2 = '/^NTP\sWARNING:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs,\sjitter=[0-9]+\.[0-9]+,\sstratum=[0-9]{1,2},\struechimers=[0-9]+/'; -my $ntp_critmatch2 = '/^NTP\sCRITICAL:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs,\sjitter=[0-9]+\.[0-9]+,\sstratum=[0-9]{1,2},\struechimers=[0-9]+/'; +my $ntp_warnmatch2 = '/^NTP\sWARNING:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs,\sjitter=[0-9]+\.[0-9]+,\sstratum=[0-9]{1,2}\s\(WARNING\),\struechimers=[0-9]+/'; +my $ntp_critmatch2 = '/^NTP\sCRITICAL:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs,\sjitter=[0-9]+\.[0-9]+\s\(CRITICAL\),\sstratum=[0-9]{1,2},\struechimers=[0-9]+/'; my $ntp_noresponse = '/^(CRITICAL - Socket timeout after 3 seconds)|(NTP CRITICAL: No response from NTP server)$/'; my $ntp_nosuchhost = '/^check_ntp.*: Invalid hostname/address - ' . $hostname_invalid . '/'; -- cgit v1.2.3-74-g34f1 From 479509ad59cdb05894ab39206157e6dd3f4e7faf Mon Sep 17 00:00:00 2001 From: abrist Date: Mon, 27 Jan 2014 19:06:46 -0500 Subject: added tests for check_hpjd port options --- Closes #1160 and #973 --- plugins/t/check_hpjd.t | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'plugins/t') diff --git a/plugins/t/check_hpjd.t b/plugins/t/check_hpjd.t index 10ded54a..4d64852a 100644 --- a/plugins/t/check_hpjd.t +++ b/plugins/t/check_hpjd.t @@ -10,7 +10,6 @@ use NPTest; plan skip_all => "check_hpjd not compiled" unless (-x "check_hpjd"); -plan tests => 5; my $successOutput = '/^Printer ok - /'; my $failureOutput = '/Timeout: No [Rr]esponse from /'; @@ -20,31 +19,53 @@ my $host_tcp_hpjd = getTestParameter( "A host (usually a printer) providing the HP-JetDirect Services" ); +my $host_hpjd_port_invalid = getTestParameter( + "NP_HOST_HPJD_PORT_INVALID", + "A port that HP-JetDirect Services is not listening on", + "162" + ); + +my $host_hpjd_port_valid = getTestParameter( + "NP_HOST_HPJD_PORT_VALID", + "The port that HP-JetDirect Services is currently listening on", + "161" + ); + my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE", "The hostname of system not responsive to network requests", - "10.0.0.1", + "10.0.0.1" ); my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID", "An invalid (not known to DNS) hostname", - "nosuchhost", + "nosuchhost" ); +my $tests = $host_tcp_hpjd ? 9 : 5; +plan tests => $tests; my $res; SKIP: { skip "No HP JetDirect defined", 2 unless $host_tcp_hpjd; - $res = NPTest->testCmd("./check_hpjd $host_tcp_hpjd"); - cmp_ok( $res->return_code, '==', 0, "Jetdirect responding" ); + $res = NPTest->testCmd("./check_hpjd -H $host_tcp_hpjd"); + cmp_ok( $res->return_code, 'eq', 0, "Jetdirect responding" ); like ( $res->output, $successOutput, "Output correct" ); + + $res = NPTest->testCmd("./check_hpjd -H $host_tcp_hpjd -p $host_hpjd_port_valid"); + cmp_ok( $res->return_code, 'eq', 0, "Jetdirect responding on port $host_hpjd_port_valid" ); + like ( $res->output, $successOutput, "Output correct" ); + + $res = NPTest->testCmd("./check_hpjd -H $host_tcp_hpjd -p $host_hpjd_port_invalid"); + cmp_ok( $res->return_code, 'eq', 2, "Jetdirect not responding on port $host_hpjd_port_invalid" ); + like ( $res->output, $failureOutput, "Output correct" ); } -$res = NPTest->testCmd("./check_hpjd $host_nonresponsive"); +$res = NPTest->testCmd("./check_hpjd -H $host_nonresponsive"); cmp_ok( $res->return_code, 'eq', 2, "Host not responding"); like ( $res->output, $failureOutput, "Output OK" ); -$res = NPTest->testCmd("./check_hpjd $hostname_invalid"); +$res = NPTest->testCmd("./check_hpjd -H $hostname_invalid"); cmp_ok( $res->return_code, 'eq', 3, "Hostname invalid"); -- cgit v1.2.3-74-g34f1 From 71063655e558224d692950ac9abaa39e0b7c6585 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Sun, 20 Jul 2014 16:12:30 +0200 Subject: travis-ci: Adding ports for check_hpjd --- plugins/t/NPTest.cache.travis | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins/t') diff --git a/plugins/t/NPTest.cache.travis b/plugins/t/NPTest.cache.travis index c1007deb..4ebfb90e 100644 --- a/plugins/t/NPTest.cache.travis +++ b/plugins/t/NPTest.cache.travis @@ -14,6 +14,8 @@ 'NP_HOST_SNMP' => '', 'NP_HOST_TCP_FTP' => '', 'NP_HOST_TCP_HPJD' => '', + 'NP_HOST_HPJD_PORT_INVALID' => '161', + 'NP_HOST_HPJD_PORT_VALID' => '', 'NP_HOST_TCP_HTTP' => 'localhost', 'NP_HOST_TCP_HTTP2' => 'labs.consol.de', 'NP_HOST_TCP_IMAP' => 'imap.web.de', -- cgit v1.2.3-74-g34f1 From c5a64eeef8340ff39fafb21878d92139b4c1fb73 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 21 Jul 2014 13:59:22 +0200 Subject: plugins/t/check_dns.t: Fix Perl warning Perl said: "Unrecognized escape \d passed through at ./t/check_dns.t line 57." --- plugins/t/check_dns.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/t') diff --git a/plugins/t/check_dns.t b/plugins/t/check_dns.t index 4ff553f7..b8858807 100644 --- a/plugins/t/check_dns.t +++ b/plugins/t/check_dns.t @@ -54,7 +54,7 @@ cmp_ok( $res->return_code, '==', 2, "Critical threshold passed"); $res = NPTest->testCmd("./check_dns -H $hostname_valid -t 5 -w 0 -c 5"); cmp_ok( $res->return_code, '==', 1, "Warning threshold passed"); -like( $res->output, "/\|time=[\d\.]+s;0.0*;5\.0*;0\.0*/", "Output performance data OK" ); +like( $res->output, '/\|time=[\d\.]+s;0.0*;5\.0*;0\.0*/', "Output performance data OK" ); $res = NPTest->testCmd("./check_dns -H $hostname_invalid -t 1"); cmp_ok( $res->return_code, '==', 2, "Invalid $hostname_invalid"); -- cgit v1.2.3-74-g34f1