networkd-test: restart hostnamed after reverting /etc/hostname too

Otherwise hostnamed will not report the right data in the next test
This commit is contained in:
Lennart Poettering 2018-12-05 21:59:38 +01:00
parent fef740aed3
commit 8e0ba0c984
1 changed files with 2 additions and 0 deletions

View File

@ -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')