From: Zbigniew Jędrzejewski-Szmek Date: Wed, 19 Nov 2025 14:57:29 +0000 (+0100) Subject: test/TEST-74-AUX-UTILS: fix racy check X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8d50438ba56100d6d855442210d145194b84b37b;p=thirdparty%2Fsystemd.git test/TEST-74-AUX-UTILS: fix racy check We were getting a list of invocation IDs, picking one at random, and then querying the unit. This is obviously racy. TEST-74-AUX-UTILS.sh[2873]: + varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Unit.List '{"invocationID": "2052c9a5-7983-4f72-9910-c49e38c91dab"}' TEST-74-AUX-UTILS.sh[3707]: Method call io.systemd.Unit.List() failed: io.systemd.Unit.NoSuchUnit The complicated varlink + jq callout is replaced by a simple systemctl call. I think that's better to avoid a complicated jq expression. Fixes https://github.com/systemd/systemd/issues/38647. --- diff --git a/test/units/TEST-74-AUX-UTILS.varlinkctl.sh b/test/units/TEST-74-AUX-UTILS.varlinkctl.sh index 62c1f19c323..3d23a532535 100755 --- a/test/units/TEST-74-AUX-UTILS.varlinkctl.sh +++ b/test/units/TEST-74-AUX-UTILS.varlinkctl.sh @@ -207,7 +207,7 @@ varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Unit.List '{"name": " (! varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Unit.List '{"name": "multi-user.target", "pid": {"pid": 1}}') varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Unit.List '{"cgroup": "/init.scope"}' -invocation_id=$(varlinkctl call --collect /run/systemd/io.systemd.Manager io.systemd.Unit.List '{}' | jq -r '.[] | .runtime.InvocationID' | grep -v null | tail -n 1) +invocation_id="$(systemctl show -P InvocationID systemd-journald.service)" varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Unit.List "{\"invocationID\": \"$invocation_id\"}" # test io.systemd.Manager in user manager