[Nagiosplug-checkins] nagiosplug/plugins/t check_disk.t,1.11,1.12

Ton Voon tonvoon at users.sourceforge.net
Thu Oct 12 15:58:46 CEST 2006


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

Modified Files:
	check_disk.t 
Log Message:
Fixed output from -e in check_disk (Andreas Behal)


Index: check_disk.t
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/t/check_disk.t,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- check_disk.t	13 Jul 2006 23:58:00 -0000	1.11
+++ check_disk.t	12 Oct 2006 13:58:43 -0000	1.12
@@ -22,7 +22,7 @@
 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 @@
 	"./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 @@
 	"./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"
 	);





More information about the Commits mailing list