diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2006-08-04 20:22:31 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2006-08-04 20:22:31 +0000 |
commit | 96933fd2e1f53aff9c9ef26639fafe9a84ec754e (patch) | |
tree | 307d23df452b83c4d6799303379e208c7adb6317 /t/Nagios-Plugin-Performance.t | |
parent | c0f29b373c0339eec73e325fb15ebef6dd24d230 (diff) | |
download | monitoring-plugin-perl-96933fd2e1f53aff9c9ef26639fafe9a84ec754e.tar.gz |
Lots of extra tests and subsequent fixes (Nathan Vonnahme)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1466 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 't/Nagios-Plugin-Performance.t')
-rw-r--r-- | t/Nagios-Plugin-Performance.t | 9 |
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; | |||
3 | use Test::More tests => 49; | 3 | use Test::More tests => 49; |
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"; | ||
7 | |||
6 | use Nagios::Plugin::Base; | 8 | use Nagios::Plugin::Base; |
7 | Nagios::Plugin::Base->exit_on_die(0); | 9 | Nagios::Plugin::Base->exit_on_die(0); |
8 | 10 | ||
@@ -27,13 +29,16 @@ cmp_ok( $p[1]->threshold->critical->end, "==", 9448, "crit okay"); | |||
27 | ok( ! @p, "Errors correctly"); | 29 | ok( ! @p, "Errors correctly"); |
28 | ok( ! Nagios::Plugin::Performance->parse_perfstring(""), "Errors on empty string"); | 30 | ok( ! 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"); |
32 | cmp_ok( $p[0]->label, "eq", "time", "label okay"); | 35 | cmp_ok( $p[0]->label, "eq", "time", "label okay"); |
33 | cmp_ok( $p[0]->value, "==", 0.001229, "value okay"); | 36 | cmp_ok( $p[0]->value, "==", 0.001229, "value okay"); |
34 | cmp_ok( $p[0]->uom, "eq", "s", "uom okay"); | 37 | cmp_ok( $p[0]->uom, "eq", "s", "uom okay"); |
35 | cmp_ok( $p[0]->threshold->warning, "eq", "0", "warn okay"); | 38 | ok( $p[0]->threshold->warning->is_set, "warn okay"); |
36 | cmp_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;"); |