summaryrefslogtreecommitdiffstats
path: root/plugins/t
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2006-03-23 12:01:21 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2006-03-23 12:01:21 (GMT)
commit61cd9f525aa236250b6768e6db2977c836c57d96 (patch)
tree107e0b4fcd7bb3c42fcc1b7c51c4e7d83c726f38 /plugins/t
parent3ebbe5c55bfbe0316652abc5e8466e78bc89eb7a (diff)
downloadmonitoring-plugins-61cd9f525aa236250b6768e6db2977c836c57d96.tar.gz
Incorrect output when checking non-existent disk (John Rouillard - 1326050)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1349 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/t')
-rw-r--r--plugins/t/check_disk.t18
1 files changed, 17 insertions, 1 deletions
diff --git a/plugins/t/check_disk.t b/plugins/t/check_disk.t
index 385865f..90ccc26 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
22if ($mountpoint_valid eq "" or $mountpoint2_valid eq "") { 22if ($mountpoint_valid eq "" or $mountpoint2_valid eq "") {
23 plan skip_all => "Need 2 mountpoints to test"; 23 plan skip_all => "Need 2 mountpoints to test";
24} else { 24} else {
25 plan tests => 26; 25 plan tests => 31;
26} 26}
27 27
28$result = NPTest->testCmd( 28$result = NPTest->testCmd(
@@ -157,3 +157,19 @@ TODO: {
157$result = NPTest->testCmd( "./check_disk 200 0 $mountpoint_valid" ); 157$result = NPTest->testCmd( "./check_disk 200 0 $mountpoint_valid" );
158cmp_ok( $result->return_code, '==', 3, "Old syntax: Error with values outside percent range" ); 158cmp_ok( $result->return_code, '==', 3, "Old syntax: Error with values outside percent range" );
159 159
160TODO: {
161 local $TODO = "Check existence of each filesystem as a directory";
162 $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p /bob" );
163 cmp_ok( $result->return_code, '==', 2, "Checking /bob - return error because /bob does not exist" );
164}
165
166$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p /" );
167my $root_output = $result->output;
168
169$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p /etc" );
170cmp_ok( $result->return_code, '==', 0, "Checking /etc - should return info for /" );
171cmp_ok( $result->output, 'eq', $root_output, "check_disk /etc gives same as check_disk /");
172
173$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p / -p /bob" );
174cmp_ok( $result->return_code, '==', 2, "Checking / and /bob gives critical");
175unlike( $result->perf_output, 'm#/bob#', "perf data does not have /bob in it");