diff options
Diffstat (limited to 'plugins/t/check_disk.t')
-rw-r--r-- | plugins/t/check_disk.t | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/t/check_disk.t b/plugins/t/check_disk.t index 14bc8de..70d8415 100644 --- a/plugins/t/check_disk.t +++ b/plugins/t/check_disk.t | |||
@@ -22,7 +22,7 @@ my $mountpoint2_valid = getTestParameter( "NP_MOUNTPOINT2_VALID", "Path to anoth | |||
22 | if ($mountpoint_valid eq "" or $mountpoint2_valid eq "") { | 22 | if ($mountpoint_valid eq "" or $mountpoint2_valid eq "") { |
23 | plan skip_all => "Need 2 mountpoints to test"; | 23 | plan skip_all => "Need 2 mountpoints to test"; |
24 | } else { | 24 | } else { |
25 | plan tests => 32; | 25 | plan tests => 35; |
26 | } | 26 | } |
27 | 27 | ||
28 | $result = NPTest->testCmd( | 28 | $result = NPTest->testCmd( |
@@ -103,6 +103,12 @@ $result = NPTest->testCmd( | |||
103 | ); | 103 | ); |
104 | cmp_ok( $result->return_code, '==', 2, "Combining above two tests, get critical"); | 104 | cmp_ok( $result->return_code, '==', 2, "Combining above two tests, get critical"); |
105 | 105 | ||
106 | $result = NPTest->testCmd( | ||
107 | "./check_disk -w $avg_free% -c $avg_free% -p $less_free -w $avg_free% -c 0% -p $more_free" | ||
108 | ); | ||
109 | cmp_ok( $result->return_code, '==', 2, "And reversing arguments should not make a difference"); | ||
110 | |||
111 | |||
106 | 112 | ||
107 | 113 | ||
108 | $result = NPTest->testCmd( | 114 | $result = NPTest->testCmd( |
@@ -168,6 +174,12 @@ $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p /etc" ); | |||
168 | cmp_ok( $result->return_code, '==', 0, "Checking /etc - should return info for /" ); | 174 | cmp_ok( $result->return_code, '==', 0, "Checking /etc - should return info for /" ); |
169 | cmp_ok( $result->output, 'eq', $root_output, "check_disk /etc gives same as check_disk /"); | 175 | cmp_ok( $result->output, 'eq', $root_output, "check_disk /etc gives same as check_disk /"); |
170 | 176 | ||
177 | $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p /etc -E" ); | ||
178 | cmp_ok( $result->return_code, '==', 2, "... unless -E/--exact-match is specified"); | ||
179 | |||
171 | $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p / -p /bob" ); | 180 | $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p / -p /bob" ); |
172 | cmp_ok( $result->return_code, '==', 2, "Checking / and /bob gives critical"); | 181 | cmp_ok( $result->return_code, '==', 2, "Checking / and /bob gives critical"); |
173 | unlike( $result->perf_output, '/\/bob/', "perf data does not have /bob in it"); | 182 | unlike( $result->perf_output, '/\/bob/', "perf data does not have /bob in it"); |
183 | |||
184 | $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p / -p /" ); | ||
185 | unlike( $result->output, '/ \/ .* \/ /', "Should not show same filesystem twice"); | ||