[Nagiosplug-checkins] nagiosplug/plugins/t check_disk.t,1.12,1.13
Ton Voon
tonvoon at users.sourceforge.net
Thu Oct 12 16:14:50 CEST 2006
Update of /cvsroot/nagiosplug/nagiosplug/plugins/t
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5944/t
Modified Files:
check_disk.t
Log Message:
Remove the "- free space" if status is OK
Index: check_disk.t
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/t/check_disk.t,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- check_disk.t 12 Oct 2006 13:58:43 -0000 1.12
+++ check_disk.t 12 Oct 2006 14:14:48 -0000 1.13
@@ -10,9 +10,9 @@
use NPTest;
use POSIX qw(ceil floor);
-my $successOutput = '/^DISK OK - /';
-my $failureOutput = '/^DISK CRITICAL - /';
-my $warningOutput = '/^DISK WARNING - /';
+my $successOutput = '/^DISK OK/';
+my $failureOutput = '/^DISK CRITICAL/';
+my $warningOutput = '/^DISK WARNING/';
my $result;
@@ -22,7 +22,7 @@
if ($mountpoint_valid eq "" or $mountpoint2_valid eq "") {
plan skip_all => "Need 2 mountpoints to test";
} else {
- plan tests => 39;
+ plan tests => 42;
}
$result = NPTest->testCmd(
@@ -55,6 +55,11 @@
$result = NPTest->testCmd( "./check_disk -w 1 -c 1 -p $more_free" );
cmp_ok( $result->return_code, '==', 0, "At least 1 MB available on $more_free");
like ( $result->output, $successOutput, "OK output" );
+like ( $result->only_output, qr/free space/, "Have free space text");
+like ( $result->only_output, qr/$more_free/, "Have disk name in text");
+
+$result = NPTest->testCmd( "./check_disk -e -w 1 -c 1 -p $more_free" );
+is( $result->only_output, "DISK OK", "No print out of disks with -e for OKs");
$result = NPTest->testCmd( "./check_disk 100 100 $more_free" );
cmp_ok( $result->return_code, '==', 0, "Old syntax okay" );
More information about the Commits
mailing list