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.t11
1 files changed, 6 insertions, 5 deletions
diff --git a/t/Nagios-Plugin-Performance.t b/t/Nagios-Plugin-Performance.t
index aa0ab64..b10a988 100644
--- a/t/Nagios-Plugin-Performance.t
+++ b/t/Nagios-Plugin-Performance.t
@@ -1,6 +1,6 @@
1 1
2use strict; 2use strict;
3use Test::More tests => 43; 3use Test::More tests => 49;
4BEGIN { use_ok('Nagios::Plugin::Performance') }; 4BEGIN { use_ok('Nagios::Plugin::Performance') };
5 5
6use Nagios::Plugin::Base; 6use Nagios::Plugin::Base;
@@ -65,12 +65,13 @@ cmp_ok( $p[0]->threshold->critical, 'eq', "10", "crit okay");
65cmp_ok( $p[1]->label, "eq", "size", "label okay"); 65cmp_ok( $p[1]->label, "eq", "size", "label okay");
66cmp_ok( $p[1]->value, "==", 426, "value okay"); 66cmp_ok( $p[1]->value, "==", 426, "value okay");
67cmp_ok( $p[1]->uom, "eq", "B", "uom okay"); 67cmp_ok( $p[1]->uom, "eq", "B", "uom okay");
68 ok( ! defined $p[1]->threshold->warning, "warn okay"); 68 ok( ! $p[1]->threshold->warning->is_set, "warn okay");
69 ok( ! defined $p[1]->threshold->critical, "crit okay"); 69 ok( ! $p[1]->threshold->critical->is_set, "crit okay");
70 70
71# RRDlabel testing 71# Edge cases
72@p = Nagios::Plugin::Performance->parse_perfstring("/home/a-m=0 shared-folder:big=20 12345678901234567890=20"); 72@p = Nagios::Plugin::Performance->parse_perfstring("/home/a-m=0;0;0 shared-folder:big=20 12345678901234567890=20");
73cmp_ok( $p[0]->rrdlabel, "eq", "home_a_m", "changing / to _"); 73cmp_ok( $p[0]->rrdlabel, "eq", "home_a_m", "changing / to _");
74 ok( $p[0]->threshold->warning->is_set, "Warning range has been set");
74cmp_ok( $p[1]->rrdlabel, "eq", "shared_folder_big", "replacing bad characters"); 75cmp_ok( $p[1]->rrdlabel, "eq", "shared_folder_big", "replacing bad characters");
75cmp_ok( $p[2]->rrdlabel, "eq", "1234567890123456789", "shortening rrd label"); 76cmp_ok( $p[2]->rrdlabel, "eq", "1234567890123456789", "shortening rrd label");
76 77