]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd-test: fix test_dropin() 11784/head
authorMartin Pitt <martin@piware.de>
Thu, 21 Feb 2019 11:34:23 +0000 (12:34 +0100)
committerMartin Pitt <martin@piware.de>
Thu, 21 Feb 2019 11:37:08 +0000 (12:37 +0100)
 - This test needs resolved, so make sure it is started. In some Debian
   environments it is not.
 - It was an unnecessary, and now failing assumption that name servers
   get atomically written to the resolved's resolv.conf. Wait until both
   expected name servers are in the file.

test/networkd-test.py

index c03e76052f76fa35602116aad4538b3b6827fac7..9487910b71c3821e9168cf88e4ff3f614f6d62d6 100755 (executable)
@@ -950,12 +950,12 @@ DNS=192.168.42.1''')
 [Network]
 DNS=127.0.0.1''')
 
-        subprocess.check_call(['systemctl', 'start', 'systemd-networkd'])
+        subprocess.check_call(['systemctl', 'start', 'systemd-resolved', 'systemd-networkd'])
 
         for timeout in range(50):
             with open(RESOLV_CONF) as f:
                 contents = f.read()
-            if ' 127.0.0.1' in contents:
+            if ' 127.0.0.1' in contents and '192.168.42.1' in contents:
                 break
             time.sleep(0.1)
         self.assertIn('nameserver 192.168.42.1\n', contents)