1586. [func] "check-names" is now implemented.
This commit is contained in:
5
bin/tests/system/checknames/clean.sh
Normal file
5
bin/tests/system/checknames/clean.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
rm -f dig.out.ns?.test*
|
||||
rm -f nsupdate.out.test*
|
||||
rm -f ns1/*.example.db
|
||||
rm -f ns1/*.update.db
|
||||
rm -f ns1/*.update.db.jnl
|
||||
10
bin/tests/system/checknames/ns1/fail.example.db.in
Normal file
10
bin/tests/system/checknames/ns1/fail.example.db.in
Normal file
@@ -0,0 +1,10 @@
|
||||
; Copyright
|
||||
|
||||
; $Id: fail.example.db.in,v 1.2 2004/02/27 20:44:07 marka Exp $
|
||||
|
||||
$TTL 300
|
||||
@ SOA ns1.fail.example. hostmaster.fail.example. (
|
||||
1 3600 1200 604800 3600 )
|
||||
NS ns1.fail.example.
|
||||
ns1.fail.example. A 10.53.0.1
|
||||
xx_xx.fail.example. A 127.0.0.1
|
||||
9
bin/tests/system/checknames/ns1/fail.update.db.in
Normal file
9
bin/tests/system/checknames/ns1/fail.update.db.in
Normal file
@@ -0,0 +1,9 @@
|
||||
; Copyright
|
||||
|
||||
; $Id: fail.update.db.in,v 1.2 2004/02/27 20:44:07 marka Exp $
|
||||
|
||||
$TTL 300
|
||||
@ SOA ns1.fail.update. hostmaster.fail.update. (
|
||||
1 3600 1200 604800 3600 )
|
||||
NS ns1.fail.update.
|
||||
ns1.fail.update. A 10.53.0.1
|
||||
11
bin/tests/system/checknames/ns1/ignore.example.db.in
Normal file
11
bin/tests/system/checknames/ns1/ignore.example.db.in
Normal file
@@ -0,0 +1,11 @@
|
||||
; Copyright
|
||||
|
||||
; $Id: ignore.example.db.in,v 1.2 2004/02/27 20:44:07 marka Exp $
|
||||
|
||||
$TTL 300
|
||||
@ SOA ns1.ignore.example. hostmaster.ignore.example. (
|
||||
1 3600 1200 604800 3600 )
|
||||
NS ns1.ignore.example.
|
||||
ns1.ignore.example. A 10.53.0.1
|
||||
yy_yy.ignore.example. A 10.53.0.1
|
||||
mx.ignore.example. MX 10 zz_zz.ignore.example.
|
||||
9
bin/tests/system/checknames/ns1/ignore.update.db.in
Normal file
9
bin/tests/system/checknames/ns1/ignore.update.db.in
Normal file
@@ -0,0 +1,9 @@
|
||||
; Copyright
|
||||
|
||||
; $Id: ignore.update.db.in,v 1.2 2004/02/27 20:44:07 marka Exp $
|
||||
|
||||
$TTL 300
|
||||
@ SOA ns1.ignore.update. hostmaster.ignore.update. (
|
||||
1 3600 1200 604800 3600 )
|
||||
NS ns1.ignore.update.
|
||||
ns1.ignore.update. A 10.53.0.1
|
||||
61
bin/tests/system/checknames/ns1/named.conf
Normal file
61
bin/tests/system/checknames/ns1/named.conf
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright
|
||||
*/
|
||||
|
||||
/* $Id: named.conf,v 1.2 2004/02/27 20:44:08 marka Exp $ */
|
||||
|
||||
options {
|
||||
query-source address 10.53.0.1;
|
||||
notify-source 10.53.0.1;
|
||||
transfer-source 10.53.0.1;
|
||||
port 5300;
|
||||
pid-file "named.pid";
|
||||
listen-on { 10.53.0.1; };
|
||||
listen-on-v6 { none; };
|
||||
recursion no;
|
||||
notify yes;
|
||||
};
|
||||
|
||||
zone "." {
|
||||
type master;
|
||||
file "root.db";
|
||||
};
|
||||
|
||||
zone "ignore.example" {
|
||||
type master;
|
||||
file "ignore.example.db";
|
||||
check-names ignore;
|
||||
};
|
||||
|
||||
zone "warn.example" {
|
||||
type master;
|
||||
file "warn.example.db";
|
||||
check-names warn;
|
||||
};
|
||||
|
||||
zone "fail.example" {
|
||||
type master;
|
||||
file "fail.example.db";
|
||||
check-names fail;
|
||||
};
|
||||
|
||||
zone "ignore.update" {
|
||||
type master;
|
||||
file "ignore.update.db";
|
||||
allow-update { any; };
|
||||
check-names ignore;
|
||||
};
|
||||
|
||||
zone "warn.update" {
|
||||
type master;
|
||||
file "warn.update.db";
|
||||
allow-update { any; };
|
||||
check-names warn;
|
||||
};
|
||||
|
||||
zone "fail.update" {
|
||||
type master;
|
||||
file "fail.update.db";
|
||||
allow-update { any; };
|
||||
check-names fail;
|
||||
};
|
||||
23
bin/tests/system/checknames/ns1/root.db
Normal file
23
bin/tests/system/checknames/ns1/root.db
Normal file
@@ -0,0 +1,23 @@
|
||||
; Copyright
|
||||
|
||||
; $Id: root.db,v 1.2 2004/02/27 20:44:08 marka Exp $
|
||||
|
||||
$TTL 300
|
||||
@ SOA ns1. hostmaster.warn.example. (
|
||||
1 3600 1200 604800 3600 )
|
||||
NS ns1.
|
||||
ns1. A 10.53.0.1
|
||||
;
|
||||
ignore.example. NS ns1.ignore.example.
|
||||
ns1.ignore.example. A 10.53.0.1
|
||||
warn.example. NS ns1.warn.example.
|
||||
ns1.warn.example. A 10.53.0.1
|
||||
fail.example. NS ns1.fail.example.
|
||||
ns1.fail.example. A 10.53.0.1
|
||||
;
|
||||
ignore.update. NS ns1.ignore.update.
|
||||
ns1.ignore.update. A 10.53.0.1
|
||||
warn.update. NS ns1.warn.update.
|
||||
ns1.warn.update. A 10.53.0.1
|
||||
fail.update. NS ns1.fail.update.
|
||||
ns1.fail.update. A 10.53.0.1
|
||||
10
bin/tests/system/checknames/ns1/warn.example.db.in
Normal file
10
bin/tests/system/checknames/ns1/warn.example.db.in
Normal file
@@ -0,0 +1,10 @@
|
||||
; Copyright
|
||||
|
||||
; $Id: warn.example.db.in,v 1.2 2004/02/27 20:44:08 marka Exp $
|
||||
|
||||
$TTL 300
|
||||
@ SOA ns1.warn.example. hostmaster.warn.example. (
|
||||
1 3600 1200 604800 3600 )
|
||||
NS ns1.warn.example.
|
||||
ns1.warn.example. A 10.53.0.1
|
||||
xx_xx.warn.example. A 10.53.0.1
|
||||
9
bin/tests/system/checknames/ns1/warn.update.db.in
Normal file
9
bin/tests/system/checknames/ns1/warn.update.db.in
Normal file
@@ -0,0 +1,9 @@
|
||||
; Copyright
|
||||
|
||||
; $Id: warn.update.db.in,v 1.2 2004/02/27 20:44:08 marka Exp $
|
||||
|
||||
$TTL 300
|
||||
@ SOA ns1.warn.update. hostmaster.warn.update. (
|
||||
1 3600 1200 604800 3600 )
|
||||
NS ns1.warn.update.
|
||||
ns1.warn.update. A 10.53.0.1
|
||||
23
bin/tests/system/checknames/ns2/named.conf
Normal file
23
bin/tests/system/checknames/ns2/named.conf
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright
|
||||
*/
|
||||
|
||||
/* $Id: named.conf,v 1.2 2004/02/27 20:44:08 marka Exp $ */
|
||||
|
||||
options {
|
||||
query-source address 10.53.0.2;
|
||||
notify-source 10.53.0.2;
|
||||
transfer-source 10.53.0.2;
|
||||
port 5300;
|
||||
pid-file "named.pid";
|
||||
listen-on { 10.53.0.2; };
|
||||
listen-on-v6 { none; };
|
||||
recursion yes;
|
||||
check-names response warn;
|
||||
notify yes;
|
||||
};
|
||||
|
||||
zone "." {
|
||||
type hint;
|
||||
file "root.hints";
|
||||
};
|
||||
7
bin/tests/system/checknames/ns2/root.hints
Normal file
7
bin/tests/system/checknames/ns2/root.hints
Normal file
@@ -0,0 +1,7 @@
|
||||
; Copyright
|
||||
|
||||
; $Id: root.hints,v 1.2 2004/02/27 20:44:09 marka Exp $
|
||||
|
||||
$TTL 300
|
||||
. NS ns1.
|
||||
ns1. A 10.53.0.1
|
||||
23
bin/tests/system/checknames/ns3/named.conf
Normal file
23
bin/tests/system/checknames/ns3/named.conf
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright
|
||||
*/
|
||||
|
||||
/* $Id: named.conf,v 1.2 2004/02/27 20:44:09 marka Exp $ */
|
||||
|
||||
options {
|
||||
query-source address 10.53.0.3;
|
||||
notify-source 10.53.0.3;
|
||||
transfer-source 10.53.0.3;
|
||||
port 5300;
|
||||
pid-file "named.pid";
|
||||
listen-on { 10.53.0.3; };
|
||||
listen-on-v6 { none; };
|
||||
recursion yes;
|
||||
check-names response fail;
|
||||
notify yes;
|
||||
};
|
||||
|
||||
zone "." {
|
||||
type hint;
|
||||
file "root.hints";
|
||||
};
|
||||
7
bin/tests/system/checknames/ns3/root.hints
Normal file
7
bin/tests/system/checknames/ns3/root.hints
Normal file
@@ -0,0 +1,7 @@
|
||||
; Copyright
|
||||
|
||||
; $Id: root.hints,v 1.2 2004/02/27 20:44:09 marka Exp $
|
||||
|
||||
$TTL 300
|
||||
. NS ns1.
|
||||
ns1. A 10.53.0.1
|
||||
7
bin/tests/system/checknames/setup.sh
Normal file
7
bin/tests/system/checknames/setup.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
cp ns1/ignore.example.db.in ns1/ignore.example.db
|
||||
cp ns1/warn.example.db.in ns1/warn.example.db
|
||||
cp ns1/fail.example.db.in ns1/fail.example.db
|
||||
|
||||
cp ns1/ignore.update.db.in ns1/ignore.update.db
|
||||
cp ns1/warn.update.db.in ns1/warn.update.db
|
||||
cp ns1/fail.update.db.in ns1/fail.update.db
|
||||
122
bin/tests/system/checknames/tests.sh
Normal file
122
bin/tests/system/checknames/tests.sh
Normal file
@@ -0,0 +1,122 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright
|
||||
|
||||
# $Id: tests.sh,v 1.2 2004/02/27 20:44:06 marka Exp $
|
||||
|
||||
SYSTEMTESTTOP=..
|
||||
. $SYSTEMTESTTOP/conf.sh
|
||||
|
||||
status=0
|
||||
n=1
|
||||
|
||||
DIGOPTS="+tcp +noadd +nosea +nostat +nocmd -p 5300"
|
||||
|
||||
# Entry should exist.
|
||||
echo "I: check for failure from on zone load for 'check-names fail;' ($n)"
|
||||
ret=0
|
||||
$DIG $DIGOPTS fail.example. @10.53.0.1 a > dig.out.ns1.test$n || ret=1
|
||||
grep SERVFAIL dig.out.ns1.test$n > /dev/null || ret=1
|
||||
grep 'xx_xx.fail.example: bad owner name (check-names)' ns1/named.run > /dev/null || ret=1
|
||||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
n=`expr $n + 1`
|
||||
|
||||
# Entry should exist.
|
||||
echo "I: check for warnings from on zone load for 'check-names warn;' ($n)"
|
||||
ret=0
|
||||
grep 'xx_xx.warn.example: bad owner name (check-names)' ns1/named.run > /dev/null || ret=1
|
||||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
n=`expr $n + 1`
|
||||
|
||||
# Entry should not exist.
|
||||
echo "I: check for warnings from on zone load for 'check-names ignore;' ($n)"
|
||||
ret=1
|
||||
grep 'yy_yy.ignore.example: bad owner name (check-names)' ns1/named.run || ret=0
|
||||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
n=`expr $n + 1`
|
||||
|
||||
# Entry should exist
|
||||
echo "I: check that 'check-names response warn;' works ($n)"
|
||||
ret=0
|
||||
$DIG $DIGOPTS yy_yy.ignore.example. @10.53.0.1 a > dig.out.ns1.test$n || ret=1
|
||||
$DIG $DIGOPTS yy_yy.ignore.example. @10.53.0.2 a > dig.out.ns2.test$n || ret=1
|
||||
$PERL ../digcomp.pl dig.out.ns1.test$n dig.out.ns2.test$n || ret=1
|
||||
grep "check-names warning yy_yy.ignore.example/A/IN" ns2/named.run > /dev/null || ret=1
|
||||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
n=`expr $n + 1`
|
||||
|
||||
# Entry should exist
|
||||
echo "I: check that 'check-names response (owner) fails;' works ($n)"
|
||||
ret=0
|
||||
$DIG $DIGOPTS yy_yy.ignore.example. @10.53.0.1 a > dig.out.ns1.test$n || ret=1
|
||||
$DIG $DIGOPTS yy_yy.ignore.example. @10.53.0.3 a > dig.out.ns3.test$n || ret=1
|
||||
grep NOERROR dig.out.ns1.test$n > /dev/null || ret=1
|
||||
grep REFUSED dig.out.ns3.test$n > /dev/null || ret=1
|
||||
grep "check-names failure yy_yy.ignore.example/A/IN" ns3/named.run > /dev/null || ret=1
|
||||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
n=`expr $n + 1`
|
||||
|
||||
# Entry should exist
|
||||
echo "I: check that 'check-names response (rdata) fails;' works ($n)"
|
||||
ret=0
|
||||
$DIG $DIGOPTS mx.ignore.example. @10.53.0.1 MX > dig.out.ns1.test$n || ret=1
|
||||
$DIG $DIGOPTS mx.ignore.example. @10.53.0.3 MX > dig.out.ns3.test$n || ret=1
|
||||
grep NOERROR dig.out.ns1.test$n > /dev/null || ret=1
|
||||
grep SERVFAIL dig.out.ns3.test$n > /dev/null || ret=1
|
||||
grep "check-names failure mx.ignore.example/MX/IN" ns3/named.run > /dev/null || ret=1
|
||||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
n=`expr $n + 1`
|
||||
|
||||
echo "I: check that updates to 'check-names fail;' are rejected ($n)"
|
||||
ret=0
|
||||
not=1
|
||||
$NSUPDATE -d <<END> nsupdate.out.test$n 2>&1 || not=0
|
||||
server 10.53.0.1 5300
|
||||
update add xxx_xxx.fail.update. 600 A 10.10.10.1
|
||||
send
|
||||
END
|
||||
if [ $not != 0 ]; then ret=1; fi
|
||||
$DIG $DIGOPTS xxx_xxx.fail.update @10.53.0.1 A > dig.out.ns1.test$n || ret=1
|
||||
grep "xxx_xxx.fail.update/A: bad owner name (check-names)" ns1/named.run > /dev/null || ret=1
|
||||
grep NXDOMAIN dig.out.ns1.test$n > /dev/null || ret=1
|
||||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
n=`expr $n + 1`
|
||||
|
||||
echo "I: check that updates to 'check-names warn;' succeed and are logged ($n)"
|
||||
ret=0
|
||||
$NSUPDATE -d <<END> nsupdate.out.test$n 2>&1|| ret=1
|
||||
server 10.53.0.1 5300
|
||||
update add xxx_xxx.warn.update. 600 A 10.10.10.1
|
||||
send
|
||||
END
|
||||
$DIG $DIGOPTS xxx_xxx.warn.update @10.53.0.1 A > dig.out.ns1.test$n || ret=1
|
||||
grep "xxx_xxx.warn.update/A: bad owner name (check-names)" ns1/named.run > /dev/null || ret=1
|
||||
grep NOERROR dig.out.ns1.test$n > /dev/null || ret=1
|
||||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
n=`expr $n + 1`
|
||||
|
||||
echo "I: check that updates to 'check-names ignore;' succeed and are not logged ($n)"
|
||||
ret=0
|
||||
not=1
|
||||
$NSUPDATE -d <<END> nsupdate.out.test$n 2>&1 || ret=1
|
||||
server 10.53.0.1 5300
|
||||
update add xxx_xxx.ignore.update. 600 A 10.10.10.1
|
||||
send
|
||||
END
|
||||
grep "xxx_xxx.ignore.update/A.*(check-names)" ns1/named.run > /dev/null || not=0
|
||||
if [ $not != 0 ]; then ret=1; fi
|
||||
$DIG $DIGOPTS xxx_xxx.ignore.update @10.53.0.1 A > dig.out.ns1.test$n || ret=1
|
||||
grep NOERROR dig.out.ns1.test$n > /dev/null || ret=1
|
||||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
n=`expr $n + 1`
|
||||
|
||||
exit $status
|
||||
Reference in New Issue
Block a user