[Nagiosplug-checkins] nagiosplug/plugins/t check_disk.t,1.9,1.10

Ton Voon tonvoon at users.sourceforge.net
Thu Jul 13 00:53:29 CEST 2006


Update of /cvsroot/nagiosplug/nagiosplug/plugins/t
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26354/t

Modified Files:
	check_disk.t 
Log Message:
Added -E option for exact match of filesystem. Restructured main filesystem
loop. Added extra tests for possible duplicate filesystems.


Index: check_disk.t
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/t/check_disk.t,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- check_disk.t	23 Mar 2006 17:16:38 -0000	1.9
+++ check_disk.t	12 Jul 2006 22:53:27 -0000	1.10
@@ -22,7 +22,7 @@
 if ($mountpoint_valid eq "" or $mountpoint2_valid eq "") {
 	plan skip_all => "Need 2 mountpoints to test";
 } else {
-	plan tests => 32;
+	plan tests => 35;
 }
 
 $result = NPTest->testCmd( 
@@ -103,6 +103,12 @@
 	);
 cmp_ok( $result->return_code, '==', 2, "Combining above two tests, get critical");
 
+$result = NPTest->testCmd(
+	"./check_disk -w $avg_free% -c $avg_free% -p $less_free -w $avg_free% -c 0% -p $more_free"
+	);
+cmp_ok( $result->return_code, '==', 2, "And reversing arguments should not make a difference");
+
+
 
 
 $result = NPTest->testCmd(
@@ -168,6 +174,12 @@
 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 /etc -E" );
+cmp_ok( $result->return_code, '==', 2, "... unless -E/--exact-match is specified");
+
 $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, '/\/bob/', "perf data does not have /bob in it");
+
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p / -p /" );
+unlike( $result->output, '/ \/ .* \/ /', "Should not show same filesystem twice");





More information about the Commits mailing list