[Nagiosplug-checkins] nagiosplug/plugins/t check_dns.t,1.1.1.1,1.2 check_http.t,1.2,1.3 check_load.t,1.2,1.3 check_mysql.t,1.1.1.1,1.2
Matthew Kent
mattkent at users.sourceforge.net
Wed Nov 24 21:07:13 CET 2004
Update of /cvsroot/nagiosplug/nagiosplug/plugins/t
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27374/plugins/t
Modified Files:
check_dns.t check_http.t check_load.t check_mysql.t
Log Message:
Updating test harness
Index: check_mysql.t
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/t/check_mysql.t,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- check_mysql.t 28 Feb 2002 06:43:00 -0000 1.1.1.1
+++ check_mysql.t 25 Nov 2004 05:06:25 -0000 1.2
@@ -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 $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);
Index: check_http.t
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/t/check_http.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- check_http.t 17 May 2003 17:40:15 -0000 1.2
+++ check_http.t 25 Nov 2004 05:06:25 -0000 1.3
@@ -11,9 +11,9 @@
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;
Index: check_load.t
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/t/check_load.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- check_load.t 17 May 2003 17:59:13 -0000 1.2
+++ check_load.t 25 Nov 2004 05:06:25 -0000 1.3
@@ -15,13 +15,13 @@
$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);
Index: check_dns.t
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/t/check_dns.t,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- check_dns.t 28 Feb 2002 06:43:00 -0000 1.1.1.1
+++ check_dns.t 25 Nov 2004 05:06:25 -0000 1.2
@@ -14,11 +14,10 @@
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`;
More information about the Commits
mailing list