test logind restart

Add a simple check which ensures that a user service survives
a logind restart.
This commit is contained in:
Matteo Croce
2025-04-02 21:18:45 +02:00
committed by Yu Watanabe
parent 4dba936a03
commit 3ad3ee8e54

View File

@@ -785,6 +785,20 @@ testcase_varlink() {
varlinkctl introspect /run/systemd/io.systemd.Login
}
testcase_restart() {
local UNIT
UNIT=user-sleeper.service
systemd-run --service-type=notify run0 -u logind-test-user --unit="$UNIT" sleep infinity
systemctl restart systemd-logind
systemctl --quiet is-active "$UNIT"
loginctl | grep logind-test-user | grep -qw background
systemctl kill "$UNIT"
}
setup_test_user
test_write_dropin
run_testcases