[Nagiosplug-checkins] nagiosplug/plugins/t check_disk.t,1.6,1.7
Ton Voon
tonvoon at users.sourceforge.net
Thu Mar 23 04:02:15 CET 2006
Update of /cvsroot/nagiosplug/nagiosplug/plugins/t
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15628/plugins/t
Modified Files:
check_disk.t
Log Message:
Incorrect output when checking non-existent disk (John Rouillard - 1326050)
Index: check_disk.t
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/t/check_disk.t,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- check_disk.t 15 Dec 2005 15:19:55 -0000 1.6
+++ check_disk.t 23 Mar 2006 12:01:21 -0000 1.7
@@ -22,7 +22,7 @@
if ($mountpoint_valid eq "" or $mountpoint2_valid eq "") {
plan skip_all => "Need 2 mountpoints to test";
} else {
- plan tests => 26;
+ plan tests => 31;
}
$result = NPTest->testCmd(
@@ -157,3 +157,19 @@
$result = NPTest->testCmd( "./check_disk 200 0 $mountpoint_valid" );
cmp_ok( $result->return_code, '==', 3, "Old syntax: Error with values outside percent range" );
+TODO: {
+ local $TODO = "Check existence of each filesystem as a directory";
+ $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p /bob" );
+ cmp_ok( $result->return_code, '==', 2, "Checking /bob - return error because /bob does not exist" );
+}
+
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p /" );
+my $root_output = $result->output;
+
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p /etc" );
+cmp_ok( $result->return_code, '==', 0, "Checking /etc - should return info for /" );
+cmp_ok( $result->output, 'eq', $root_output, "check_disk /etc gives same as check_disk /");
+
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p / -p /bob" );
+cmp_ok( $result->return_code, '==', 2, "Checking / and /bob gives critical");
+unlike( $result->perf_output, 'm#/bob#', "perf data does not have /bob in it");
More information about the Commits
mailing list