merging fast format zone files
Conflicts: .gitignore bin/named/zoneconf.c bin/tests/.gitignore bin/tests/system/autosign/tests.sh bin/tests/system/masterformat/clean.sh bin/tests/system/masterformat/ns1/compile.sh bin/tests/system/masterformat/tests.sh configure lib/dns/db.c lib/dns/include/dns/db.h lib/dns/include/dns/types.h lib/dns/master.c lib/dns/masterdump.c lib/dns/rbt.c lib/dns/rbtdb.c lib/dns/sdb.c lib/dns/sdlz.c lib/dns/tests/.cvsignore lib/dns/tests/Makefile.in lib/dns/win32/libdns.def lib/dns/xfrin.c lib/dns/zone.c lib/export/dns/Makefile.in lib/isc/include/isc/file.h lib/isc/unix/file.c lib/isc/win32/file.c lib/isccfg/namedconf.c
This commit is contained in:
@@ -14,13 +14,14 @@
|
||||
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
# PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
# $Id: clean.sh,v 1.12 2012/02/14 23:47:15 tbox Exp $
|
||||
# $Id$
|
||||
|
||||
rm -f named-compilezone
|
||||
rm -f ns1/example.db.raw*
|
||||
rm -f ns1/example.db.compat
|
||||
rm -f ns1/example.db.serial.raw
|
||||
rm -f ns1/large.db ns1/large.db.raw
|
||||
rm -f ns1/example.db.fast
|
||||
rm -f dig.out.*
|
||||
rm -f dig.out
|
||||
rm -f */named.memstats
|
||||
@@ -29,3 +30,6 @@ rm -f ns2/transfer.db.*
|
||||
rm -f ns2/formerly-text.db
|
||||
rm -f ns2/db-*
|
||||
rm -f ns2/large.bk
|
||||
rm -f ns3/example.db.fast ns3/dynamic.db.fast
|
||||
rm -f baseline.txt text.1 text.2 raw.1 raw.2 fast.1 fast.2
|
||||
|
||||
|
||||
@@ -12,10 +12,14 @@
|
||||
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
# PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
# $Id: compile.sh,v 1.11 2012/02/14 23:47:15 tbox Exp $
|
||||
# $Id$
|
||||
|
||||
../named-compilezone -D -F raw -o example.db.raw example \
|
||||
example.db > /dev/null 2>&1
|
||||
../named-compilezone -D -F fast -o ../ns3/example.db.fast example \
|
||||
example.db > /dev/null 2>&1
|
||||
../named-compilezone -D -F fast -o ../ns3/dynamic.db.fast dynamic \
|
||||
example.db > /dev/null 2>&1
|
||||
../named-compilezone -D -F raw=1 -o example.db.raw1 example-explicit \
|
||||
example.db > /dev/null 2>&1
|
||||
../named-compilezone -D -F raw=0 -o example.db.compat example-compat \
|
||||
@@ -23,3 +27,6 @@
|
||||
../named-compilezone -D -F raw -L 3333 -o example.db.serial.raw example \
|
||||
example.db > /dev/null 2>&1
|
||||
../named-compilezone -D -F raw -o large.db.raw large large.db > /dev/null 2>&1
|
||||
../named-compilezone -D -F fast -o example.db.fast example-fast \
|
||||
example.db > /dev/null 2>&1
|
||||
|
||||
|
||||
1
bin/tests/system/masterformat/ns3/.cvsignore
Normal file
1
bin/tests/system/masterformat/ns3/.cvsignore
Normal file
@@ -0,0 +1 @@
|
||||
named.run
|
||||
54
bin/tests/system/masterformat/ns3/named.conf
Normal file
54
bin/tests/system/masterformat/ns3/named.conf
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) 2005, 2007, 2011 Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* 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: named.conf,v 1.1.4.3 2012/02/07 23:53:43 each Exp $ */
|
||||
|
||||
// NS3
|
||||
|
||||
controls { /* empty */ };
|
||||
|
||||
options {
|
||||
pid-file "named.pid";
|
||||
listen-on port 5300 { 10.53.0.3; };
|
||||
port 5300;
|
||||
listen-on-v6 { none; };
|
||||
recursion no;
|
||||
notify no;
|
||||
dnssec-enable yes;
|
||||
};
|
||||
|
||||
key rndc_key {
|
||||
secret "1234abcd8765";
|
||||
algorithm hmac-md5;
|
||||
};
|
||||
|
||||
controls {
|
||||
inet 10.53.0.3 port 9953 allow { any; } keys { rndc_key; };
|
||||
};
|
||||
|
||||
zone "example" {
|
||||
type master;
|
||||
masterfile-format fast;
|
||||
file "example.db.fast";
|
||||
};
|
||||
|
||||
zone "dynamic" {
|
||||
type master;
|
||||
masterfile-format fast;
|
||||
file "dynamic.db.fast";
|
||||
allow-update { any; };
|
||||
};
|
||||
|
||||
@@ -14,11 +14,19 @@
|
||||
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
# PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
# $Id: tests.sh,v 1.14 2012/02/15 00:50:59 marka Exp $
|
||||
# $Id$
|
||||
|
||||
SYSTEMTESTTOP=..
|
||||
. $SYSTEMTESTTOP/conf.sh
|
||||
|
||||
isfast () {
|
||||
perl -e 'binmode STDIN;
|
||||
read(STDIN, $input, 8);
|
||||
($style, $version) = unpack("NN", $input);
|
||||
exit 1 if ($style != 3 || $version > 1);' < $1
|
||||
return $?
|
||||
}
|
||||
|
||||
israw () {
|
||||
perl -e 'binmode STDIN;
|
||||
read(STDIN, $input, 8);
|
||||
@@ -32,7 +40,8 @@ rawversion () {
|
||||
read(STDIN, $input, 8);
|
||||
if (length($input) < 8) { print "not raw\n"; exit 0; };
|
||||
($style, $version) = unpack("NN", $input);
|
||||
print ($style == 2 ? "$version\n" : "not raw\n");' < $1
|
||||
print ($style == 2 || $style == 3 ? "$version\n" :
|
||||
"not raw or fast\n");' < $1
|
||||
}
|
||||
|
||||
sourceserial () {
|
||||
@@ -49,20 +58,30 @@ sourceserial () {
|
||||
}' < $1
|
||||
}
|
||||
|
||||
restart () {
|
||||
sleep 1
|
||||
(cd ..; $PERL start.pl --noclean --restart masterformat ns3)
|
||||
}
|
||||
|
||||
DIGOPTS="+tcp +noauth +noadd +nosea +nostat +noquest +nocomm +nocmd"
|
||||
|
||||
status=0
|
||||
|
||||
echo "I:checking that master files in raw format loaded"
|
||||
ret=0
|
||||
set -- 1 2 3
|
||||
for zone in example example-explicit example-compat; do
|
||||
for server in 1 2; do
|
||||
for server in $*; do
|
||||
for name in ns mx a aaaa cname dname txt rrsig nsec dnskey ds; do
|
||||
$DIG $DIGOPTS $name.$zone. $name @10.53.0.$server -p 5300
|
||||
echo
|
||||
done > dig.out.$zone.$server
|
||||
done
|
||||
$PERL ../digcomp.pl dig.out.$zone.1 dig.out.$zone.2 || ret=1
|
||||
if [ $zone = "example" ]; then
|
||||
set -- 1 2
|
||||
$PERL ../digcomp.pl dig.out.$zone.1 dig.out.$zone.3 || ret=1
|
||||
fi
|
||||
done
|
||||
[ $ret -eq 0 ] || echo "I:failed"
|
||||
status=`expr $status + $ret`
|
||||
@@ -72,9 +91,11 @@ ret=0
|
||||
israw ns1/example.db.raw || ret=1
|
||||
israw ns1/example.db.raw1 || ret=1
|
||||
israw ns1/example.db.compat || ret=1
|
||||
isfast ns1/example.db.fast || ret=1
|
||||
[ "`rawversion ns1/example.db.raw`" = 1 ] || ret=1
|
||||
[ "`rawversion ns1/example.db.raw1`" = 1 ] || ret=1
|
||||
[ "`rawversion ns1/example.db.compat`" = 0 ] || ret=1
|
||||
[ "`rawversion ns1/example.db.fast`" = 1 ] || ret=1
|
||||
[ $ret -eq 0 ] || echo "I:failed"
|
||||
status=`expr $status + $ret`
|
||||
|
||||
@@ -128,6 +149,76 @@ done
|
||||
[ $ret -eq 0 ] && break
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "I:checking format transitions: text->raw->fast->text"
|
||||
ret=0
|
||||
./named-compilezone -D -f text -F text -o baseline.txt example.nil ns1/example.db > /dev/null
|
||||
./named-compilezone -D -f text -F raw -o raw.1 example.nil baseline.txt > /dev/null
|
||||
./named-compilezone -D -f raw -F fast -o fast.1 example.nil raw.1 > /dev/null
|
||||
./named-compilezone -D -f fast -F text -o text.1 example.nil fast.1 > /dev/null
|
||||
cmp -s baseline.txt text.1 || ret=0
|
||||
[ $ret -eq 0 ] || echo "I:failed"
|
||||
status=`expr $status + $ret`
|
||||
|
||||
echo "I:checking format transitions: text->fast->raw->text"
|
||||
ret=0
|
||||
./named-compilezone -D -f text -F fast -o fast.2 example.nil baseline.txt > /dev/null
|
||||
./named-compilezone -D -f fast -F raw -o raw.2 example.nil fast.2 > /dev/null
|
||||
./named-compilezone -D -f raw -F text -o text.2 example.nil raw.2 > /dev/null
|
||||
cmp -s baseline.txt text.2 || ret=0
|
||||
[ $ret -eq 0 ] || echo "I:failed"
|
||||
status=`expr $status + $ret`
|
||||
|
||||
echo "I:checking fast format loading with journal file rollforward"
|
||||
ret=0
|
||||
$NSUPDATE <<END > /dev/null || status=1
|
||||
server 10.53.0.3 5300
|
||||
ttl 600
|
||||
update add newtext.dynamic IN TXT "added text"
|
||||
update delete aaaa.dynamic
|
||||
send
|
||||
END
|
||||
$DIG $DIGOPTS @10.53.0.3 -p 5300 newtext.dynamic txt > dig.out.dynamic.3.1
|
||||
grep "added text" dig.out.dynamic.3.1 > /dev/null 2>&1 || ret=1
|
||||
$DIG $DIGOPTS +comm @10.53.0.3 -p 5300 added.dynamic txt > dig.out.dynamic.3.2
|
||||
grep "NXDOMAIN" dig.out.dynamic.3.2 > /dev/null 2>&1 || ret=1
|
||||
# using "rndc halt" ensures that we don't dump the zone file
|
||||
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 halt 2>&1 | sed 's/^/I:ns3 /'
|
||||
restart
|
||||
for i in 0 1 2 3 4 5 6 7 8 9; do
|
||||
lret=0
|
||||
$DIG $DIGOPTS @10.53.0.3 -p 5300 newtext.dynamic txt > dig.out.dynamic.3.3
|
||||
grep "added text" dig.out.dynamic.3.3 > /dev/null 2>&1 || lret=1
|
||||
[ $lret -eq 0 ] && break;
|
||||
done
|
||||
[ $lret -eq 1 ] && ret=1
|
||||
$DIG $DIGOPTS +comm @10.53.0.3 -p 5300 added.dynamic txt > dig.out.dynamic.3.4
|
||||
grep "NXDOMAIN" dig.out.dynamic.3.4 > /dev/null 2>&1 || ret=1
|
||||
[ $ret -eq 0 ] || echo "I:failed"
|
||||
status=`expr $status + $ret`
|
||||
|
||||
echo "I:checking fast format file dumps correctly"
|
||||
ret=0
|
||||
$NSUPDATE <<END > /dev/null || status=1
|
||||
server 10.53.0.3 5300
|
||||
ttl 600
|
||||
update add moretext.dynamic IN TXT "more text"
|
||||
send
|
||||
END
|
||||
$DIG $DIGOPTS @10.53.0.3 -p 5300 moretext.dynamic txt > dig.out.dynamic.3.5
|
||||
grep "more text" dig.out.dynamic.3.5 > /dev/null 2>&1 || ret=1
|
||||
# using "rndc stop" will cause the zone file to flush before shutdown
|
||||
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 stop 2>&1 | sed 's/^/I:ns3 /'
|
||||
rm ns3/*.jnl
|
||||
restart
|
||||
for i in 0 1 2 3 4 5 6 7 8 9; do
|
||||
lret=0
|
||||
$DIG $DIGOPTS +comm @10.53.0.3 -p 5300 moretext.dynamic txt > dig.out.dynamic.3.6
|
||||
grep "more text" dig.out.dynamic.3.6 > /dev/null 2>&1 || lret=1
|
||||
[ $lret -eq 0 ] && break;
|
||||
done
|
||||
[ $lret -eq 1 ] && ret=1
|
||||
|
||||
[ $ret -eq 0 ] || echo "I:failed"
|
||||
status=`expr $status + $ret`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user