[Nagiosplug-checkins] nagiosplug/plugins-scripts/t utils.t, NONE, 1.1
Ton Voon
tonvoon at users.sourceforge.net
Thu Oct 26 23:02:24 CEST 2006
Update of /cvsroot/nagiosplug/nagiosplug/plugins-scripts/t
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7073/t
Added Files:
utils.t
Log Message:
Fixed regression where hostnames with hyphens were rejected (1581402 - Holger Weiss)
--- NEW FILE: utils.t ---
#!/usr/bin/perl -w -I ..
#
# utils.pm tests
#
# $Id: utils.t,v 1.1 2006/10/26 21:02:21 tonvoon Exp $
#
#use strict;
use Test::More;
use NPTest;
use lib "..";
use utils;
my $hostname_checks = {
"www.altinity.com" => 1,
"www.888.com" => 1,
"888.com" => 1,
"host-hyphened.com" => 1,
"rubbish" => 1,
"-start.com" => 0,
"endsindot." => 0,
"lots.of.dots.dot.org" => 1,
"10.20.30.40" => 1,
"10.20.30.40.50" => 0,
"10.20.30" => 0,
};
plan tests => scalar keys %$hostname_checks;
foreach my $h (sort keys %$hostname_checks) {
is (utils::is_hostname($h), $hostname_checks->{$h}, "$h should return ".$hostname_checks->{$h});
}
More information about the Commits
mailing list