setup.pl revision ec5347e2c775f027573ce5648b910361aa926c01
#
# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2000, 2001 Internet Software Consortium.
#
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: setup.pl,v 1.5 2007/06/18 23:47:30 tbox Exp $
#
# Set up test data for zone transfer quota tests.
#
use FileHandle;
my $n_zones = 5;
my $n_names = 1000;
make_zones(2, undef);
my $rootdelegations =
print $rootdelegations <<END;
\$TTL 300
2000042100 ; serial
600 ; refresh
600 ; retry
1200 ; expire
600 ; minimum
)
END
for ($z = 0; $z < $n_zones; $z++) {
my $zn = sprintf("zone%06d.example", $z);
print $rootdelegations "$zn. NS ns$ns.$zn.\n";
print $rootdelegations "ns$ns.$zn. A 10.53.0.$ns\n";
}
}
close $rootdelegations;
sub make_zones {
my ($nsno, $slaved_from) = @_;
for ($z = 0; $z < $n_zones; $z++) {
my $zn = sprintf("zone%06d.example", $z);
if (defined($slaved_from)) {
print $namedconf "zone \"$zn\" { type slave; " .
"file \"$zn.bk\"; masters { $slaved_from; }; };\n";
} else {
print $namedconf "zone \"$zn\" { " .
"type master; " .
"allow-update { any; }; " .
"file \"$zn.db\"; };\n";
my $fn = "ns$nsno/$zn.db";
print $f "\$TTL 300
";
for ($i = 0; $i < $n_names; $i++) {
print $f sprintf("name%06d", $i) .
" A 10.0.0.1\n";
}
$f->close;
}
}
}