diff options
author | Matthew Kent <mattkent@users.sourceforge.net> | 2004-11-25 05:06:25 +0000 |
---|---|---|
committer | Matthew Kent <mattkent@users.sourceforge.net> | 2004-11-25 05:06:25 +0000 |
commit | 9fb440a991c532c7df026e7f83c5d0150ed3b5a9 (patch) | |
tree | 1e626217cf8665a90e7ff289d76f48958e56ea14 /plugins/t | |
parent | aac4f4539b0cf7a1f285b3c271ba7f253f9889a8 (diff) | |
download | monitoring-plugins-9fb440a991c532c7df026e7f83c5d0150ed3b5a9.tar.gz |
Updating test harness
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@942 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/t')
-rw-r--r-- | plugins/t/check_dns.t | 5 | ||||
-rw-r--r-- | plugins/t/check_http.t | 4 | ||||
-rw-r--r-- | plugins/t/check_load.t | 4 | ||||
-rw-r--r-- | plugins/t/check_mysql.t | 11 |
4 files changed, 13 insertions, 11 deletions
diff --git a/plugins/t/check_dns.t b/plugins/t/check_dns.t index a85e2e76..bee1d34b 100644 --- a/plugins/t/check_dns.t +++ b/plugins/t/check_dns.t @@ -14,11 +14,10 @@ my $cmd; my $str; my $t; -$cmd = "./check_dns 127.0.0.1 -to 5"; -$str = `$cmd`; +$str = `./check_dns $Cache::dnshost -to 5`; $t += ok $?>>8,0; print "Test was: $cmd\n" if ($?); -$t += ok $str, '/DNS ok - +[\.0-9]+ seconds response time, Address\(es\) is\/are /'; +$t += ok $str, '/DNS OK: +[\.0-9]+ seconds response time, /'; $cmd = "./check_dns $Cache::nullhost -to 1"; $str = `$cmd`; diff --git a/plugins/t/check_http.t b/plugins/t/check_http.t index 0c71794f..5be549ad 100644 --- a/plugins/t/check_http.t +++ b/plugins/t/check_http.t @@ -11,9 +11,9 @@ my $null = ''; my $str; my $t; -$str = `./check_http $Cache::hostname -wt 300 -ct 600`; +$str = `./check_http $Cache::httphost -wt 300 -ct 600`; $t += ok $?>>8,0; -$t += ok $str, '/(HTTP\s[o|O][k|K]\s)?\s?HTTP\/1.[01]\s[0-9]{3}\s(OK|Found)\s-\s+([0-9]+|[0-9]+\.[0-9]+)\ssecond response time/'; +$t += ok $str, '/(HTTP\s[o|O][k|K]\s)?\s?HTTP\/1.[01]\s[0-9]{3}\s(OK|Found)\s-\s+[0-9]+\sbytes\sin\s+([0-9]+|[0-9]+\.[0-9]+)\sseconds/'; $str = `./check_http $Cache::nullhost -wt 1 -ct 2`; $t += ok $?>>8,2; diff --git a/plugins/t/check_load.t b/plugins/t/check_load.t index fce168fc..414e09d6 100644 --- a/plugins/t/check_load.t +++ b/plugins/t/check_load.t @@ -15,13 +15,13 @@ $cmd = "./check_load -w 100,100,100 -c 100,100,100"; $str = `$cmd`; $t += ok $?>>8,0; print "Test was: $cmd\n" if ($?); -$t += ok $str, '/^OK - load average: [0-9]\.?[0-9]+, [0-9]\.?[0-9]+, [0-9]\.?[0-9]+$/'; +$t += ok $str, '/^OK - load average: [0-9]\.?[0-9]+, [0-9]\.?[0-9]+, [0-9]\.?[0-9]+/'; $cmd = "./check_load -w 0,0,0 -c 0,0,0"; $str = `$cmd`; $t += ok $?>>8,2; print "Test was: $cmd\n" unless ($?); -$t += ok $str, '/^CRITICAL - load average: [0-9]\.?[0-9]+, [0-9]\.?[0-9]+, [0-9]\.?[0-9]+$/'; +$t += ok $str, '/^CRITICAL - load average: [0-9]\.?[0-9]+, [0-9]\.?[0-9]+, [0-9]\.?[0-9]+/'; exit(0) if defined($Test::Harness::VERSION); exit($tests - $t); diff --git a/plugins/t/check_mysql.t b/plugins/t/check_mysql.t index ae2a0087..0fae65fe 100644 --- a/plugins/t/check_mysql.t +++ b/plugins/t/check_mysql.t @@ -1,11 +1,12 @@ #! /usr/bin/perl -w use strict; +use Helper; use Cache; use Test; use vars qw($tests); -BEGIN {$tests = 1; plan tests => $tests} +BEGIN {$tests = 2; plan tests => $tests} exit(0) unless (-x "./check_mysql"); @@ -14,10 +15,12 @@ my $cmd; my $str; my $t; -$cmd = "./check_mysql -H 127.0.0.1 -P 3306"; +my $mysqlserver = get_option("mysqlserver","host for MYSQL tests"); + +$cmd = "./check_mysql -H $mysqlserver -P 3306"; $str = `$cmd`; -$t += ok $?>>8,0; -print "Test was: $cmd\n" if ($?); +$t += ok $?>>8,2; +$t += ok $str, '/Access denied for user: /'; exit(0) if defined($Test::Harness::VERSION); exit($tests - $t); |