summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTon Voon <tonvoon@macbook.local>2008-12-13 14:17:49 (GMT)
committerTon Voon <tonvoon@macbook.local>2008-12-13 14:17:49 (GMT)
commit91047f17af0454e94fbd30615f4a6959a593f48e (patch)
treead84c6f2e21bebbb3f6c2960aef6a7920d04910f
parent7f33b6abe3b5e9ee14de2683f9412ac6641a2fcd (diff)
downloadmonitoring-plugin-perl-91047f17af0454e94fbd30615f4a6959a593f48e.tar.gz
One other test, from check_ntp_time
-rw-r--r--t/Nagios-Plugin-Performance.t13
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
19plan tests => (8 * scalar @test) + 125; 19plan tests => (8 * scalar @test) + 132;
20 20
21use_ok('Nagios::Plugin::Performance'); 21use_ok('Nagios::Plugin::Performance');
22diag "\nusing Nagios::Plugin::Performance revision ". $Nagios::Plugin::Performance::VERSION . "\n" if $ENV{TEST_VERBOSE}; 22diag "\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");
239is( $p[1]->threshold->critical->is_set, 1, "Critical range has been set"); 239is( $p[1]->threshold->critical->is_set, 1, "Critical range has been set");
240is( $p[1]->threshold->critical, "60", "warn okay"); 240is( $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;");
245is( $p[0]->label, "offset", "label okay for numeric with commas instead of periods");
246is( $p[0]->value, -0.023545, "value okay");
247is( $p[0]->uom, "s", "uom okay");
248is( $p[0]->threshold->warning->is_set, 1, "Warning range has been set");
249is( $p[0]->threshold->warning, 60, "warn okay");
250is( $p[0]->threshold->critical->is_set, 1, "Critical range has been set");
251is( $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