diff options
author | Ton Voon <tonvoon@macbook.local> | 2008-12-13 14:17:49 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@macbook.local> | 2008-12-13 14:17:49 +0000 |
commit | 91047f17af0454e94fbd30615f4a6959a593f48e (patch) | |
tree | ad84c6f2e21bebbb3f6c2960aef6a7920d04910f /t/Nagios-Plugin-Performance.t | |
parent | 7f33b6abe3b5e9ee14de2683f9412ac6641a2fcd (diff) | |
download | monitoring-plugin-perl-91047f17af0454e94fbd30615f4a6959a593f48e.tar.gz |
One other test, from check_ntp_time
Diffstat (limited to 't/Nagios-Plugin-Performance.t')
-rw-r--r-- | t/Nagios-Plugin-Performance.t | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/t/Nagios-Plugin-Performance.t b/t/Nagios-Plugin-Performance.t index d167979..e3fac07 100644 --- a/t/Nagios-Plugin-Performance.t +++ b/t/Nagios-Plugin-Performance.t | |||
@@ -16,7 +16,7 @@ my @test = ( | |||
16 | }, | 16 | }, |
17 | ); | 17 | ); |
18 | 18 | ||
19 | plan tests => (8 * scalar @test) + 125; | 19 | plan tests => (8 * scalar @test) + 132; |
20 | 20 | ||
21 | use_ok('Nagios::Plugin::Performance'); | 21 | use_ok('Nagios::Plugin::Performance'); |
22 | diag "\nusing Nagios::Plugin::Performance revision ". $Nagios::Plugin::Performance::VERSION . "\n" if $ENV{TEST_VERBOSE}; | 22 | diag "\nusing Nagios::Plugin::Performance revision ". $Nagios::Plugin::Performance::VERSION . "\n" if $ENV{TEST_VERBOSE}; |
@@ -239,4 +239,15 @@ is( $p[1]->threshold->warning, "20", "warn okay"); | |||
239 | is( $p[1]->threshold->critical->is_set, 1, "Critical range has been set"); | 239 | is( $p[1]->threshold->critical->is_set, 1, "Critical range has been set"); |
240 | is( $p[1]->threshold->critical, "60", "warn okay"); | 240 | is( $p[1]->threshold->critical, "60", "warn okay"); |
241 | 241 | ||
242 | |||
243 | # Another set of comma separated stuff | ||
244 | @p = Nagios::Plugin::Performance->parse_perfstring("offset=-0,023545s;60,000000;120,000000;"); | ||
245 | is( $p[0]->label, "offset", "label okay for numeric with commas instead of periods"); | ||
246 | is( $p[0]->value, -0.023545, "value okay"); | ||
247 | is( $p[0]->uom, "s", "uom okay"); | ||
248 | is( $p[0]->threshold->warning->is_set, 1, "Warning range has been set"); | ||
249 | is( $p[0]->threshold->warning, 60, "warn okay"); | ||
250 | is( $p[0]->threshold->critical->is_set, 1, "Critical range has been set"); | ||
251 | is( $p[0]->threshold->critical, 120, "warn okay"); | ||
252 | |||
242 | # add_perfdata tests in t/Nagios-Plugin-01.t | 253 | # add_perfdata tests in t/Nagios-Plugin-01.t |