Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

Commit 8806abc

Browse files
committed
test "delv +ns"
add tests for "delv +ns", with and without +qmin and with and without validation.
1 parent 15fd74f commit 8806abc

File tree

5 files changed

+74
-6
lines changed

5 files changed

+74
-6
lines changed

bin/tests/system/digdelv/clean.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
set -e
1515

16-
rm -f ./*/anchor.*
16+
rm -f ./anchor.* ./*/anchor.*
1717
rm -f ./*/named.conf
1818
rm -f ./*/named.memstats
1919
rm -f ./*/named.run
@@ -28,9 +28,10 @@ rm -f ./dig.out.nn.*
2828
rm -f ./host.out.test*
2929
rm -f ./ns*/managed-keys.bind*
3030
rm -f ./ns*/named.lock
31-
rm -f ./ns2/dsset-example.
32-
rm -f ./ns2/dsset-example.tld.
33-
rm -f ./ns2/example.db ./ns2/K* ./ns2/keyid ./ns2/keydata
31+
rm -f ./ns*/K* ./ns*/keyid ./ns*/keydata
32+
rm -f ./ns1/root.db
33+
rm -f ./ns*/dsset-*
34+
rm -f ./ns2/example.db
3435
rm -f ./ns2/example.tld.db
3536
rm -f ./nslookup.out.test*
3637
rm -f ./nsupdate.out.test*

bin/tests/system/digdelv/ns1/sign.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh -e
2+
3+
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
4+
#
5+
# SPDX-License-Identifier: MPL-2.0
6+
#
7+
# This Source Code Form is subject to the terms of the Mozilla Public
8+
# License, v. 2.0. If a copy of the MPL was not distributed with this
9+
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
10+
#
11+
# See the COPYRIGHT file distributed with this work for additional
12+
# information regarding copyright ownership.
13+
14+
# shellcheck source=conf.sh
15+
. ../../conf.sh
16+
17+
set -e
18+
19+
(cd ../ns2 && $SHELL sign.sh )
20+
21+
cp "../ns2/dsset-example." .
22+
23+
ksk=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone .)
24+
25+
cp root.db.in root.db
26+
27+
"$SIGNER" -Sgz -f root.db -o . root.db.in > /dev/null 2>&1
28+
29+
keyfile_to_key_id "$ksk" > keyid
30+
grep -Ev '^;' < "$ksk.key" | cut -f 7- -d ' ' > keydata
31+
keyfile_to_initial_keys "$ksk" > anchor.dnskey

bin/tests/system/digdelv/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ copy_setports ns1/named.conf.in ns1/named.conf
2020
copy_setports ns2/named.conf.in ns2/named.conf
2121
copy_setports ns3/named.conf.in ns3/named.conf
2222

23-
cd ns2 && $SHELL sign.sh
23+
cd ns1 && $SHELL sign.sh

bin/tests/system/digdelv/tests.sh

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ check_ttl_range() {
5454
return $result
5555
}
5656

57-
# using delv insecure mode as not testing dnssec here
57+
# use delv insecure mode by default, as we're mostly not testing dnssec
5858
delv_with_opts() {
5959
"$DELV" +noroot -p "$PORT" "$@"
6060
}
@@ -1404,6 +1404,42 @@ if [ -x "$DELV" ] ; then
14041404
if [ $ret -ne 0 ]; then echo_i "failed"; fi
14051405
status=$((status+ret))
14061406

1407+
n=$((n+1))
1408+
echo_i "checking delv +ns (no validation) ($n)"
1409+
ret=0
1410+
delv_with_opts -i +ns +hint=../common/root.hint a a.example > delv.out.test$n || ret=1
1411+
grep -q '; authoritative' delv.out.test$n || ret=1
1412+
grep -q '_.example' delv.out.test$n && ret=1
1413+
if [ $ret -ne 0 ]; then echo_i "failed"; fi
1414+
status=$((status+ret))
1415+
1416+
n=$((n+1))
1417+
echo_i "checking delv +ns +qmin (no validation) ($n)"
1418+
ret=0
1419+
delv_with_opts -i +ns +qmin +hint=../common/root.hint a a.example > delv.out.test$n || ret=1
1420+
grep -q '; authoritative' delv.out.test$n || ret=1
1421+
grep -q '_.example' delv.out.test$n || ret=1
1422+
if [ $ret -ne 0 ]; then echo_i "failed"; fi
1423+
status=$((status+ret))
1424+
1425+
n=$((n+1))
1426+
echo_i "checking delv +ns (with validation) ($n)"
1427+
ret=0
1428+
delv_with_opts -a ns1/anchor.dnskey +root +ns +hint=../common/root.hint a a.example > delv.out.test$n || ret=1
1429+
grep -q '; fully validated' delv.out.test$n || ret=1
1430+
grep -q '_.example' delv.out.test$n && ret=1
1431+
if [ $ret -ne 0 ]; then echo_i "failed"; fi
1432+
status=$((status+ret))
1433+
1434+
n=$((n+1))
1435+
echo_i "checking delv +ns +qmin (with validation) ($n)"
1436+
ret=0
1437+
delv_with_opts -a ns1/anchor.dnskey +root +ns +qmin +hint=../common/root.hint a a.example > delv.out.test$n || ret=1
1438+
grep -q '; fully validated' delv.out.test$n || ret=1
1439+
grep -q '_.example' delv.out.test$n || ret=1
1440+
if [ $ret -ne 0 ]; then echo_i "failed"; fi
1441+
status=$((status+ret))
1442+
14071443
else
14081444
echo_i "$DELV is needed, so skipping these delv tests"
14091445
fi

0 commit comments

Comments
 (0)