networkd-test: fix resolved_domain_restricted_dns

Cherry-pick upstream commit which hopefully fixes the flakiness in
DnsmasqClientTest.test_resolved_domain_restricted_dns.
This commit is contained in:
Michael Biebl 2021-10-01 10:07:17 +02:00
parent 6dc0a62f30
commit 4200ce2eb0
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,50 @@
From: Michael Biebl <biebl@debian.org>
Date: Fri, 1 Oct 2021 01:00:28 +0200
Subject: networkd-test: fix resolved_domain_restricted_dns
megasearch.net was meant to be a non-existing bogus domain, and had been
for a long time. But it seems some domain grabber recently registered
it, and it's an actual thing now:
$ host megasearch.net
megasearch.net has address 207.148.248.143
This causes the test to fail randomly.
Use search.example.com instead which yields
$ host search.example.com
Host search.example.com not found: 3(NXDOMAIN)
Fixes: #18357
(cherry picked from commit 528dd6a42389fcf4aa490c0fa0d858772e930d13)
---
test/networkd-test.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/networkd-test.py b/test/networkd-test.py
index 8496ec8..8cdb600 100755
--- a/test/networkd-test.py
+++ b/test/networkd-test.py
@@ -656,8 +656,8 @@ Domains= ~company ~lab''')
self.assertIn(b'kettle.cantina.company: 10.241.4.4', out)
# test general domains
- out = subprocess.check_output(['resolvectl', 'query', 'megasearch.net'])
- self.assertIn(b'megasearch.net: 192.168.42.1', out)
+ out = subprocess.check_output(['resolvectl', 'query', 'search.example.com'])
+ self.assertIn(b'search.example.com: 192.168.42.1', out)
with open(self.dnsmasq_log) as f:
general_log = f.read()
@@ -671,8 +671,8 @@ Domains= ~company ~lab''')
self.assertNotIn('.company', general_log)
# general domains should not be sent to the VPN DNS
- self.assertRegex(general_log, 'query.*megasearch.net')
- self.assertNotIn('megasearch.net', vpn_log)
+ self.assertRegex(general_log, 'query.*search.example.com')
+ self.assertNotIn('search.example.com', vpn_log)
def test_resolved_etc_hosts(self):
'''resolved queries to /etc/hosts'''

View File

@ -4,6 +4,7 @@ rules-Move-ID_SMARTCARD_READER-definition-to-a-70-configu.patch
table-drop-trailing-white-spaces-of-the-last-cell-in-row.patch
basic-unit-name-adjust-comments.patch
test-fix-TEST-10-ISSUE-2467.patch
networkd-test-fix-resolved_domain_restricted_dns.patch
debian/Use-Debian-specific-config-files.patch
debian/Bring-tmpfiles.d-tmp.conf-in-line-with-Debian-defaul.patch
debian/Make-run-lock-tmpfs-an-API-fs.patch