AllKnowingDNS
view release on metacpan or search on metacpan
script/all-knowing-dns view on Meta::CPAN
#!/usr/bin/env perl
# vim:ts=4:sw=4:expandtab
use strict;
use warnings;
# These modules are in core:
use FindBin;
use lib "$FindBin::Bin/../lib";
use Getopt::Long;
use Sys::Syslog;
# All these modules are not in core:
use App::AllKnowingDNS::Util;
use App::AllKnowingDNS::Handler;
use Net::DNS::Nameserver;
use Privileges::Drop;
use v5.10;
our $VERSION = '1.7';
t/001-parse-config.t view on Meta::CPAN
#!perl
# vim:ts=4:sw=4:expandtab
#
# Verify that the parser correctly turns plain text fragments into
# App::AllKnowingDNS::Zone objects with correct properties.
use Test::More;
use Data::Dumper;
use strict;
use warnings;
use lib qw(lib);
use_ok('App::AllKnowingDNS::Config');
use_ok('App::AllKnowingDNS::Zone');
use_ok('App::AllKnowingDNS::Util');
my $input;
my $config;
$config = App::AllKnowingDNS::Util::parse_config('');
ok(!$config->has_zones, 'Empty config leads to no zones');
t/002-util.t view on Meta::CPAN
#!perl
# vim:ts=4:sw=4:expandtab
#
# Verify that the App::AllKnowingDNS::Util functions work.
use Test::More;
use Data::Dumper;
use strict;
use warnings;
use lib qw(lib);
use_ok('App::AllKnowingDNS::Util');
my $ptrzone = netmask_to_ptrzone('2001:4d88:100e:ccc0::/64');
is($ptrzone, '0.c.c.c.e.0.0.1.8.8.d.4.1.0.0.2.ip6.arpa',
'2001:4d88:100e:ccc0::/64 correctly converted to PTR zone');
$ptrzone = netmask_to_ptrzone('2001:4d88:100e:ccc0::/48');
is($ptrzone, 'e.0.0.1.8.8.d.4.1.0.0.2.ip6.arpa',
'2001:4d88:100e:ccc0::/48 correctly converted to PTR zone');
t/003-config.t view on Meta::CPAN
#!perl
# vim:ts=4:sw=4:expandtab
#
# Verify that the App::AllKnowingDNS::Config object works.
use Test::More;
use Data::Dumper;
use strict;
use warnings;
use lib qw(lib);
use_ok('App::AllKnowingDNS::Config');
my $config = App::AllKnowingDNS::Config->new;
isa_ok($config, 'App::AllKnowingDNS::Config');
ok(!defined($config->zone_for_ptr('0.c.c.c.e.0.0.1.8.8.d.4.1.0.0.2.ip6.arpa')),
'empty config does not handle our PTR zone');
ok(!defined($config->zone_for_aaaa('.nutzer.raumzeitlabor.de')),
'empty config does not handle our AAAA zone');
t/004-handler.t view on Meta::CPAN
#!perl
# vim:ts=4:sw=4:expandtab
#
# Verify that the App::AllKnowingDNS::Handler works.
use Test::More;
use Data::Dumper;
use strict;
use warnings;
use lib qw(lib);
use_ok('App::AllKnowingDNS::Config');
use_ok('App::AllKnowingDNS::Zone');
use_ok('App::AllKnowingDNS::Handler');
my $config = App::AllKnowingDNS::Config->new;
################################################################################
# Check resolving PTR records without a config
################################################################################
t/005-same-domain.t view on Meta::CPAN
# vim:ts=4:sw=4:expandtab
#
# Verify that the App::AllKnowingDNS::Handler works when having multiple zones
# configured that only differ in the first part of the domain (e.g.
# foo-%DIGITS%.example.net and bar-%DIGITS%.example.net).
use Test::More;
use Data::Dumper;
use strict;
use warnings;
use lib qw(lib);
use_ok('App::AllKnowingDNS::Config');
use_ok('App::AllKnowingDNS::Zone');
use_ok('App::AllKnowingDNS::Handler');
my $config = App::AllKnowingDNS::Config->new;
################################################################################
# Check resolving PTR records without a config
################################################################################
( run in 0.361 second using v1.01-cache-2.11-cpan-87723dcf8b7 )