summaryrefslogtreecommitdiffstats
path: root/debian/patches/debian/test-disable-DnsmasqClientTest.test_resolved_etc_hosts-in.patch
blob: 0a483089f6d8779734138c470fd289a66073bedf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
From: Michael Biebl <biebl@debian.org>
Date: Mon, 18 Jan 2021 13:33:10 +0100
Subject: test: disable DnsmasqClientTest.test_resolved_etc_hosts in
 networkd-test.py

This test appears to be flaky.

See: #979716
---
 test/networkd-test.py | 108 +++++++++++++++++++++++++-------------------------
 1 file changed, 54 insertions(+), 54 deletions(-)

diff --git a/test/networkd-test.py b/test/networkd-test.py
index 8496ec8..ca158bf 100755
--- a/test/networkd-test.py
+++ b/test/networkd-test.py
@@ -674,60 +674,60 @@ Domains= ~company ~lab''')
         self.assertRegex(general_log, 'query.*megasearch.net')
         self.assertNotIn('megasearch.net', vpn_log)
 
-    def test_resolved_etc_hosts(self):
-        '''resolved queries to /etc/hosts'''
-
-        # FIXME: -t MX query fails with enabled DNSSEC (even when using
-        # the known negative trust anchor .internal instead of .example.com)
-        conf = '/run/systemd/resolved.conf.d/test-disable-dnssec.conf'
-        os.makedirs(os.path.dirname(conf), exist_ok=True)
-        with open(conf, 'w') as f:
-            f.write('[Resolve]\nDNSSEC=no\nLLMNR=no\nMulticastDNS=no\n')
-        self.addCleanup(os.remove, conf)
-
-        # create /etc/hosts bind mount which resolves my.example.com for IPv4
-        hosts = os.path.join(self.workdir, 'hosts')
-        with open(hosts, 'w') as f:
-            f.write('172.16.99.99  my.example.com\n')
-        subprocess.check_call(['mount', '--bind', hosts, '/etc/hosts'])
-        self.addCleanup(subprocess.call, ['umount', '/etc/hosts'])
-        subprocess.check_call(['systemctl', 'stop', 'systemd-resolved.service'])
-
-        # note: different IPv4 address here, so that it's easy to tell apart
-        # what resolved the query
-        self.create_iface(dnsmasq_opts=['--host-record=my.example.com,172.16.99.1,2600::99:99',
-                                        '--host-record=other.example.com,172.16.0.42,2600::42',
-                                        '--mx-host=example.com,mail.example.com'],
-                          ipv6=True)
-        self.do_test(coldplug=None, ipv6=True)
-
-        try:
-            # family specific queries
-            out = subprocess.check_output(['resolvectl', 'query', '-4', 'my.example.com'])
-            self.assertIn(b'my.example.com: 172.16.99.99', out)
-            # we don't expect an IPv6 answer; if /etc/hosts has any IP address,
-            # it's considered a sufficient source
-            self.assertNotEqual(subprocess.call(['resolvectl', 'query', '-6', 'my.example.com']), 0)
-            # "any family" query; IPv4 should come from /etc/hosts
-            out = subprocess.check_output(['resolvectl', 'query', 'my.example.com'])
-            self.assertIn(b'my.example.com: 172.16.99.99', out)
-            # IP → name lookup; again, takes the /etc/hosts one
-            out = subprocess.check_output(['resolvectl', 'query', '172.16.99.99'])
-            self.assertIn(b'172.16.99.99: my.example.com', out)
-
-            # non-address RRs should fall back to DNS
-            out = subprocess.check_output(['resolvectl', 'query', '--type=MX', 'example.com'])
-            self.assertIn(b'example.com IN MX 1 mail.example.com', out)
-
-            # other domains query DNS
-            out = subprocess.check_output(['resolvectl', 'query', 'other.example.com'])
-            self.assertIn(b'172.16.0.42', out)
-            out = subprocess.check_output(['resolvectl', 'query', '172.16.0.42'])
-            self.assertIn(b'172.16.0.42: other.example.com', out)
-        except (AssertionError, subprocess.CalledProcessError):
-            self.show_journal('systemd-resolved.service')
-            self.print_server_log()
-            raise
+#    def test_resolved_etc_hosts(self):
+#        '''resolved queries to /etc/hosts'''
+#
+#        # FIXME: -t MX query fails with enabled DNSSEC (even when using
+#        # the known negative trust anchor .internal instead of .example.com)
+#        conf = '/run/systemd/resolved.conf.d/test-disable-dnssec.conf'
+#        os.makedirs(os.path.dirname(conf), exist_ok=True)
+#        with open(conf, 'w') as f:
+#            f.write('[Resolve]\nDNSSEC=no\nLLMNR=no\nMulticastDNS=no\n')
+#        self.addCleanup(os.remove, conf)
+#
+#        # create /etc/hosts bind mount which resolves my.example.com for IPv4
+#        hosts = os.path.join(self.workdir, 'hosts')
+#        with open(hosts, 'w') as f:
+#            f.write('172.16.99.99  my.example.com\n')
+#        subprocess.check_call(['mount', '--bind', hosts, '/etc/hosts'])
+#        self.addCleanup(subprocess.call, ['umount', '/etc/hosts'])
+#        subprocess.check_call(['systemctl', 'stop', 'systemd-resolved.service'])
+#
+#        # note: different IPv4 address here, so that it's easy to tell apart
+#        # what resolved the query
+#        self.create_iface(dnsmasq_opts=['--host-record=my.example.com,172.16.99.1,2600::99:99',
+#                                        '--host-record=other.example.com,172.16.0.42,2600::42',
+#                                        '--mx-host=example.com,mail.example.com'],
+#                          ipv6=True)
+#        self.do_test(coldplug=None, ipv6=True)
+#
+#        try:
+#            # family specific queries
+#            out = subprocess.check_output(['resolvectl', 'query', '-4', 'my.example.com'])
+#            self.assertIn(b'my.example.com: 172.16.99.99', out)
+#            # we don't expect an IPv6 answer; if /etc/hosts has any IP address,
+#            # it's considered a sufficient source
+#            self.assertNotEqual(subprocess.call(['resolvectl', 'query', '-6', 'my.example.com']), 0)
+#            # "any family" query; IPv4 should come from /etc/hosts
+#            out = subprocess.check_output(['resolvectl', 'query', 'my.example.com'])
+#            self.assertIn(b'my.example.com: 172.16.99.99', out)
+#            # IP → name lookup; again, takes the /etc/hosts one
+#            out = subprocess.check_output(['resolvectl', 'query', '172.16.99.99'])
+#            self.assertIn(b'172.16.99.99: my.example.com', out)
+#
+#            # non-address RRs should fall back to DNS
+#            out = subprocess.check_output(['resolvectl', 'query', '--type=MX', 'example.com'])
+#            self.assertIn(b'example.com IN MX 1 mail.example.com', out)
+#
+#            # other domains query DNS
+#            out = subprocess.check_output(['resolvectl', 'query', 'other.example.com'])
+#            self.assertIn(b'172.16.0.42', out)
+#            out = subprocess.check_output(['resolvectl', 'query', '172.16.0.42'])
+#            self.assertIn(b'172.16.0.42: other.example.com', out)
+#        except (AssertionError, subprocess.CalledProcessError):
+#            self.show_journal('systemd-resolved.service')
+#            self.print_server_log()
+#            raise
 
     def test_transient_hostname(self):
         '''networkd sets transient hostname from DHCP'''