diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 64fb5fce13e..a0ca54c7906 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -845,6 +845,9 @@ def radvd_check_config(config_file): def networkd_invocation_id(): return check_output('systemctl show --value -p InvocationID systemd-networkd.service') +def networkd_pid(): + return check_output('systemctl show --value -p MainPID systemd-networkd.service') + def read_networkd_log(invocation_id=None, since=None): if not invocation_id: invocation_id = networkd_invocation_id() @@ -876,6 +879,9 @@ def stop_networkd(show_logs=True): def start_networkd(): check_output('systemctl start systemd-networkd') + invocation_id = networkd_invocation_id() + pid = networkd_pid() + print(f'Started systemd-networkd.service: PID={pid}, Invocation ID={invocation_id}') def restart_networkd(show_logs=True): global show_journal @@ -886,6 +892,10 @@ def restart_networkd(show_logs=True): if show_logs: print(read_networkd_log(invocation_id)) + invocation_id = networkd_invocation_id() + pid = networkd_pid() + print(f'Restarted systemd-networkd.service: PID={pid}, Invocation ID={invocation_id}') + def networkd_pid(): return int(check_output('systemctl show --value -p MainPID systemd-networkd.service'))