diff options
Diffstat (limited to 'plugins/t')
-rw-r--r-- | plugins/t/check_disk.t | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/t/check_disk.t b/plugins/t/check_disk.t index 2ec6cabb..5c6aa39a 100644 --- a/plugins/t/check_disk.t +++ b/plugins/t/check_disk.t | |||
@@ -24,7 +24,7 @@ my $mountpoint2_valid = getTestParameter( "NP_MOUNTPOINT2_VALID", "Path to anoth | |||
24 | if ($mountpoint_valid eq "" or $mountpoint2_valid eq "") { | 24 | if ($mountpoint_valid eq "" or $mountpoint2_valid eq "") { |
25 | plan skip_all => "Need 2 mountpoints to test"; | 25 | plan skip_all => "Need 2 mountpoints to test"; |
26 | } else { | 26 | } else { |
27 | plan tests => 68; | 27 | plan tests => 69; |
28 | } | 28 | } |
29 | 29 | ||
30 | $result = NPTest->testCmd( | 30 | $result = NPTest->testCmd( |
@@ -114,10 +114,8 @@ like ( $result->only_output, qr/$more_free/, "Have disk name in text"); | |||
114 | $result = NPTest->testCmd( "./check_disk -w 1 -c 1 -p $more_free -p $less_free" ); | 114 | $result = NPTest->testCmd( "./check_disk -w 1 -c 1 -p $more_free -p $less_free" ); |
115 | cmp_ok( $result->return_code, '==', 0, "At least 1 MB available on $more_free and $less_free"); | 115 | cmp_ok( $result->return_code, '==', 0, "At least 1 MB available on $more_free and $less_free"); |
116 | $_ = $result->output; | 116 | $_ = $result->output; |
117 | print $result->output."\n"; | ||
118 | my ($free_mb_on_mp1, $free_mb_on_mp2) = (m/(\d+) MB .* (\d+) MB /g); | 117 | my ($free_mb_on_mp1, $free_mb_on_mp2) = (m/(\d+) MB .* (\d+) MB /g); |
119 | my $free_mb_on_all = $free_mb_on_mp1 + $free_mb_on_mp2; | 118 | my $free_mb_on_all = $free_mb_on_mp1 + $free_mb_on_mp2; |
120 | print "$free_mb_on_all = $free_mb_on_mp1 + $free_mb_on_mp2\n"; | ||
121 | 119 | ||
122 | 120 | ||
123 | 121 | ||
@@ -255,6 +253,7 @@ cmp_ok( $result->return_code, "==", 2, "100 GB empty" ); | |||
255 | # Checking old syntax of check_disk warn crit [fs], with warn/crit at USED% thresholds | 253 | # Checking old syntax of check_disk warn crit [fs], with warn/crit at USED% thresholds |
256 | $result = NPTest->testCmd( "./check_disk 0 0 ".${mountpoint_valid} ); | 254 | $result = NPTest->testCmd( "./check_disk 0 0 ".${mountpoint_valid} ); |
257 | cmp_ok( $result->return_code, "==", 2, "Old syntax: 0% used"); | 255 | cmp_ok( $result->return_code, "==", 2, "Old syntax: 0% used"); |
256 | like ( $result->only_output, qr(^[^;]*;[^;]*$), "Select only one path with positional arguments"); | ||
258 | 257 | ||
259 | $result = NPTest->testCmd( "./check_disk 100 100 $mountpoint_valid" ); | 258 | $result = NPTest->testCmd( "./check_disk 100 100 $mountpoint_valid" ); |
260 | cmp_ok( $result->return_code, '==', 0, "Old syntax: 100% used" ); | 259 | cmp_ok( $result->return_code, '==', 0, "Old syntax: 100% used" ); |