test-network: stop service before editing unit file
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 31 May 2019 00:52:27 +0000 (09:52 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 31 May 2019 00:52:48 +0000 (09:52 +0900)
test/test-network/systemd-networkd-tests.py

index d39df36..692bd19 100755 (executable)
@@ -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)