core: add varlink Reload/Reexecute methods

Same as the D-Bus ones
This commit is contained in:
Luca Boccassi
2025-11-03 00:44:57 +00:00
parent 00c084fe02
commit 55a1b36e91
10 changed files with 153 additions and 2 deletions

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

View File

@@ -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