[Nagiosplug-checkins] Nagios-Plugin/t Nagios-Plugin-Performance.t, 1.2, 1.3
Ton Voon
tonvoon at users.sourceforge.net
Thu Jun 15 10:38:20 CEST 2006
Update of /cvsroot/nagiosplug/Nagios-Plugin/t
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv13111/t
Modified Files:
Nagios-Plugin-Performance.t
Log Message:
Added rrdlabel method. Fixed parse_perfstring if value=0
Index: Nagios-Plugin-Performance.t
===================================================================
RCS file: /cvsroot/nagiosplug/Nagios-Plugin/t/Nagios-Plugin-Performance.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Nagios-Plugin-Performance.t 9 Jun 2006 10:53:22 -0000 1.2
+++ Nagios-Plugin-Performance.t 15 Jun 2006 08:38:18 -0000 1.3
@@ -8,6 +8,7 @@
my @p = Nagios::Plugin::Performance->parse_perfstring("/=382MB;15264;15269;; /var=218MB;9443;9448");
cmp_ok( $p[0]->label, 'eq', "/", "label okay");
+cmp_ok( $p[0]->rrdlabel, 'eq', "root", "rrd label okay");
cmp_ok( $p[0]->value, '==', 382, "value okay");
cmp_ok( $p[0]->uom, 'eq', "MB", "uom okay");
cmp_ok( $p[0]->threshold->warning->end, "==", 15264, "warn okay");
@@ -16,6 +17,7 @@
ok( ! defined $p[0]->max, "max okay");
cmp_ok( $p[1]->label, 'eq', "/var", "label okay");
+cmp_ok( $p[1]->rrdlabel, 'eq', "var", "rrd label okay");
cmp_ok( $p[1]->value, '==', 218, "value okay");
cmp_ok( $p[1]->uom, 'eq', "MB", "uom okay");
cmp_ok( $p[1]->threshold->warning->end, "==", 9443, "warn okay");
@@ -65,3 +67,10 @@
cmp_ok( $p[1]->uom, "eq", "B", "uom okay");
ok( ! defined $p[1]->threshold->warning, "warn okay");
ok( ! defined $p[1]->threshold->critical, "crit okay");
+
+# RRDlabel testing
+ at p = Nagios::Plugin::Performance->parse_perfstring("/home/a-m=0 shared-folder:big=20 12345678901234567890=20");
+cmp_ok( $p[0]->rrdlabel, "eq", "home_a_m", "changing / to _");
+cmp_ok( $p[1]->rrdlabel, "eq", "shared_folder_big", "replacing bad characters");
+cmp_ok( $p[2]->rrdlabel, "eq", "1234567890123456789", "shortening rrd label");
+
More information about the Commits
mailing list