aboutsummaryrefslogtreecommitdiff
path: root/plugins/t/check_disk.t
diff options
context:
space:
mode:
authorGravatar Ton Voon <tonvoon@users.sourceforge.net> 2006-10-12 14:14:48 +0000
committerGravatar Ton Voon <tonvoon@users.sourceforge.net> 2006-10-12 14:14:48 +0000
commitf9baef7ed0d40745a46ea82d08d85949bb48b8c9 (patch)
treed858e615fd886974b9c4ad8a270e2dc92fb0d08f /plugins/t/check_disk.t
parentbd9a612f6c18fcc9b17e5abf58def18b19521d82 (diff)
downloadmonitoring-plugins-f9baef7ed0d40745a46ea82d08d85949bb48b8c9.tar.gz
Remove the "- free space" if status is OK
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1491 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/t/check_disk.t')
-rw-r--r--plugins/t/check_disk.t13
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/t/check_disk.t b/plugins/t/check_disk.t
index 0fe87aa3..ec3d248c 100644
--- a/plugins/t/check_disk.t
+++ b/plugins/t/check_disk.t
@@ -10,9 +10,9 @@ use Test::More;
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 @@ my $mountpoint2_valid = getTestParameter( "NP_MOUNTPOINT2_VALID", "Path to anoth
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 @@ if ($free_on_mp1 > $free_on_mp2) {
$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" );