summaryrefslogtreecommitdiffstats
path: root/plugins/t
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/t')
-rw-r--r--plugins/t/check_disk.t13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/t/check_disk.t b/plugins/t/check_disk.t
index 6634492..0fe87aa 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
22if ($mountpoint_valid eq "" or $mountpoint2_valid eq "") { 22if ($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 => 35; 25 plan tests => 39;
26} 26}
27 27
28$result = NPTest->testCmd( 28$result = NPTest->testCmd(
@@ -85,6 +85,16 @@ $result = NPTest->testCmd(
85 "./check_disk -w $avg_free% -c 0% -p $less_free -w $avg_free% -c $avg_free% -p $more_free" 85 "./check_disk -w $avg_free% -c 0% -p $less_free -w $avg_free% -c $avg_free% -p $more_free"
86 ); 86 );
87cmp_ok( $result->return_code, "==", 1, "Combining above two tests, get warning"); 87cmp_ok( $result->return_code, "==", 1, "Combining above two tests, get warning");
88my $all_disks = $result->output;
89
90$result = NPTest->testCmd(
91 "./check_disk -e -w $avg_free% -c 0% -p $less_free -w $avg_free% -c $avg_free% -p $more_free"
92 );
93isnt( $result->output, $all_disks, "-e gives different output");
94like( $result->output, qr/$less_free/, "Found problem $less_free");
95unlike( $result->only_output, qr/$more_free/, "Has ignored $more_free as not a problem");
96like( $result->perf_output, qr/$more_free/, "But $more_free is still in perf data");
97
88 98
89 99
90 100
@@ -97,7 +107,6 @@ $result = NPTest->testCmd(
97 "./check_disk -w $avg_free% -c $avg_free% -p $less_free" 107 "./check_disk -w $avg_free% -c $avg_free% -p $less_free"
98 ); 108 );
99cmp_ok( $result->return_code, '==', 2, "Get critical on less_free, checking avg_free"); 109cmp_ok( $result->return_code, '==', 2, "Get critical on less_free, checking avg_free");
100
101$result = NPTest->testCmd( 110$result = NPTest->testCmd(
102 "./check_disk -w $avg_free% -c 0% -p $more_free -w $avg_free% -c $avg_free% -p $less_free" 111 "./check_disk -w $avg_free% -c 0% -p $more_free -w $avg_free% -c $avg_free% -p $less_free"
103 ); 112 );