diff options
author | Matthias Eble <psychotrahe@users.sourceforge.net> | 2007-12-10 00:19:27 (GMT) |
---|---|---|
committer | Matthias Eble <psychotrahe@users.sourceforge.net> | 2007-12-10 00:19:27 (GMT) |
commit | 3bb4b6b336b383c8f1686476cfb96ec674255683 (patch) | |
tree | d71cadec9e5e23765b8ae8ff1f31e3584766c460 /plugins/t | |
parent | 249bed27d5e064624d3590c98c15aa5401214ffa (diff) | |
download | monitoring-plugins-3bb4b6b336b383c8f1686476cfb96ec674255683.tar.gz |
Fixed check_load argument handling when passing non triplet thresholds. Thanks to Jonathan Kamens (bug #1831890)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1851 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/t')
-rw-r--r-- | plugins/t/check_load.t | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/t/check_load.t b/plugins/t/check_load.t index da87d16..8987b84 100644 --- a/plugins/t/check_load.t +++ b/plugins/t/check_load.t | |||
@@ -11,10 +11,11 @@ use NPTest; | |||
11 | 11 | ||
12 | my $res; | 12 | my $res; |
13 | 13 | ||
14 | my $successOutput = '/^OK - load average: [0-9]+\.?[0-9]+, [0-9]+\.?[0-9]+, [0-9]+\.?[0-9]+/'; | 14 | my $loadValue = "[0-9]+\.?[0-9]+"; |
15 | my $failureOutput = '/^CRITICAL - load average: [0-9]+\.?[0-9]+, [0-9]+\.?[0-9]+, [0-9]+\.?[0-9]+/'; | 15 | my $successOutput = "/^OK - load average: $loadValue, $loadValue, $loadValue/"; |
16 | my $failureOutput = "/^CRITICAL - load average: $loadValue, $loadValue, $loadValue/"; | ||
16 | 17 | ||
17 | plan tests => 6; | 18 | plan tests => 11; |
18 | 19 | ||
19 | $res = NPTest->testCmd( "./check_load -w 100,100,100 -c 100,100,100" ); | 20 | $res = NPTest->testCmd( "./check_load -w 100,100,100 -c 100,100,100" ); |
20 | cmp_ok( $res->return_code, 'eq', 0, "load not over 100"); | 21 | cmp_ok( $res->return_code, 'eq', 0, "load not over 100"); |
@@ -28,3 +29,9 @@ $res = NPTest->testCmd( "./check_load -r -w 0,0,0 -c 0,0,0" ); | |||
28 | cmp_ok( $res->return_code, 'eq', 2, "Load over 0 with per cpu division"); | 29 | cmp_ok( $res->return_code, 'eq', 2, "Load over 0 with per cpu division"); |
29 | like( $res->output, $failureOutput, "Output OK"); | 30 | like( $res->output, $failureOutput, "Output OK"); |
30 | 31 | ||
32 | $res = NPTest->testCmd( "./check_load -w 100 -c 100,110" ); | ||
33 | cmp_ok( $res->return_code, 'eq', 0, "Plugin can handle non-triplet-arguments"); | ||
34 | like( $res->output, $successOutput, "Output OK"); | ||
35 | like( $res->perf_output, "/load1=$loadValue;100.000;100.000/", "Test handling of non triplet thresholds (load1)"); | ||
36 | like( $res->perf_output, "/load5=$loadValue;100.000;110.000/", "Test handling of non triplet thresholds (load5)"); | ||
37 | like( $res->perf_output, "/load15=$loadValue;100.000;110.000/", "Test handling of non triplet thresholds (load15)"); | ||