Added test for the proposed fix
This test is very simple, two nameserver instances are created:
- ns4: master, with 'minimal-responses yes', authoritative
for example. zone
- ns5: slave, stub zone
The first thing verified is the transfer of zone data from master
to slave, which should be saved in ns5/example.db.
After that, a query is issued to ns5 asking for target.example.
TXT, a record present in the master database with the "test" string
as content.
If that query works, it means stub zone successfully request
nameserver addresses from master, ns4.example. A/AAAA
The presence of both A/AAAA records for ns4 is also verified in the
stub zone local file, ns5/example.db.
This commit is contained in:
@@ -60,5 +60,26 @@ digcomp knowngood.dig.out.rec dig.out.ns3 || ret=1
|
||||
}
|
||||
done
|
||||
|
||||
echo_i "check that glue record is correctly transferred from master when minimal-responses is on"
|
||||
ret=0
|
||||
# First ensure that zone data was transfered.
|
||||
for i in 1 2 3 4 5 6 7; do
|
||||
[ -f ns5/example.db ] && break
|
||||
sleep 1
|
||||
done
|
||||
|
||||
if [ -f ns5/example.db ]; then
|
||||
# If NS glue wasn't transferred, this query would fail.
|
||||
$DIG $DIGOPTS +nodnssec @10.53.0.5 target.example. txt > dig.out.ns5 || ret=1
|
||||
grep 'target\.example.*TXT.*"test"' dig.out.ns5 > /dev/null || ret=1
|
||||
# Ensure both ipv4 and ipv6 glue records were transferred.
|
||||
grep -E 'ns4[[:space:]]+A[[:space:]]+10.53.0.4' ns5/example.db > /dev/null || ret=1
|
||||
grep -E 'AAAA[[:space:]]+fd92:7065:b8e:ffff::4' ns5/example.db > /dev/null || ret=1
|
||||
[ $ret = 0 ] || { status=1; echo_i "failed"; }
|
||||
else
|
||||
status=1
|
||||
echo_i "failed: stub zone transfer failed ns4(master) <---> ns5/example.db"
|
||||
fi
|
||||
|
||||
echo_i "exit status: $status"
|
||||
[ $status -eq 0 ] || exit 1
|
||||
|
||||
Reference in New Issue
Block a user