diff options
| -rw-r--r-- | plugins/t/check_disk.t | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/t/check_disk.t b/plugins/t/check_disk.t index 1d0b9838..f07b2303 100644 --- a/plugins/t/check_disk.t +++ b/plugins/t/check_disk.t | |||
| @@ -54,6 +54,10 @@ my @perfdata; | |||
| 54 | @perfdata[0] = $result->{'mp_test_result'}->{'checks'}->[0]->{'checks'}->[0]->{'perfdata'}->[0]; | 54 | @perfdata[0] = $result->{'mp_test_result'}->{'checks'}->[0]->{'checks'}->[0]->{'perfdata'}->[0]; |
| 55 | @perfdata[1] = $result->{'mp_test_result'}->{'checks'}->[1]->{'checks'}->[0]->{'perfdata'}->[0]; | 55 | @perfdata[1] = $result->{'mp_test_result'}->{'checks'}->[1]->{'checks'}->[0]->{'perfdata'}->[0]; |
| 56 | 56 | ||
| 57 | # Decrease precision of numbers since the the fs might be modified between the two runs | ||
| 58 | $perfdata[0]->{'value'}->{'value'} = int($perfdata[0]->{'value'}->{'value'} / 1000000); | ||
| 59 | $perfdata[0]->{'value'}->{'value'} = int($perfdata[0]->{'value'}->{'value'} / 1000000); | ||
| 60 | |||
| 57 | # Calculate avg_free free on mountpoint1 and mountpoint2 | 61 | # Calculate avg_free free on mountpoint1 and mountpoint2 |
| 58 | # because if you check in the middle, you should get different errors | 62 | # because if you check in the middle, you should get different errors |
| 59 | my $avg_free_percent = ceil(($free_percent_on_mp1+$free_percent_on_mp2)/2); | 63 | my $avg_free_percent = ceil(($free_percent_on_mp1+$free_percent_on_mp2)/2); |
| @@ -144,8 +148,11 @@ cmp_ok( $result->return_code, "==", 0, "with JSON test format result should alwa | |||
| 144 | 148 | ||
| 145 | # write comparison set for perfdata here, but in reversed order, maybe there is a smarter way | 149 | # write comparison set for perfdata here, but in reversed order, maybe there is a smarter way |
| 146 | my @perfdata2; | 150 | my @perfdata2; |
| 147 | @perfdata2[1] = $result->{'mp_test_result'}->{'checks'}->[0]->{'checks'}->[0]->{'perfdata'}->[0]; | ||
| 148 | @perfdata2[0] = $result->{'mp_test_result'}->{'checks'}->[1]->{'checks'}->[0]->{'perfdata'}->[0]; | 151 | @perfdata2[0] = $result->{'mp_test_result'}->{'checks'}->[1]->{'checks'}->[0]->{'perfdata'}->[0]; |
| 152 | @perfdata2[1] = $result->{'mp_test_result'}->{'checks'}->[0]->{'checks'}->[0]->{'perfdata'}->[0]; | ||
| 153 | # Decrease precision of numbers since the the fs might be modified between the two runs | ||
| 154 | $perfdata2[0]->{'value'}->{'value'} = int($perfdata[0]->{'value'}->{'value'} / 1000000); | ||
| 155 | $perfdata2[0]->{'value'}->{'value'} = int($perfdata[0]->{'value'}->{'value'} / 1000000); | ||
| 149 | is_deeply(\@perfdata, \@perfdata2, "perf data for both filesystems same when reversed"); | 156 | is_deeply(\@perfdata, \@perfdata2, "perf data for both filesystems same when reversed"); |
| 150 | 157 | ||
| 151 | # Basic filesystem checks for sizes | 158 | # Basic filesystem checks for sizes |
