test-network: stop service before editing unit file

This commit is contained in:
Yu Watanabe 2019-05-31 09:52:27 +09:00
parent fa4c6095d7
commit d4fda2a55c
1 changed files with 4 additions and 1 deletions

View File

@ -87,6 +87,7 @@ def setUpModule():
copytree(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'conf'), networkd_ci_path)
subprocess.check_call('systemctl stop systemd-networkd.socket', shell=True)
subprocess.check_call('systemctl stop systemd-networkd.service', shell=True)
drop_in = [
'[Service]',
@ -122,10 +123,12 @@ def setUpModule():
def tearDownModule():
shutil.rmtree(networkd_ci_path)
subprocess.check_call('systemctl stop systemd-networkd.service', shell=True)
shutil.rmtree('/run/systemd/system/systemd-networkd.service.d')
subprocess.check_call('systemctl daemon-reload', shell=True)
subprocess.check_call('systemctl stop systemd-networkd.service', shell=True)
subprocess.check_call('systemctl start systemd-networkd.socket', shell=True)
subprocess.check_call('systemctl start systemd-networkd.service', shell=True)