]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd-test: restart hostnamed after reverting /etc/hostname too
authorLennart Poettering <lennart@poettering.net>
Wed, 5 Dec 2018 20:59:38 +0000 (21:59 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 7 Dec 2018 11:25:24 +0000 (12:25 +0100)
Otherwise hostnamed will not report the right data in the next test

test/networkd-test.py

index 3f9d4b4dff45939adbb1d7b8bb61f94f6b00dace..0dc19a616e4901def2bb59494d549ff43d974be5 100755 (executable)
@@ -709,6 +709,7 @@ Domains= ~company ~lab''')
             subprocess.check_call(['mount', '--bind', '/dev/null', '/etc/hostname'])
             self.addCleanup(subprocess.call, ['umount', '/etc/hostname'])
         subprocess.check_call(['systemctl', 'stop', 'systemd-hostnamed.service'])
+        self.addCleanup(subprocess.call, ['systemctl', 'stop', 'systemd-hostnamed.service'])
 
         self.create_iface(dnsmasq_opts=['--dhcp-host={},192.168.5.210,testgreen'.format(self.iface_mac)])
         self.do_test(coldplug=None, extra_opts='IPv6AcceptRA=False', dhcp_mode='ipv4')
@@ -744,6 +745,7 @@ Domains= ~company ~lab''')
         if not os.path.exists('/etc/hostname'):
             self.write_config('/etc/hostname', orig_hostname)
         subprocess.check_call(['systemctl', 'stop', 'systemd-hostnamed.service'])
+        self.addCleanup(subprocess.call, ['systemctl', 'stop', 'systemd-hostnamed.service'])
 
         self.create_iface(dnsmasq_opts=['--dhcp-host={},192.168.5.210,testgreen'.format(self.iface_mac)])
         self.do_test(coldplug=None, extra_opts='IPv6AcceptRA=False', dhcp_mode='ipv4')