core: add varlink Reload/Reexecute methods (#39561)

Same as the D-Bus ones
This commit is contained in:
Yu Watanabe
2025-11-15 04:17:01 +09:00
committed by GitHub
11 changed files with 182 additions and 22 deletions
+4
View File
@@ -89,6 +89,9 @@ systemctl daemon-reload
# The timeout will hit (and the test will fail) if the reloads are not rate-limited
timeout 15 bash -c 'while systemctl daemon-reload --no-block; do true; done'
# Same for varlink, rate limiting is shared
timeout 15 bash -c 'while varlinkctl call --timeout=1 /run/systemd/io.systemd.Manager io.systemd.Manager.Reload '{}'; do true; done'
# Rate limit should reset after 9s
sleep 10
@@ -96,6 +99,7 @@ systemctl daemon-reload
# Same test for reexec, but we wait here
timeout 15 bash -c 'while systemctl daemon-reexec; do true; done'
timeout 15 bash -c 'while varlinkctl call --timeout=infinity /run/systemd/io.systemd.Manager io.systemd.Manager.Reload '{}'; do true; done'
# Rate limit should reset after 9s
sleep 10
@@ -184,6 +184,9 @@ rm /tmp/describe1.json /tmp/describe2.json
varlinkctl info /run/systemd/io.systemd.Manager
varlinkctl introspect /run/systemd/io.systemd.Manager io.systemd.Manager
varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Manager.Describe '{}'
varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Manager.Reload '{}'
# This will disconnect and fail, as the manager reexec and drops connections
varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Manager.Reexecute '{}' ||:
# test io.systemd.Network
varlinkctl info /run/systemd/netif/io.systemd.Network