diff options
Diffstat (limited to 't/Nagios-Plugin-Performance.t')
-rw-r--r-- | t/Nagios-Plugin-Performance.t | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/t/Nagios-Plugin-Performance.t b/t/Nagios-Plugin-Performance.t index c4d518c..0574ea0 100644 --- a/t/Nagios-Plugin-Performance.t +++ b/t/Nagios-Plugin-Performance.t | |||
@@ -1,6 +1,6 @@ | |||
1 | 1 | ||
2 | use strict; | 2 | use strict; |
3 | use Test::More tests => 84; | 3 | use Test::More tests => 91; |
4 | BEGIN { use_ok('Nagios::Plugin::Performance') }; | 4 | BEGIN { use_ok('Nagios::Plugin::Performance') }; |
5 | 5 | ||
6 | diag "\nusing Nagios::Plugin::Performance revision ". $Nagios::Plugin::Performance::VERSION . "\n" if $ENV{TEST_VERBOSE}; | 6 | diag "\nusing Nagios::Plugin::Performance revision ". $Nagios::Plugin::Performance::VERSION . "\n" if $ENV{TEST_VERBOSE}; |
@@ -133,4 +133,13 @@ cmp_ok( $p[0]->uom, "eq", "s", "uom okay"); | |||
133 | cmp_ok( $p[0]->threshold->warning, 'eq', "0", "warn okay"); | 133 | cmp_ok( $p[0]->threshold->warning, 'eq', "0", "warn okay"); |
134 | cmp_ok( $p[0]->threshold->critical, 'eq', "0", "crit okay"); | 134 | cmp_ok( $p[0]->threshold->critical, 'eq', "0", "crit okay"); |
135 | 135 | ||
136 | @p = Nagios::Plugin::Performance->parse_perfstring("pct_used=73.7%;90;95"); | ||
137 | cmp_ok( $p[0]->label, "eq", "pct_used", "label okay"); | ||
138 | cmp_ok( $p[0]->value, "eq", "73.7", "value okay"); | ||
139 | cmp_ok( $p[0]->uom, "eq", "%", "uom okay"); | ||
140 | ok( defined eval { $p[0]->threshold->warning->is_set }, "Warning range has been set"); | ||
141 | ok( defined eval { $p[0]->threshold->critical->is_set }, "Critical range has been set"); | ||
142 | cmp_ok( $p[0]->threshold->warning, 'eq', "90", "warn okay"); | ||
143 | cmp_ok( $p[0]->threshold->critical, 'eq', "95", "crit okay"); | ||
144 | |||
136 | # add_perfdata tests in t/Nagios-Plugin-01.t | 145 | # add_perfdata tests in t/Nagios-Plugin-01.t |