]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: use "systemctl restart" to restart networkd 24305/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 13 Aug 2022 18:56:01 +0000 (03:56 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 13 Aug 2022 18:56:01 +0000 (03:56 +0900)
test/test-network/systemd-networkd-tests.py

index 4a3fe4279dc5447b54bb89981b183b23d1fdd0bb..ca96f7942825d2efffe36b4d3d6f19d74525666f 100755 (executable)
@@ -601,8 +601,11 @@ def start_networkd():
     check_output('systemctl start systemd-networkd')
 
 def restart_networkd(show_logs=True):
-    stop_networkd(show_logs)
-    start_networkd()
+    if show_logs:
+        invocation_id = check_output('systemctl show systemd-networkd.service -p InvocationID --value')
+    check_output('systemctl restart systemd-networkd.service')
+    if show_logs:
+        print(check_output('journalctl _SYSTEMD_INVOCATION_ID=' + invocation_id))
 
 def networkctl_reconfigure(*links):
     check_output(*networkctl_cmd, 'reconfigure', *links, env=env)