test-network: stop service before editing unit file
This commit is contained in:
parent
fa4c6095d7
commit
d4fda2a55c
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue