Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Romain Naour <romain.naour@smile.fr>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] support/testing: TestPolkitSystemd: fix systemctl exit code check on failure
Date: Wed, 9 Aug 2023 19:40:22 +0200	[thread overview]
Message-ID: <20230809194022.5835baef@windsurf> (raw)
In-Reply-To: <20230809132622.39045-1-romain.naour@smile.fr>

On Wed,  9 Aug 2023 15:26:22 +0200
Romain Naour <romain.naour@smile.fr> wrote:

> 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:
> https://github.com/systemd/systemd/commit/959301cf9f42418314abf027183dc25c08731b82
> 
> 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>
> ---

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2023-08-09 17:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09 13:26 [Buildroot] [PATCH] support/testing: TestPolkitSystemd: fix systemctl exit code check on failure Romain Naour
2023-08-09 17:40 ` Thomas Petazzoni via buildroot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230809194022.5835baef@windsurf \
    --to=buildroot@buildroot.org \
    --cc=romain.naour@smile.fr \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox