From 6aa57233e5981473efb4fdc4351d8f407b0b5384 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Fri, 8 Jul 2022 13:36:03 +0200 Subject: [PATCH] test: cover IPv6 in the resolved test suite (cherry picked from commit 5c9111fe779b44745256279052786e9cc499e57a) Related: #2138081 --- test/knot-data/knot.conf | 3 + test/knot-data/zones/onlinesign.test.zone | 15 ++- test/knot-data/zones/root.zone | 8 +- test/knot-data/zones/signed.test.zone | 23 ++-- test/knot-data/zones/test.zone | 12 +- test/knot-data/zones/unsigned.test.zone | 12 +- test/knot-data/zones/untrusted.test.zone | 11 +- test/units/testsuite-75.sh | 135 ++++++++++++++++++---- 8 files changed, 169 insertions(+), 50 deletions(-) diff --git a/test/knot-data/knot.conf b/test/knot-data/knot.conf index e3de69d0f4..6ea0cca3db 100644 --- a/test/knot-data/knot.conf +++ b/test/knot-data/knot.conf @@ -4,6 +4,7 @@ server: rundir: "/run/knot" user: knot:knot listen: 10.0.0.1@53 + listen: fd00:dead:beef:cafe::1@53 log: - target: syslog @@ -15,11 +16,13 @@ database: acl: - id: update_acl address: 10.0.0.0/24 + address: fd00:dead:beef:cafe::/64 action: update remote: - id: parent_zone_server address: 10.0.0.1@53 + address: fd00:dead:beef:cafe::1@53 submission: - id: parent_zone_sbm diff --git a/test/knot-data/zones/onlinesign.test.zone b/test/knot-data/zones/onlinesign.test.zone index c12c6b3396..c8662fa3ed 100644 --- a/test/knot-data/zones/onlinesign.test.zone +++ b/test/knot-data/zones/onlinesign.test.zone @@ -11,12 +11,17 @@ $ORIGIN onlinesign.test. ) ; NS info - NS ns1.unsigned.test. + NS ns1.unsigned.test. - TXT "hello from onlinesign" + TXT "hello from onlinesign" -*.wild TXT "this is an onlinesign wildcard" +*.wild TXT "this is an onlinesign wildcard" ; No A/AAAA record for the $ORIGIN -sub A 10.0.0.133 -secondsub A 10.0.0.134 +sub A 10.0.0.133 +secondsub A 10.0.0.134 + +dual A 10.0.0.135 +dual AAAA fd00:dead:beef:cafe::135 + +ipv6 AAAA fd00:dead:beef:cafe::136 diff --git a/test/knot-data/zones/root.zone b/test/knot-data/zones/root.zone index 72439fdc55..f601e8676d 100644 --- a/test/knot-data/zones/root.zone +++ b/test/knot-data/zones/root.zone @@ -8,7 +8,9 @@ $TTL 300 1D ; minimum TTL ) -. NS ns1.unsigned.test -ns1.unsigned.test A 10.0.0.1 +. NS ns1.unsigned.test +; NS glue records +ns1.unsigned.test A 10.0.0.1 +ns1.unsigned.test AAAA fd00:dead:beef:cafe::1 -test NS ns1.unsigned.test +test NS ns1.unsigned.test diff --git a/test/knot-data/zones/signed.test.zone b/test/knot-data/zones/signed.test.zone index 38d8e2aa13..fa6706205a 100644 --- a/test/knot-data/zones/signed.test.zone +++ b/test/knot-data/zones/signed.test.zone @@ -11,18 +11,27 @@ $ORIGIN signed.test. ) ; NS info - NS ns1.unsigned.test. + NS ns1.unsigned.test. -*.wild TXT "this is a wildcard" +*.wild TXT "this is a wildcard" -@ MX 10 mail.signed.test. +@ MX 10 mail.signed.test. - A 10.0.0.10 -mail A 10.0.0.11 + A 10.0.0.10 +mail A 10.0.0.11 +mail AAAA fd00:dead:beef:cafe::11 ; https://github.com/systemd/systemd/issues/22002 -dupe A 10.0.0.12 -dupe A 10.0.0.13 +dupe A 10.0.0.12 +dupe A 10.0.0.13 +dupe-ipv6 AAAA fd00:dead:beef:cafe::12 +dupe-ipv6 AAAA fd00:dead:beef:cafe::13 +dupe-mixed A 10.0.0.15 +dupe-mixed A 10.0.0.16 +dupe-mixed A 10.0.0.17 +dupe-mixed AAAA fd00:dead:beef:cafe::15 +dupe-mixed AAAA fd00:dead:beef:cafe::16 +dupe-mixed AAAA fd00:dead:beef:cafe::17 ; CNAME_REDIRECTS_MAX is 16, so let's test something close to that cname-chain CNAME follow1.signed.test. diff --git a/test/knot-data/zones/test.zone b/test/knot-data/zones/test.zone index 6cc2633082..ba5fcebc2d 100644 --- a/test/knot-data/zones/test.zone +++ b/test/knot-data/zones/test.zone @@ -11,9 +11,11 @@ $ORIGIN test. ) ; NS info -@ NS ns1.unsigned -ns1.signed A 10.0.0.1 +@ NS ns1.unsigned +; NS glue records +ns1.unsigned A 10.0.0.1 +ns1.unsigned AAAA fd00:dead:beef:cafe::1 -onlinesign NS ns1.unsigned -signed NS ns1.unsigned -unsigned NS ns1.unsigned +onlinesign NS ns1.unsigned +signed NS ns1.unsigned +unsigned NS ns1.unsigned diff --git a/test/knot-data/zones/unsigned.test.zone b/test/knot-data/zones/unsigned.test.zone index 87d9437e2c..c5445d7672 100644 --- a/test/knot-data/zones/unsigned.test.zone +++ b/test/knot-data/zones/unsigned.test.zone @@ -11,10 +11,12 @@ $ORIGIN unsigned.test. ) ; NS info -@ NS ns1.unsigned.test. -ns1 A 10.0.0.1 +@ NS ns1 +ns1 A 10.0.0.1 +ns1 AAAA fd00:dead:beef:cafe::1 -@ MX 15 mail.unsigned.test. +@ MX 15 mail.unsigned.test. - A 10.0.0.101 -mail A 10.0.0.111 + A 10.0.0.101 + AAAA fd00:dead:beef:cafe::101 +mail A 10.0.0.111 diff --git a/test/knot-data/zones/untrusted.test.zone b/test/knot-data/zones/untrusted.test.zone index 6d29bd77fe..cf0dec5296 100644 --- a/test/knot-data/zones/untrusted.test.zone +++ b/test/knot-data/zones/untrusted.test.zone @@ -11,11 +11,12 @@ $ORIGIN untrusted.test. ) ; NS info -@ NS ns1.unsigned.test. +@ NS ns1.unsigned.test. -*.wild TXT "this is an untrusted wildcard" +*.wild TXT "this is an untrusted wildcard" -@ MX 10 mail.untrusted.test. +@ MX 10 mail.untrusted.test. - A 10.0.0.121 -mail A 10.0.0.121 + A 10.0.0.121 + AAAA fd00:dead:beef:cafe::121 +mail A 10.0.0.122 diff --git a/test/units/testsuite-75.sh b/test/units/testsuite-75.sh index 852caac605..76b8f5b3c7 100755 --- a/test/units/testsuite-75.sh +++ b/test/units/testsuite-75.sh @@ -2,6 +2,12 @@ # SPDX-License-Identifier: LGPL-2.1-or-later # vi: ts=4 sw=4 tw=0 et: +# TODO: +# - IPv6-only stack +# - mDNS +# - LLMNR +# - DoT/DoH + set -eux set -o pipefail @@ -16,6 +22,15 @@ run() { "$@" |& tee "$RUN_OUT" } +disable_ipv6() { + sysctl -w net.ipv6.conf.all.disable_ipv6=1 +} + +enable_ipv6() { + sysctl -w net.ipv6.conf.all.disable_ipv6=0 + networkctl reconfigure dns0 +} + monitor_check_rr() ( set +x set +o pipefail @@ -146,7 +161,10 @@ ip link del hoge.foo ### SETUP ### # Configure network hostnamectl hostname ns1.unsigned.test -echo "10.0.0.1 ns1.unsigned.test" >>/etc/hosts +{ + echo "10.0.0.1 ns1.unsigned.test" + echo "fd00:dead:beef:cafe::1 ns1.unsigned.test" +} >>/etc/hosts mkdir -p /etc/systemd/network cat >/etc/systemd/network/dns0.netdev <