aboutsummaryrefslogtreecommitdiff
path: root/plugins/t/check_disk.t
diff options
context:
space:
mode:
authorGravatar Ton Voon <tonvoon@users.sourceforge.net> 2006-10-12 13:58:43 +0000
committerGravatar Ton Voon <tonvoon@users.sourceforge.net> 2006-10-12 13:58:43 +0000
commitbd9a612f6c18fcc9b17e5abf58def18b19521d82 (patch)
treec4bb4e93ccbca424b2bd7aeb2a6ad799bc3e3791 /plugins/t/check_disk.t
parentcff53455ffc4d4df7214f8d671b3dca7ca26f51d (diff)
downloadmonitoring-plugins-bd9a612f6c18fcc9b17e5abf58def18b19521d82.tar.gz
Fixed output from -e in check_disk (Andreas Behal)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1490 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/t/check_disk.t')
-rw-r--r--plugins/t/check_disk.t13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/t/check_disk.t b/plugins/t/check_disk.t
index 66344927..0fe87aa3 100644
--- a/plugins/t/check_disk.t
+++ b/plugins/t/check_disk.t
@@ -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 => 35;
+ plan tests => 39;
}
$result = NPTest->testCmd(
@@ -85,6 +85,16 @@ $result = NPTest->testCmd(
"./check_disk -w $avg_free% -c 0% -p $less_free -w $avg_free% -c $avg_free% -p $more_free"
);
cmp_ok( $result->return_code, "==", 1, "Combining above two tests, get warning");
+my $all_disks = $result->output;
+
+$result = NPTest->testCmd(
+ "./check_disk -e -w $avg_free% -c 0% -p $less_free -w $avg_free% -c $avg_free% -p $more_free"
+ );
+isnt( $result->output, $all_disks, "-e gives different output");
+like( $result->output, qr/$less_free/, "Found problem $less_free");
+unlike( $result->only_output, qr/$more_free/, "Has ignored $more_free as not a problem");
+like( $result->perf_output, qr/$more_free/, "But $more_free is still in perf data");
+
@@ -97,7 +107,6 @@ $result = NPTest->testCmd(
"./check_disk -w $avg_free% -c $avg_free% -p $less_free"
);
cmp_ok( $result->return_code, '==', 2, "Get critical on less_free, checking avg_free");
-
$result = NPTest->testCmd(
"./check_disk -w $avg_free% -c 0% -p $more_free -w $avg_free% -c $avg_free% -p $less_free"
);