kumquat-buildroot/support
Romain Naour 084cc7df3f support/testing: TestPolkitSystemd: fix systemctl exit code check on failure
As reported by [1] [2], the return code of systemctl command between
systemd 253 and 254 has changed when the polkit authentication is
refused:

/bin/systemctl restart systemd-timesyncd.service

The return code changed from 1 to 4. The Polkit test case
"TestPolkitSystemd" expected 1 as return code [3].

The service log is not the same either:

systemd v253:
Failed to restart systemd-timesyncd.service: Interactive authentication required.

systemd v254:
Failed to restart systemd-timesyncd.service: Access denied

git bisect report this commit:
959301cf9f

From the PR (to get more context):
https://github.com/systemd/systemd/pull/26365

Note: systemd doesn't recommend using systemctl exit code to check unit states:
"The mapping of LSB service states to systemd unit states is imperfect, so it is better to
not rely on those return values but to look for specific unit states and substates instead."

Since we only want to check if the command failed, update our test to
check if systemctl returned a non zero code whatever the reason of the
failure.

Thanks to Yann E. MORIN for the brainstorming!

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561464 (TestPolkitSystemd)

[1] http://lists.busybox.net/pipermail/buildroot/2023-August/671900.html
[2] https://lists.freedesktop.org/archives/systemd-devel/2023-August/049362.html
[3] https://git.buildroot.net/buildroot/tree/support/testing/tests/package/test_polkit.py?h=2023.08-rc1#n45
[4] https://github.com/systemd/systemd/blob/v254/man/systemctl.xml#L2612

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2023-08-09 19:21:27 +02:00
..
config-fragments support/config-fragments/autobuild/br-arm-internal-glibc: update to bleeding edge components 2023-05-21 17:52:14 +02:00
dependencies support/dependencies/dependencies.sh: require IPC::Cmd perl package for libopenssl 2023-07-18 22:41:31 +02:00
docker support/docker: use APT::Retries in apt-get calls to retry 2023-02-07 18:14:59 +01:00
download support/download: fix the cargo post-process in face of failed vendoring 2023-02-12 09:39:19 +01:00
gnuconfig support/gnuconfig: fix previous version bump 2020-09-27 18:30:05 +02:00
kconfig support/kconfig: fix compiler warnings 2021-10-06 21:11:09 +02:00
legal-info boot, package, support, toolchain: switch to 2 spaces for the hash file 2022-07-28 23:05:23 +02:00
libtool support/libtool: add patch for newer versions 2014-12-21 13:21:56 +01:00
misc support/misc/gitlab-ci.yml.in: pass emulator builtin binaries as artifacts 2023-07-18 23:03:23 +02:00
scripts support/misc/gitlab-ci.yml.in: pass emulator builtin binaries as artifacts 2023-07-18 23:03:23 +02:00
testing support/testing: TestPolkitSystemd: fix systemctl exit code check on failure 2023-08-09 19:21:27 +02:00