]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: fix TEST-74-AUX-UTILS.varlinkctl.sh (#37562)
authorIvan Kruglov <mail@ikruglov.com>
Thu, 22 May 2025 14:05:10 +0000 (07:05 -0700)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 22 May 2025 21:40:30 +0000 (22:40 +0100)
per Daan's explanation:
other subtests running as testuser apparently use systemd-run --user
--machine testuser@.host which turns user tracking in logind into "by
pin" mode. when the last pinning session exits it terminates the user.

test/units/TEST-74-AUX-UTILS.varlinkctl.sh

index 07b857e47db658d64eed3997cd72ca936474e883..83f8ac35327ddf06dabb17fd4c3d791f7f115d5f 100755 (executable)
@@ -173,7 +173,10 @@ varlinkctl introspect /run/systemd/io.systemd.Manager io.systemd.Manager
 varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Manager.Describe '{}'
 
 # test io.systemd.Manager in user manager
-systemctl start user@4711
-varlinkctl info /run/user/4711/systemd/io.systemd.Manager
-varlinkctl introspect /run/user/4711/systemd/io.systemd.Manager
-varlinkctl call /run/user/4711/systemd/io.systemd.Manager io.systemd.Manager.Describe '{}'
+testuser_uid=$(id -u testuser)
+systemd-run --wait --pipe --user --machine testuser@ \
+        varlinkctl info /run/user/"$testuser_uid"/systemd/io.systemd.Manager
+systemd-run --wait --pipe --user --machine testuser@ \
+        varlinkctl introspect /run/user/"$testuser_uid"/systemd/io.systemd.Manager
+systemd-run --wait --pipe --user --machine testuser@ \
+        varlinkctl call /run/user/"$testuser_uid"/systemd/io.systemd.Manager io.systemd.Manager.Describe '{}'