mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 13:38:26 +00:00
Add stub test
This commit is contained in:
parent
9381314895
commit
e7ddc97b45
23
bin/tests/system/stub/clean.sh
Normal file
23
bin/tests/system/stub/clean.sh
Normal file
@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2000 Internet Software Consortium.
|
||||
#
|
||||
# Permission to use, copy, modify, and 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 INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
||||
# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
||||
# CONSORTIUM 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.
|
||||
|
||||
#
|
||||
# Clean up after zone transfer tests.
|
||||
#
|
||||
|
||||
rm -f ns2/child.example.st dig.out.ns2
|
||||
|
21
bin/tests/system/stub/knowngood.dig.out.norec
Normal file
21
bin/tests/system/stub/knowngood.dig.out.norec
Normal file
@ -0,0 +1,21 @@
|
||||
|
||||
; <<>> DiG 8.2 <<>> -p @10.53.0.3 +norec data.child.example txt
|
||||
; (1 server found)
|
||||
;; res options: init defnam dnsrch
|
||||
;; got answer:
|
||||
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 216
|
||||
;; flags: qr ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
|
||||
;; QUERY SECTION:
|
||||
;; data.child.example, type = TXT, class = IN
|
||||
|
||||
;; AUTHORITY SECTION:
|
||||
child.example. 5M IN NS ns2.child.example.
|
||||
|
||||
;; ADDITIONAL SECTION:
|
||||
ns2.child.example. 5M IN A 10.53.0.2
|
||||
|
||||
;; Total query time: 3 msec
|
||||
;; FROM: draco to SERVER: 10.53.0.3
|
||||
;; WHEN: Wed Jun 21 10:58:37 2000
|
||||
;; MSG SIZE sent: 36 rcvd: 70
|
||||
|
24
bin/tests/system/stub/knowngood.dig.out.rec
Normal file
24
bin/tests/system/stub/knowngood.dig.out.rec
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
; <<>> DiG 8.2 <<>> -p @10.53.0.3 data.child.example txt
|
||||
; (1 server found)
|
||||
;; res options: init recurs defnam dnsrch
|
||||
;; got answer:
|
||||
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6
|
||||
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
|
||||
;; QUERY SECTION:
|
||||
;; data.child.example, type = TXT, class = IN
|
||||
|
||||
;; ANSWER SECTION:
|
||||
data.child.example. 5M IN TXT "some" "test" "data"
|
||||
|
||||
;; AUTHORITY SECTION:
|
||||
child.example. 5M IN NS ns2.child.example.
|
||||
|
||||
;; ADDITIONAL SECTION:
|
||||
ns2.child.example. 5M IN A 10.53.0.2
|
||||
|
||||
;; Total query time: 8 msec
|
||||
;; FROM: draco to SERVER: 10.53.0.3
|
||||
;; WHEN: Wed Jun 21 10:58:54 2000
|
||||
;; MSG SIZE sent: 36 rcvd: 97
|
||||
|
15
bin/tests/system/stub/ns1/named.conf
Normal file
15
bin/tests/system/stub/ns1/named.conf
Normal file
@ -0,0 +1,15 @@
|
||||
options {
|
||||
query-source address 10.53.0.1;
|
||||
port 5300;
|
||||
directory ".";
|
||||
pid-file "named.pid";
|
||||
listen-on { 10.53.0.1; };
|
||||
listen-on-v6 {none;};
|
||||
recursion no;
|
||||
notify yes;
|
||||
};
|
||||
|
||||
zone "." {
|
||||
type master;
|
||||
file "root.db";
|
||||
};
|
13
bin/tests/system/stub/ns1/root.db
Normal file
13
bin/tests/system/stub/ns1/root.db
Normal file
@ -0,0 +1,13 @@
|
||||
$TTL 300
|
||||
. IN SOA gson.nominum.com. a.root.servers.nil. (
|
||||
2000042100 ; serial
|
||||
600 ; refresh
|
||||
600 ; retry
|
||||
1200 ; expire
|
||||
600 ; minimum
|
||||
)
|
||||
. NS a.root-servers.nil.
|
||||
a.root-servers.nil. A 10.53.0.1
|
||||
|
||||
example. NS ns3.example.
|
||||
ns3.example. A 10.53.0.3
|
11
bin/tests/system/stub/ns2/child.example.db
Normal file
11
bin/tests/system/stub/ns2/child.example.db
Normal file
@ -0,0 +1,11 @@
|
||||
$TTL 300 ; 5 minutes
|
||||
child.example. IN SOA ns2.child.example. hostmaster.child.example. (
|
||||
2000042795 ; serial
|
||||
20 ; refresh (20 seconds)
|
||||
20 ; retry (20 seconds)
|
||||
1814400 ; expire (3 weeks)
|
||||
3600 ; minimum (1 hour)
|
||||
)
|
||||
child.example. NS ns2.child.example.
|
||||
ns2.child.example. A 10.53.0.2
|
||||
data TXT some test data
|
19
bin/tests/system/stub/ns2/named.conf
Normal file
19
bin/tests/system/stub/ns2/named.conf
Normal file
@ -0,0 +1,19 @@
|
||||
options {
|
||||
query-source address 10.53.0.2;
|
||||
port 5300;
|
||||
pid-file "named.pid";
|
||||
listen-on { 10.53.0.2; };
|
||||
listen-on-v6 {none;};
|
||||
recursion no;
|
||||
notify yes;
|
||||
};
|
||||
|
||||
zone "." {
|
||||
type hint;
|
||||
file "root.hint";
|
||||
};
|
||||
|
||||
zone "child.example" {
|
||||
type master;
|
||||
file "child.example.db";
|
||||
};
|
3
bin/tests/system/stub/ns2/root.hint
Normal file
3
bin/tests/system/stub/ns2/root.hint
Normal file
@ -0,0 +1,3 @@
|
||||
$TTL 999999
|
||||
. IN NS a.root-servers.nil.
|
||||
a.root-servers.nil. IN A 10.53.0.1
|
11
bin/tests/system/stub/ns3/example.db
Normal file
11
bin/tests/system/stub/ns3/example.db
Normal file
@ -0,0 +1,11 @@
|
||||
$ORIGIN .
|
||||
$TTL 300 ; 5 minutes
|
||||
example IN SOA ns3.example. hostmaster.example. (
|
||||
2000042795 ; serial
|
||||
20 ; refresh (20 seconds)
|
||||
20 ; retry (20 seconds)
|
||||
1814400 ; expire (3 weeks)
|
||||
3600 ; minimum (1 hour)
|
||||
)
|
||||
example. NS ns3.example.
|
||||
ns3.example. A 10.53.0.3
|
26
bin/tests/system/stub/ns3/named.conf
Normal file
26
bin/tests/system/stub/ns3/named.conf
Normal file
@ -0,0 +1,26 @@
|
||||
options {
|
||||
query-source address 10.53.0.3;
|
||||
port 5300;
|
||||
directory ".";
|
||||
pid-file "named.pid";
|
||||
listen-on { 10.53.0.3; };
|
||||
listen-on-v6 {none;};
|
||||
recursion yes;
|
||||
notify yes;
|
||||
};
|
||||
|
||||
zone "." {
|
||||
type hint;
|
||||
file "root.hint";
|
||||
};
|
||||
|
||||
zone "example" {
|
||||
type master;
|
||||
file "example.db";
|
||||
};
|
||||
|
||||
zone "child.example" {
|
||||
type stub;
|
||||
file "child.example.st";
|
||||
masters { 10.53.0.2; };
|
||||
};
|
3
bin/tests/system/stub/ns3/root.hint
Normal file
3
bin/tests/system/stub/ns3/root.hint
Normal file
@ -0,0 +1,3 @@
|
||||
$TTL 999999
|
||||
. IN NS a.root-servers.nil.
|
||||
a.root-servers.nil. IN A 10.53.0.1
|
50
bin/tests/system/stub/tests.sh
Normal file
50
bin/tests/system/stub/tests.sh
Normal file
@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2000 Internet Software Consortium.
|
||||
#
|
||||
# Permission to use, copy, modify, and 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 INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
||||
# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
||||
# CONSORTIUM 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.
|
||||
|
||||
SYSTEMTESTTOP=..
|
||||
. $SYSTEMTESTTOP/conf.sh
|
||||
|
||||
#
|
||||
# Perform tests
|
||||
#
|
||||
|
||||
# sleep 5
|
||||
|
||||
status=0;
|
||||
$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd data.child.example. \
|
||||
@10.53.0.3 axfr -p 5300 > dig.out.ns3
|
||||
status=`expr $status + $?`
|
||||
grep "; Transfer failed." dig.out.ns3
|
||||
status=`expr $status + $?`
|
||||
|
||||
$DIG +tcp +nosea +nostat +noquest +nocomm +nocmd +norec \
|
||||
data.child.example. @10.53.0.3 txt -p 5300 > dig.out.ns3
|
||||
status=`expr $status + $?`
|
||||
$PERL ../digcomp.pl knowngood.dig.out.norec dig.out.ns3
|
||||
status=`expr $status + $?`
|
||||
|
||||
$DIG +tcp +nosea +nostat +noquest +nocomm +nocmd +rec \
|
||||
data.child.example. @10.53.0.3 txt -p 5300 > dig.out.ns3
|
||||
status=`expr $status + $?`
|
||||
$PERL ../digcomp.pl knowngood.dig.out.rec dig.out.ns3
|
||||
status=`expr $status + $?`
|
||||
|
||||
if [ $status != 0 ]; then
|
||||
echo "R:FAIL"
|
||||
else
|
||||
echo "R:PASS"
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user