summaryrefslogtreecommitdiffstats
path: root/t/Nagios-Plugin-Performance.t
diff options
context:
space:
mode:
Diffstat (limited to 't/Nagios-Plugin-Performance.t')
-rw-r--r--t/Nagios-Plugin-Performance.t9
1 files changed, 7 insertions, 2 deletions
diff --git a/t/Nagios-Plugin-Performance.t b/t/Nagios-Plugin-Performance.t
index b10a988..0f52de1 100644
--- a/t/Nagios-Plugin-Performance.t
+++ b/t/Nagios-Plugin-Performance.t
@@ -3,6 +3,8 @@ use strict;
3use Test::More tests => 49; 3use Test::More tests => 49;
4BEGIN { use_ok('Nagios::Plugin::Performance') }; 4BEGIN { use_ok('Nagios::Plugin::Performance') };
5 5
6diag "\nusing Nagios::Plugin::Performance revision ". $Nagios::Plugin::Performance::VERSION . "\n";
7
6use Nagios::Plugin::Base; 8use Nagios::Plugin::Base;
7Nagios::Plugin::Base->exit_on_die(0); 9Nagios::Plugin::Base->exit_on_die(0);
8 10
@@ -27,13 +29,16 @@ cmp_ok( $p[1]->threshold->critical->end, "==", 9448, "crit okay");
27ok( ! @p, "Errors correctly"); 29ok( ! @p, "Errors correctly");
28ok( ! Nagios::Plugin::Performance->parse_perfstring(""), "Errors on empty string"); 30ok( ! Nagios::Plugin::Performance->parse_perfstring(""), "Errors on empty string");
29 31
32
30@p = Nagios::Plugin::Performance->parse_perfstring( 33@p = Nagios::Plugin::Performance->parse_perfstring(
31 "time=0.001229s;0.000000;0.000000;0.000000;10.000000"); 34 "time=0.001229s;0.000000;0.000000;0.000000;10.000000");
32cmp_ok( $p[0]->label, "eq", "time", "label okay"); 35cmp_ok( $p[0]->label, "eq", "time", "label okay");
33cmp_ok( $p[0]->value, "==", 0.001229, "value okay"); 36cmp_ok( $p[0]->value, "==", 0.001229, "value okay");
34cmp_ok( $p[0]->uom, "eq", "s", "uom okay"); 37cmp_ok( $p[0]->uom, "eq", "s", "uom okay");
35cmp_ok( $p[0]->threshold->warning, "eq", "0", "warn okay"); 38 ok( $p[0]->threshold->warning->is_set, "warn okay");
36cmp_ok( $p[0]->threshold->critical, "eq", "0", "crit okay"); 39 ok( $p[0]->threshold->critical->is_set, "crit okay");
40
41
37 42
38@p = Nagios::Plugin::Performance->parse_perfstring( 43@p = Nagios::Plugin::Performance->parse_perfstring(
39 "load1=0.000;5.000;9.000;0; load5=0.000;5.000;9.000;0; load15=0.000;5.000;9.000;0;"); 44 "load1=0.000;5.000;9.000;0; load5=0.000;5.000;9.000;0; load15=0.000;5.000;9.000;0;");