From b91599742ccacf933e5246dca11e46ecd5994e8f Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Wed, 2 Aug 2023 15:10:54 -0600 Subject: [PATCH] CI: sys: quadlet %T test: do not rely on journal Some people might expect this to work: systemctl --wait start foo journalctl -u foo ---> displays output from foo Well, it does not. Not reliably, anyway: https://github.com/systemd/systemd/issues/28650 Shrug, okay, deal with it: write value of %T to a tmpfile instead of relying on journal. I tested with TMPDIR= on an SELinux system and, by golly, it works fine. Signed-off-by: Ed Santiago --- test/system/252-quadlet.bats | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/system/252-quadlet.bats b/test/system/252-quadlet.bats index f836e44765..81b009071c 100644 --- a/test/system/252-quadlet.bats +++ b/test/system/252-quadlet.bats @@ -784,6 +784,7 @@ EOF # # Step 1: determine what systemd is using for %T. There does not # seem to be any systemctly way to find this. + percent_t_file="${PODMAN_TMPDIR}/foo" local service=get-percent-t.$(random_string 10).service local unitfile=${UNIT_DIR}/$service cat >$unitfile <$percent_t_file" +Type=oneshot EOF systemctl daemon-reload systemctl --wait start $service - echo "$_LOG_PROMPT journalctl -u $service" - run journalctl -u $service - echo "$output" - assert "$output" =~ " --==.*==--" "get-percent-T unit ran to completion" - percent_t=$(expr "$output" : ".* --==\(.*\)==--") + percent_t=$(< $percent_t_file) # Clean up. Don't bother to systemctl-reload, service_setup does that below. rm -f $unitfile