Code

Fixed crash from check_nt when -H unspecified or given multiple times (sf.net #273175...
[nagiosplug.git] / plugins / tests / check_nt.t
index d1600c7721eb3f661448ac1549b6146999946b80..223d4933815ef1b65cd5b9df374ae6fa93db89c6 100755 (executable)
@@ -59,7 +59,7 @@ if ($ARGV[0] && $ARGV[0] eq "-d") {
 }
 
 if (-x "./check_nt") {
-       plan tests => 4;
+       plan tests => 5;
 } else {
        plan skip_all => "No check_nt compiled";
 }
@@ -75,3 +75,6 @@ $result = NPTest->testCmd( "$command -v USEDDISKSPACE -l d" );
 is( $result->return_code, 3, "USEDDISKSPACE d - invalid");
 is( $result->output, "Free disk space : Invalid drive", "Output right" );
 
+$result = NPTest->testCmd( "./check_nt -v USEDDISKSPACE -l d" );
+is( $result->return_code, 3, "Fail if -H missing");
+