diff options
Diffstat (limited to 't/Nagios-Plugin-Performance.t')
-rw-r--r-- | t/Nagios-Plugin-Performance.t | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/t/Nagios-Plugin-Performance.t b/t/Nagios-Plugin-Performance.t index 2fe2326..a00b2db 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 => 42; | 3 | use Test::More tests => 43; |
4 | BEGIN { use_ok('Nagios::Plugin::Performance') }; | 4 | BEGIN { use_ok('Nagios::Plugin::Performance') }; |
5 | 5 | ||
6 | use Nagios::Plugin::Base; | 6 | use Nagios::Plugin::Base; |
@@ -21,8 +21,9 @@ cmp_ok( $p[1]->uom, 'eq', "MB", "uom okay"); | |||
21 | cmp_ok( $p[1]->threshold->warning->end, "==", 9443, "warn okay"); | 21 | cmp_ok( $p[1]->threshold->warning->end, "==", 9443, "warn okay"); |
22 | cmp_ok( $p[1]->threshold->critical->end, "==", 9448, "crit okay"); | 22 | cmp_ok( $p[1]->threshold->critical->end, "==", 9448, "crit okay"); |
23 | 23 | ||
24 | ok( ! defined Nagios::Plugin::Performance->parse_perfstring("rubbish"), "Errors correctly"); | 24 | @p = Nagios::Plugin::Performance->parse_perfstring("rubbish"); |
25 | ok( ! defined Nagios::Plugin::Performance->parse_perfstring(""), "Errors on empty string"); | 25 | ok( ! @p, "Errors correctly"); |
26 | ok( ! Nagios::Plugin::Performance->parse_perfstring(""), "Errors on empty string"); | ||
26 | 27 | ||
27 | @p = Nagios::Plugin::Performance->parse_perfstring( | 28 | @p = Nagios::Plugin::Performance->parse_perfstring( |
28 | "time=0.001229s;0.000000;0.000000;0.000000;10.000000"); | 29 | "time=0.001229s;0.000000;0.000000;0.000000;10.000000"); |
@@ -49,6 +50,9 @@ cmp_ok( $p[0]->uom, "eq", "", "uom empty"); | |||
49 | cmp_ok( $p[0]->threshold->warning, 'eq', "20", "warn okay"); | 50 | cmp_ok( $p[0]->threshold->warning, 'eq', "20", "warn okay"); |
50 | cmp_ok( $p[0]->threshold->critical, 'eq', "50", "crit okay"); | 51 | cmp_ok( $p[0]->threshold->critical, 'eq', "50", "crit okay"); |
51 | 52 | ||
53 | @p = Nagios::Plugin::Performance->parse_perfstring( "users=4;20;50;0\n" ); | ||
54 | ok( @p, "parse correctly with linefeed at end (nagiosgraph)"); | ||
55 | |||
52 | @p = Nagios::Plugin::Performance->parse_perfstring( | 56 | @p = Nagios::Plugin::Performance->parse_perfstring( |
53 | "time=0.215300s;5.000000;10.000000;0.000000 size=426B;;;0" ); | 57 | "time=0.215300s;5.000000;10.000000;0.000000 size=426B;;;0" ); |
54 | cmp_ok( $p[0]->label, "eq", "time", "label okay"); | 58 | cmp_ok( $p[0]->label, "eq", "time", "label okay"); |