From: Pieter Lexis Date: Wed, 10 Jun 2020 08:20:06 +0000 (+0200) Subject: rec: Fix IPv6-outgoing-only zero-scope ECS test X-Git-Tag: rec-4.4.0-beta1~56^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8064abbb4674271d213354ca47d03d68b4cd100a;p=thirdparty%2Fpdns.git rec: Fix IPv6-outgoing-only zero-scope ECS test The recursor uses the outgoing address family to set the ECS address to a localhost address when a client indicates that it wants no ECS (by setting the all-zero scope). Now that we _actually_ do v6-only outgoing when requested by configuration, we need the regression test auths to listen on v6. This change to the regression tests makes the ROOT auth listen on [::1]:53, adds the hints, and for the ECS test, starts an IPv6 ECS echo responder on [::1]:53000 and uses that address for the forward-zone. --- diff --git a/regression-tests.recursor-dnssec/recursortests.py b/regression-tests.recursor-dnssec/recursortests.py index 83322a86a7..a918981038 100644 --- a/regression-tests.recursor-dnssec/recursortests.py +++ b/regression-tests.recursor-dnssec/recursortests.py @@ -50,6 +50,7 @@ log-common-errors=yes _roothints = """ . 3600 IN NS ns.root. ns.root. 3600 IN A %s.8 +ns.root. 3600 IN AAAA ::1 """ % _PREFIX _root_DS = "63149 13 1 a59da3f5c1b97fcd5fa2b3b2b0ac91d38a60d33a" @@ -498,7 +499,10 @@ distributor-threads={threads}""".format(confdir=confdir, authcmd = list(cls._auth_cmd) authcmd.append('--config-dir=%s' % confdir) authcmd.append('--local-address=%s' % ipaddress) - authcmd.append('--local-ipv6=') + if (confdir[-4:] == "ROOT"): + authcmd.append('--local-ipv6=::1') + else: + authcmd.append('--local-ipv6=') print(' '.join(authcmd)) logFile = os.path.join(confdir, 'pdns.log') diff --git a/regression-tests.recursor-dnssec/test_ECS.py b/regression-tests.recursor-dnssec/test_ECS.py index 9c9e6581a9..a4bdfffd20 100644 --- a/regression-tests.recursor-dnssec/test_ECS.py +++ b/regression-tests.recursor-dnssec/test_ECS.py @@ -14,6 +14,7 @@ nameECS = 'ecs-echo.example.' nameECSInvalidScope = 'invalid-scope.ecs-echo.example.' ttlECS = 60 ecsReactorRunning = False +ecsReactorv6Running = False class ECSTest(RecursorTest): _config_template_default = """ @@ -62,6 +63,7 @@ disable-syslog=yes @classmethod def startResponders(cls): global ecsReactorRunning + global ecsReactorv6Running print("Launching responders..") address = cls._PREFIX + '.21' @@ -71,6 +73,10 @@ disable-syslog=yes reactor.listenUDP(port, UDPECSResponder(), interface=address) ecsReactorRunning = True + if not ecsReactorv6Running: + reactor.listenUDP(53000, UDPECSResponder(), interface='::1') + ecsReactorv6Running = True + if not reactor.running: cls._UDPResponder = threading.Thread(name='UDP Responder', target=reactor.run, args=(False,)) cls._UDPResponder.setDaemon(True) @@ -349,8 +355,9 @@ use-incoming-edns-subnet=yes ecs-ipv6-bits=128 ecs-ipv4-cache-bits=32 ecs-ipv6-cache-bits=128 -forward-zones=ecs-echo.example=%s.21 - """ % (os.environ['PREFIX']) +query-local-address=::1 +forward-zones=ecs-echo.example=[::1]:53000 + """ def testSendECS(self): expected = dns.rrset.from_text(nameECS, ttlECS, dns.rdataclass.IN, 'TXT', '2001:db8::1/128')