summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-12-05 21:59:38 +0100
committerLennart Poettering <lennart@poettering.net>2018-12-07 12:25:24 +0100
commit8e0ba0c984bc39e76d993c64bf6efd427268613d (patch)
treef9b900df8eb0856b19da7b13fcdf0e2837173f48
parentnetworkd-test: add write_config() (diff)
downloadsystemd-8e0ba0c984bc39e76d993c64bf6efd427268613d.tar.xz
systemd-8e0ba0c984bc39e76d993c64bf6efd427268613d.zip
networkd-test: restart hostnamed after reverting /etc/hostname too
Otherwise hostnamed will not report the right data in the next test
-rwxr-xr-xtest/networkd-test.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/networkd-test.py b/test/networkd-test.py
index 3f9d4b4dff..0dc19a616e 100755
--- a/test/networkd-test.py
+++ b/test/networkd-test.py
@@ -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')