teknoraver / rpms / systemd

Forked from rpms/systemd 5 months ago
Clone

Blame 35938.patch

a7eec4
From 1f21bbecade2c74a02ec8e2d5ebc8757752ea7b2 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Wed, 8 Jan 2025 10:25:05 +0100
a7eec4
Subject: [PATCH 01/22] fmf: Don't fail if we can't put selinux in permissive
a7eec4
 mode
a7eec4
a7eec4
The tests might be running unprivileged or in an environment without
a7eec4
selinux so let's not fail if we can't put it in permissive mode.
a7eec4
a7eec4
(cherry picked from commit 0250db0139b159cb9e6c1a87ad91ffdd03e80236)
a7eec4
---
a7eec4
 test/fmf/integration-tests/test.sh | 4 ++--
a7eec4
 1 file changed, 2 insertions(+), 2 deletions(-)
a7eec4
a7eec4
diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh
a7eec4
index 4984fb119b571..fe139567bdf06 100755
a7eec4
--- a/test/fmf/integration-tests/test.sh
a7eec4
+++ b/test/fmf/integration-tests/test.sh
a7eec4
@@ -4,8 +4,8 @@
a7eec4
 set -eux
a7eec4
 set -o pipefail
a7eec4
 
a7eec4
-# Switch SELinux to permissive, since the tests don't set proper contexts
a7eec4
-setenforce 0
a7eec4
+# Switch SELinux to permissive if possible, since the tests don't set proper contexts
a7eec4
+setenforce 0 || true
a7eec4
 
a7eec4
 # Allow running the integration tests downstream in dist-git with something like
a7eec4
 # the following snippet which makes the dist-git sources available in $TMT_SOURCE_DIR:
a7eec4
a7eec4
From 006ff34ef7d27aa10fd7343dacd1663f25561799 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Wed, 8 Jan 2025 10:25:50 +0100
a7eec4
Subject: [PATCH 02/22] fmf: Fix dist-git example
a7eec4
a7eec4
All that's needed is dist-git-source: true so remove the other settings
a7eec4
that aren't required.
a7eec4
a7eec4
(cherry picked from commit 0a85b3757968a2750286119760244e017c990263)
a7eec4
---
a7eec4
 test/fmf/integration-tests/test.sh | 3 ---
a7eec4
 1 file changed, 3 deletions(-)
a7eec4
a7eec4
diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh
a7eec4
index fe139567bdf06..73771d4237207 100755
a7eec4
--- a/test/fmf/integration-tests/test.sh
a7eec4
+++ b/test/fmf/integration-tests/test.sh
a7eec4
@@ -13,9 +13,6 @@ setenforce 0 || true
a7eec4
 # summary: systemd Fedora test suite
a7eec4
 # discover:
a7eec4
 #   how: fmf
a7eec4
-#   url: https://github.com/systemd/systemd
a7eec4
-#   ref: main
a7eec4
-#   path: test/fmf
a7eec4
 #   dist-git-source: true
a7eec4
 #   dist-git-install-builddeps: false
a7eec4
 # prepare:
a7eec4
a7eec4
From fc5028ef24af77c9bf0965bb9e3518cdc1041797 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Wed, 8 Jan 2025 10:38:21 +0100
a7eec4
Subject: [PATCH 03/22] fmf: Fix glob
a7eec4
a7eec4
Globs inside quotes aren't expanded and we need the glob to be more
a7eec4
specific to avoid matching multiple entries inside the tmt source
a7eec4
directory.
a7eec4
a7eec4
(cherry picked from commit fc1b08dee2ccf706580fa448e66831d1e853d054)
a7eec4
---
a7eec4
 test/fmf/integration-tests/test.sh | 5 ++++-
a7eec4
 1 file changed, 4 insertions(+), 1 deletion(-)
a7eec4
a7eec4
diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh
a7eec4
index 73771d4237207..0a1595fa97268 100755
a7eec4
--- a/test/fmf/integration-tests/test.sh
a7eec4
+++ b/test/fmf/integration-tests/test.sh
a7eec4
@@ -23,8 +23,11 @@ setenforce 0 || true
a7eec4
 # execute:
a7eec4
 #   how: tmt
a7eec4
 
a7eec4
+shopt -s extglob
a7eec4
+
a7eec4
 if [[ -n "${TMT_SOURCE_DIR:-}" ]]; then
a7eec4
-    pushd "$TMT_SOURCE_DIR/*/"
a7eec4
+    # Match either directories ending with branch names (e.g. systemd-fmf) or releases (e.g systemd-257.1).
a7eec4
+    pushd "$TMT_SOURCE_DIR"/systemd-+([0-9a-z.~])/
a7eec4
 elif [[ -n "${PACKIT_TARGET_URL:-}" ]]; then
a7eec4
     # Prepare systemd source tree
a7eec4
     git clone "$PACKIT_TARGET_URL" systemd --branch "$PACKIT_TARGET_BRANCH"
a7eec4
a7eec4
From bff09b9634e0160bd33302eec1c25438cdba2af5 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Wed, 8 Jan 2025 12:12:15 +0100
a7eec4
Subject: [PATCH 04/22] fmf: Only mess with /etc/yum.repos.d when running
a7eec4
 within testing farm
a7eec4
a7eec4
If running tmt locally to debug the test script, make sure we don't
a7eec4
mess with /etc/yum.repos.d.
a7eec4
a7eec4
(cherry picked from commit 8e3347f3bd3d9a01b8f39b0858eab74084ecf20a)
a7eec4
---
a7eec4
 test/fmf/integration-tests/test.sh | 18 ++++++++++++------
a7eec4
 1 file changed, 12 insertions(+), 6 deletions(-)
a7eec4
a7eec4
diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh
a7eec4
index 0a1595fa97268..347cd219a458a 100755
a7eec4
--- a/test/fmf/integration-tests/test.sh
a7eec4
+++ b/test/fmf/integration-tests/test.sh
a7eec4
@@ -63,6 +63,11 @@ Release=${VERSION_ID:-rawhide}
a7eec4
 [Build]
a7eec4
 ToolsTreeDistribution=$ID
a7eec4
 ToolsTreeRelease=${VERSION_ID:-rawhide}
a7eec4
+EOF
a7eec4
+
a7eec4
+if [[ -n "${TESTING_FARM_REQUEST_ID:-}" ]]; then
a7eec4
+    tee --append mkosi.local.conf <
a7eec4
+[Build]
a7eec4
 ToolsTreeSandboxTrees=
a7eec4
         /etc/yum.repos.d/:/etc/yum.repos.d/
a7eec4
         /var/share/test-artifacts/:/var/share/test-artifacts/
a7eec4
@@ -72,14 +77,15 @@ SandboxTrees=
a7eec4
 Environment=NO_BUILD=1
a7eec4
 EOF
a7eec4
 
a7eec4
-cat /etc/dnf/dnf.conf
a7eec4
-cat /etc/yum.repos.d/*
a7eec4
+    cat /etc/dnf/dnf.conf
a7eec4
+    cat /etc/yum.repos.d/*
a7eec4
 
a7eec4
-# Ensure packages built for this test have highest priority
a7eec4
-echo -e "\npriority=1" >> /etc/yum.repos.d/copr_build*
a7eec4
+    # Ensure packages built for this test have highest priority
a7eec4
+    echo -e "\npriority=1" >> /etc/yum.repos.d/copr_build*
a7eec4
 
a7eec4
-# Disable mkosi's own repository logic
a7eec4
-touch /etc/yum.repos.d/mkosi.repo
a7eec4
+    # Disable mkosi's own repository logic
a7eec4
+    touch /etc/yum.repos.d/mkosi.repo
a7eec4
+fi
a7eec4
 
a7eec4
 # TODO: drop once BTRFS regression is fixed in kernel 6.13
a7eec4
 sed -i "s/Format=btrfs/Format=ext4/" mkosi.repart/10-root.conf
a7eec4
a7eec4
From d0b9af0f2bb5f8891eb4def4ec201bf527fe2096 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Wed, 8 Jan 2025 16:41:46 +0100
a7eec4
Subject: [PATCH 05/22] fmf: Dump CPU and memory information
a7eec4
a7eec4
(cherry picked from commit 44368f84d7ddbec7a50648a65c27cb6a31090a29)
a7eec4
---
a7eec4
 test/fmf/integration-tests/test.sh | 4 ++++
a7eec4
 1 file changed, 4 insertions(+)
a7eec4
a7eec4
diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh
a7eec4
index 347cd219a458a..4545090c3c1ab 100755
a7eec4
--- a/test/fmf/integration-tests/test.sh
a7eec4
+++ b/test/fmf/integration-tests/test.sh
a7eec4
@@ -7,6 +7,10 @@ set -o pipefail
a7eec4
 # Switch SELinux to permissive if possible, since the tests don't set proper contexts
a7eec4
 setenforce 0 || true
a7eec4
 
a7eec4
+echo "CPU and Memory information:"
a7eec4
+lscpu
a7eec4
+lsmem
a7eec4
+
a7eec4
 # Allow running the integration tests downstream in dist-git with something like
a7eec4
 # the following snippet which makes the dist-git sources available in $TMT_SOURCE_DIR:
a7eec4
 #
a7eec4
a7eec4
From c8cd705e5ed0a1f1fe642772a7605b36f30215a1 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Wed, 8 Jan 2025 13:31:11 +0100
a7eec4
Subject: [PATCH 06/22] TEST-06-SELINUX: Add knob to allow checking for AVCs
a7eec4
a7eec4
When running the integration tests downstream, it's useful to be
a7eec4
able to test that a new systemd version doesn't introduce any AVC
a7eec4
denials, so let's add a knob to make that possible.
a7eec4
a7eec4
(cherry picked from commit de19520ec979902fd457515d1a795210fdaedf93)
a7eec4
---
a7eec4
 test/README.testsuite              | 10 ++++++++++
a7eec4
 test/fmf/integration-tests/test.sh |  7 +++++++
a7eec4
 test/units/TEST-06-SELINUX.sh      |  4 ++++
a7eec4
 3 files changed, 21 insertions(+)
a7eec4
a7eec4
diff --git a/test/README.testsuite b/test/README.testsuite
a7eec4
index da2d17a6dba7c..6b367aa6738fa 100644
a7eec4
--- a/test/README.testsuite
a7eec4
+++ b/test/README.testsuite
a7eec4
@@ -151,6 +151,16 @@ that make use of `run_testcases`.
a7eec4
 
a7eec4
 `TEST_SKIP_TESTCASE=testcase`: takes a space separated list of testcases to skip.
a7eec4
 
a7eec4
+### SELinux AVCs
a7eec4
+
a7eec4
+To have `TEST-06-SELINUX` check for SELinux denials, write the following to
a7eec4
+mkosi.local.conf:
a7eec4
+
a7eec4
+```conf
a7eec4
+[Runtime]
a7eec4
+KernelCommandLineExtra=systemd.setenv=TEST_SELINUX_CHECK_AVCS=1
a7eec4
+```
a7eec4
+
a7eec4
 ## Ubuntu CI
a7eec4
 
a7eec4
 New PRs submitted to the project are run through regression tests, and one set
a7eec4
diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh
a7eec4
index 4545090c3c1ab..fccfa15c72821 100755
a7eec4
--- a/test/fmf/integration-tests/test.sh
a7eec4
+++ b/test/fmf/integration-tests/test.sh
a7eec4
@@ -69,6 +69,13 @@ ToolsTreeDistribution=$ID
a7eec4
 ToolsTreeRelease=${VERSION_ID:-rawhide}
a7eec4
 EOF
a7eec4
 
a7eec4
+if [[ -n "${TEST_SELINUX_CHECK_AVCS:-}" ]]; then
a7eec4
+    tee --append mkosi.local.conf <
a7eec4
+[Runtime]
a7eec4
+KernelCommandLineExtra=systemd.setenv=TEST_SELINUX_CHECK_AVCS=$TEST_SELINUX_CHECK_AVCS
a7eec4
+EOF
a7eec4
+fi
a7eec4
+
a7eec4
 if [[ -n "${TESTING_FARM_REQUEST_ID:-}" ]]; then
a7eec4
     tee --append mkosi.local.conf <
a7eec4
 [Build]
a7eec4
diff --git a/test/units/TEST-06-SELINUX.sh b/test/units/TEST-06-SELINUX.sh
a7eec4
index 937a04005ad8d..4ab9224a9ea30 100755
a7eec4
--- a/test/units/TEST-06-SELINUX.sh
a7eec4
+++ b/test/units/TEST-06-SELINUX.sh
a7eec4
@@ -46,4 +46,8 @@ NSPAWN_ARGS=(systemd-nspawn -q --volatile=yes --directory=/ --bind-ro=/etc --ina
a7eec4
 [[ "$("${NSPAWN_ARGS[@]}" --selinux-apifs-context="$CONTEXT" stat --printf %C /run)" == "$CONTEXT" ]]
a7eec4
 [[ "$("${NSPAWN_ARGS[@]}" --selinux-apifs-context="$CONTEXT" --tmpfs=/tmp stat --printf %C /tmp)" == "$CONTEXT" ]]
a7eec4
 
a7eec4
+if [[ -n "${TEST_SELINUX_CHECK_AVCS:-}" ]] && ((TEST_SELINUX_CHECK_AVCS)); then
a7eec4
+    (! journalctl -t audit -g AVC -o cat)
a7eec4
+fi
a7eec4
+
a7eec4
 touch /testok
a7eec4
a7eec4
From f58b341580a6b4dcd0ede92c38fc5452e29929d5 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Wed, 8 Jan 2025 16:03:06 +0100
a7eec4
Subject: [PATCH 07/22] fmf: Force SELinux relabel when running within testing
a7eec4
 farm
a7eec4
a7eec4
We expect to run as root within testing farm and to have permissions
a7eec4
to do selinux relabelling so let's enable it explicitly.
a7eec4
a7eec4
(cherry picked from commit e1c883bf32f3922bfc977701062e353c0a0a4ac5)
a7eec4
---
a7eec4
 test/fmf/integration-tests/test.sh | 3 +++
a7eec4
 1 file changed, 3 insertions(+)
a7eec4
a7eec4
diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh
a7eec4
index fccfa15c72821..8cea79cf30274 100755
a7eec4
--- a/test/fmf/integration-tests/test.sh
a7eec4
+++ b/test/fmf/integration-tests/test.sh
a7eec4
@@ -78,6 +78,9 @@ fi
a7eec4
 
a7eec4
 if [[ -n "${TESTING_FARM_REQUEST_ID:-}" ]]; then
a7eec4
     tee --append mkosi.local.conf <
a7eec4
+[Content]
a7eec4
+SELinuxRelabel=yes
a7eec4
+
a7eec4
 [Build]
a7eec4
 ToolsTreeSandboxTrees=
a7eec4
         /etc/yum.repos.d/:/etc/yum.repos.d/
a7eec4
a7eec4
From 02cad97ca31722efeca560231b2e7ef96af40b56 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Thu, 9 Jan 2025 11:27:51 +0100
a7eec4
Subject: [PATCH 08/22] test: Drop set -x from integration-test-setup.sh
a7eec4
a7eec4
(cherry picked from commit 90538ede55ac9d40dc513f64f052c687672cae89)
a7eec4
---
a7eec4
 test/integration-test-setup.sh | 2 +-
a7eec4
 1 file changed, 1 insertion(+), 1 deletion(-)
a7eec4
a7eec4
diff --git a/test/integration-test-setup.sh b/test/integration-test-setup.sh
a7eec4
index d7c384a97cf48..c67f938acf26f 100755
a7eec4
--- a/test/integration-test-setup.sh
a7eec4
+++ b/test/integration-test-setup.sh
a7eec4
@@ -1,6 +1,6 @@
a7eec4
 #!/usr/bin/env bash
a7eec4
 # SPDX-License-Identifier: LGPL-2.1-or-later
a7eec4
-set -eux
a7eec4
+set -eu
a7eec4
 set -o pipefail
a7eec4
 
a7eec4
 case "$1" in
a7eec4
a7eec4
From 9f6617a1a086ecbdd4abb29d4a5b4eada05eb9c4 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Thu, 9 Jan 2025 11:28:15 +0100
a7eec4
Subject: [PATCH 09/22] test: Only plug in integration-test-setup.sh in
a7eec4
 interactive mode
a7eec4
a7eec4
If we're not running interactively, there's no point in the features
a7eec4
from integration-test-setup.sh which are intended for interactive
a7eec4
development and debugging so lets skip adding it in that case.
a7eec4
a7eec4
(cherry picked from commit 794d456cf402a35290d6562c21f0ff846511026c)
a7eec4
---
a7eec4
 test/integration-test-wrapper.py | 9 +++++++++
a7eec4
 test/test.service.in             | 2 --
a7eec4
 2 files changed, 9 insertions(+), 2 deletions(-)
a7eec4
a7eec4
diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py
a7eec4
index ef6df8840f50d..5fa0325b889e5 100755
a7eec4
--- a/test/integration-test-wrapper.py
a7eec4
+++ b/test/integration-test-wrapper.py
a7eec4
@@ -459,6 +459,15 @@ def main() -> None:
a7eec4
             """
a7eec4
         )
a7eec4
 
a7eec4
+    if sys.stderr.isatty():
a7eec4
+        dropin += textwrap.dedent(
a7eec4
+            """
a7eec4
+            [Service]
a7eec4
+            ExecStartPre=/usr/lib/systemd/tests/testdata/integration-test-setup.sh setup
a7eec4
+            ExecStopPost=/usr/lib/systemd/tests/testdata/integration-test-setup.sh finalize
a7eec4
+            """
a7eec4
+        )
a7eec4
+
a7eec4
     cmd = [
a7eec4
         args.mkosi,
a7eec4
         '--directory', os.fspath(args.meson_source_dir),
a7eec4
diff --git a/test/test.service.in b/test/test.service.in
a7eec4
index 6400be0700288..75f703698f687 100644
a7eec4
--- a/test/test.service.in
a7eec4
+++ b/test/test.service.in
a7eec4
@@ -7,9 +7,7 @@ Before=getty-pre.target
a7eec4
 
a7eec4
 [Service]
a7eec4
 ExecStartPre=rm -f /failed /testok
a7eec4
-ExecStartPre=/usr/lib/systemd/tests/testdata/integration-test-setup.sh setup
a7eec4
 ExecStart=@command@
a7eec4
-ExecStopPost=/usr/lib/systemd/tests/testdata/integration-test-setup.sh finalize
a7eec4
 Type=oneshot
a7eec4
 MemoryAccounting=@memory-accounting@
a7eec4
 StateDirectory=%N
a7eec4
a7eec4
From 2aa2a0c9d166fd7a77c027852255bf248fe63aa0 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Tue, 7 Jan 2025 15:01:02 +0100
a7eec4
Subject: [PATCH 10/22] mkosi: Re-enable TEST-21-DFUZZER when running with
a7eec4
 sanitizers
a7eec4
a7eec4
Similar to how CentOS CI did it previously, let's only run
a7eec4
TEST-21-DFUZZER when built with sanitizers for maximum effect.
a7eec4
a7eec4
(cherry picked from commit 103e92810a4bd3f01d2a49d85ef9575d60a8d244)
a7eec4
---
a7eec4
 .github/workflows/mkosi.yml      | 8 ++++++++
a7eec4
 test/TEST-21-DFUZZER/meson.build | 1 -
a7eec4
 2 files changed, 8 insertions(+), 1 deletion(-)
a7eec4
a7eec4
diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml
a7eec4
index a043022ce05a1..592ed41051458 100644
a7eec4
--- a/.github/workflows/mkosi.yml
a7eec4
+++ b/.github/workflows/mkosi.yml
a7eec4
@@ -61,6 +61,7 @@ jobs:
a7eec4
             cflags: "-O2 -D_FORTIFY_SOURCE=3"
a7eec4
             relabel: no
a7eec4
             vm: 1
a7eec4
+            skip: TEST-21-DFUZZER
a7eec4
           - distro: debian
a7eec4
             release: testing
a7eec4
             sanitizers: ""
a7eec4
@@ -68,6 +69,7 @@ jobs:
a7eec4
             cflags: "-Og"
a7eec4
             relabel: no
a7eec4
             vm: 0
a7eec4
+            skip: TEST-21-DFUZZER
a7eec4
           - distro: ubuntu
a7eec4
             release: noble
a7eec4
             sanitizers: ""
a7eec4
@@ -75,6 +77,7 @@ jobs:
a7eec4
             cflags: "-Og"
a7eec4
             relabel: no
a7eec4
             vm: 0
a7eec4
+            skip: TEST-21-DFUZZER
a7eec4
           - distro: fedora
a7eec4
             release: "41"
a7eec4
             sanitizers: ""
a7eec4
@@ -82,6 +85,7 @@ jobs:
a7eec4
             cflags: "-Og"
a7eec4
             relabel: yes
a7eec4
             vm: 0
a7eec4
+            skip: TEST-21-DFUZZER
a7eec4
           - distro: fedora
a7eec4
             release: rawhide
a7eec4
             sanitizers: address,undefined
a7eec4
@@ -96,6 +100,7 @@ jobs:
a7eec4
             cflags: "-Og"
a7eec4
             relabel: no
a7eec4
             vm: 0
a7eec4
+            skip: TEST-21-DFUZZER
a7eec4
           - distro: centos
a7eec4
             release: "9"
a7eec4
             sanitizers: ""
a7eec4
@@ -103,6 +108,7 @@ jobs:
a7eec4
             cflags: "-Og"
a7eec4
             relabel: yes
a7eec4
             vm: 0
a7eec4
+            skip: TEST-21-DFUZZER
a7eec4
           - distro: centos
a7eec4
             release: "10"
a7eec4
             sanitizers: ""
a7eec4
@@ -110,6 +116,7 @@ jobs:
a7eec4
             cflags: "-Og"
a7eec4
             relabel: yes
a7eec4
             vm: 0
a7eec4
+            skip: TEST-21-DFUZZER
a7eec4
 
a7eec4
     steps:
a7eec4
       - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
a7eec4
@@ -195,6 +202,7 @@ jobs:
a7eec4
             mkosi sandbox \
a7eec4
             env \
a7eec4
             TEST_PREFER_QEMU=${{ matrix.vm }} \
a7eec4
+            TEST_SKIP=${{ matrix.skip }} \
a7eec4
             meson test \
a7eec4
             -C build \
a7eec4
             --no-rebuild \
a7eec4
diff --git a/test/TEST-21-DFUZZER/meson.build b/test/TEST-21-DFUZZER/meson.build
a7eec4
index f57be63380222..932f0c5f0e407 100644
a7eec4
--- a/test/TEST-21-DFUZZER/meson.build
a7eec4
+++ b/test/TEST-21-DFUZZER/meson.build
a7eec4
@@ -6,6 +6,5 @@ integration_tests += [
a7eec4
                 'timeout' : 3600,
a7eec4
                 'priority' : 50,
a7eec4
                 'vm' : true,
a7eec4
-                'enabled' : false,
a7eec4
         },
a7eec4
 ]
a7eec4
a7eec4
From 0d6306c37144494e8b029a5f73aec40372587203 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Thu, 9 Jan 2025 15:13:18 +0100
a7eec4
Subject: [PATCH 11/22] fmf: Move meson logs and failed test journals to test
a7eec4
 artifacts dir
a7eec4
a7eec4
(cherry picked from commit 0e444c948e7d8ddbdec83116b68af7d876e2d2f6)
a7eec4
---
a7eec4
 test/fmf/integration-tests/test.sh | 7 ++++++-
a7eec4
 1 file changed, 6 insertions(+), 1 deletion(-)
a7eec4
a7eec4
diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh
a7eec4
index 8cea79cf30274..762016f2a5c1c 100755
a7eec4
--- a/test/fmf/integration-tests/test.sh
a7eec4
+++ b/test/fmf/integration-tests/test.sh
a7eec4
@@ -125,6 +125,11 @@ mkosi -f sandbox \
a7eec4
     --suite integration-tests \
a7eec4
     --print-errorlogs \
a7eec4
     --no-stdsplit \
a7eec4
-    --num-processes "$(($(nproc) - 1))"
a7eec4
+    --num-processes "$(($(nproc) - 1))" && EC=0 || EC=$?
a7eec4
+
a7eec4
+find build/meson-logs -type f -exec mv {} "$TMT_TEST_DATA" \;
a7eec4
+find build/test/journal -type f -exec mv {} "$TMT_TEST_DATA" \;
a7eec4
 
a7eec4
 popd
a7eec4
+
a7eec4
+exit "$EC"
a7eec4
a7eec4
From 80d2d53b0d8573b69597a37f6ced38df97ad2746 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Thu, 9 Jan 2025 15:24:51 +0100
a7eec4
Subject: [PATCH 12/22] fmf: Log clock source
a7eec4
a7eec4
(cherry picked from commit 6e761c5a93278fc719a66f7c984af9608b836991)
a7eec4
---
a7eec4
 test/fmf/integration-tests/test.sh | 2 ++
a7eec4
 1 file changed, 2 insertions(+)
a7eec4
a7eec4
diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh
a7eec4
index 762016f2a5c1c..d1e43b1d7dbc9 100755
a7eec4
--- a/test/fmf/integration-tests/test.sh
a7eec4
+++ b/test/fmf/integration-tests/test.sh
a7eec4
@@ -11,6 +11,8 @@ echo "CPU and Memory information:"
a7eec4
 lscpu
a7eec4
 lsmem
a7eec4
 
a7eec4
+echo "Clock source: $(cat /sys/devices/system/clocksource/clocksource0/current_clocksource)"
a7eec4
+
a7eec4
 # Allow running the integration tests downstream in dist-git with something like
a7eec4
 # the following snippet which makes the dist-git sources available in $TMT_SOURCE_DIR:
a7eec4
 #
a7eec4
a7eec4
From 0584ff62f23838d2a85d48ce22a56aeb61e6f3e7 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Thu, 9 Jan 2025 16:24:22 +0100
a7eec4
Subject: [PATCH 13/22] tree-wide: Fix python formatting
a7eec4
a7eec4
The new release of ruff formats a few more things which causes linter
a7eec4
failures in CI so let's fix those formatting nits.
a7eec4
a7eec4
(cherry picked from commit 96403d5121d93dd47dbe9dab5b90ff973e664ac3)
a7eec4
---
a7eec4
 src/ukify/ukify.py               | 6 +++---
a7eec4
 test/integration-test-wrapper.py | 6 +++---
a7eec4
 2 files changed, 6 insertions(+), 6 deletions(-)
a7eec4
a7eec4
diff --git a/src/ukify/ukify.py b/src/ukify/ukify.py
a7eec4
index 3f36aa7af6b08..be4e30eb8e36e 100755
a7eec4
--- a/src/ukify/ukify.py
a7eec4
+++ b/src/ukify/ukify.py
a7eec4
@@ -763,7 +763,7 @@ def call_systemd_measure(uki: UKI, opts: UkifyConfig, profile_start: int = 0) ->
a7eec4
             cmd = [
a7eec4
                 measure_tool,
a7eec4
                 'calculate',
a7eec4
-                *(f"--{s.name.removeprefix('.')}={s.content}" for s in to_measure.values()),
a7eec4
+                *(f'--{s.name.removeprefix(".")}={s.content}' for s in to_measure.values()),
a7eec4
                 *(f'--bank={bank}' for bank in banks),
a7eec4
                 # For measurement, the keys are not relevant, so we can lump all the phase paths
a7eec4
                 # into one call to systemd-measure calculate.
a7eec4
@@ -786,7 +786,7 @@ def call_systemd_measure(uki: UKI, opts: UkifyConfig, profile_start: int = 0) ->
a7eec4
             cmd = [
a7eec4
                 measure_tool,
a7eec4
                 'sign',
a7eec4
-                *(f"--{s.name.removeprefix('.')}={s.content}" for s in to_measure.values()),
a7eec4
+                *(f'--{s.name.removeprefix(".")}={s.content}' for s in to_measure.values()),
a7eec4
                 *(f'--bank={bank}' for bank in banks),
a7eec4
             ]
a7eec4
 
a7eec4
@@ -1284,7 +1284,7 @@ def make_uki(opts: UkifyConfig) -> None:
a7eec4
         os.umask(umask := os.umask(0))
a7eec4
         os.chmod(opts.output, 0o777 & ~umask)
a7eec4
 
a7eec4
-    print(f"Wrote {'signed' if sign_args_present else 'unsigned'} {opts.output}")
a7eec4
+    print(f'Wrote {"signed" if sign_args_present else "unsigned"} {opts.output}')
a7eec4
 
a7eec4
 
a7eec4
 @contextlib.contextmanager
a7eec4
diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py
a7eec4
index 5fa0325b889e5..d9d92fcba3b0e 100755
a7eec4
--- a/test/integration-test-wrapper.py
a7eec4
+++ b/test/integration-test-wrapper.py
a7eec4
@@ -429,7 +429,7 @@ def main() -> None:
a7eec4
         dropin += textwrap.dedent(
a7eec4
             f"""
a7eec4
             [Service]
a7eec4
-            Environment=TEST_MATCH_SUBTEST={os.environ["TEST_MATCH_SUBTEST"]}
a7eec4
+            Environment=TEST_MATCH_SUBTEST={os.environ['TEST_MATCH_SUBTEST']}
a7eec4
             """
a7eec4
         )
a7eec4
 
a7eec4
@@ -437,7 +437,7 @@ def main() -> None:
a7eec4
         dropin += textwrap.dedent(
a7eec4
             f"""
a7eec4
             [Service]
a7eec4
-            Environment=TEST_MATCH_TESTCASE={os.environ["TEST_MATCH_TESTCASE"]}
a7eec4
+            Environment=TEST_MATCH_TESTCASE={os.environ['TEST_MATCH_TESTCASE']}
a7eec4
             """
a7eec4
         )
a7eec4
 
a7eec4
@@ -568,7 +568,7 @@ def main() -> None:
a7eec4
 
a7eec4
     ops += [f'journalctl --file {journal_file} --no-hostname -o short-monotonic -u {args.unit} -p info']
a7eec4
 
a7eec4
-    print("Test failed, relevant logs can be viewed with: \n\n" f"{(' && '.join(ops))}\n", file=sys.stderr)
a7eec4
+    print(f'Test failed, relevant logs can be viewed with: \n\n{(" && ".join(ops))}\n', file=sys.stderr)
a7eec4
 
a7eec4
     # 0 also means we failed so translate that to a non-zero exit code to mark the test as failed.
a7eec4
     exit(result.returncode or 1)
a7eec4
a7eec4
From eb15a87fb0ba3d37b58e0b74f6c796f6d632c273 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Fri, 10 Jan 2025 14:27:33 +0100
a7eec4
Subject: [PATCH 14/22] test: Add option to save in progress test journals to
a7eec4
 /tmp
a7eec4
a7eec4
The journal isn't the best at being fast, especially when writing
a7eec4
to disk and not to memory, which can cause integration tests to
a7eec4
grind to a halt on beefy systems due to all the systemd-journal-remote
a7eec4
instances not being able to write journal entries to disk fast enough.
a7eec4
a7eec4
Let's introduce an option to allow writing in progress test journals
a7eec4
to use /tmp which can be used on beefy systems with lots of memory to
a7eec4
speed things up.
a7eec4
a7eec4
(cherry picked from commit e49fdecd161b3d391e55311652fda3220d851fa1)
a7eec4
---
a7eec4
 test/README.testsuite            |  4 ++++
a7eec4
 test/integration-test-wrapper.py | 12 +++++++++++-
a7eec4
 2 files changed, 15 insertions(+), 1 deletion(-)
a7eec4
a7eec4
diff --git a/test/README.testsuite b/test/README.testsuite
a7eec4
index 6b367aa6738fa..e33c08f33a20e 100644
a7eec4
--- a/test/README.testsuite
a7eec4
+++ b/test/README.testsuite
a7eec4
@@ -151,6 +151,10 @@ that make use of `run_testcases`.
a7eec4
 
a7eec4
 `TEST_SKIP_TESTCASE=testcase`: takes a space separated list of testcases to skip.
a7eec4
 
a7eec4
+`TEST_JOURNAL_USE_TMP=1`: Write test journal to `/tmp` while the test is in
a7eec4
+progress and only move the journal to its final location in the build directory
a7eec4
+(`$BUILD_DIR/test/journal`) when the test is finished.
a7eec4
+
a7eec4
 ### SELinux AVCs
a7eec4
 
a7eec4
 To have `TEST-06-SELINUX` check for SELinux denials, write the following to
a7eec4
diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py
a7eec4
index d9d92fcba3b0e..1c28cf3776e80 100755
a7eec4
--- a/test/integration-test-wrapper.py
a7eec4
+++ b/test/integration-test-wrapper.py
a7eec4
@@ -10,6 +10,7 @@
a7eec4
 import os
a7eec4
 import re
a7eec4
 import shlex
a7eec4
+import shutil
a7eec4
 import subprocess
a7eec4
 import sys
a7eec4
 import tempfile
a7eec4
@@ -441,7 +442,11 @@ def main() -> None:
a7eec4
             """
a7eec4
         )
a7eec4
 
a7eec4
-    journal_file = (args.meson_build_dir / (f'test/journal/{name}.journal')).absolute()
a7eec4
+    if os.getenv('TEST_JOURNAL_USE_TMP', '0') == '1':
a7eec4
+        journal_file = Path(f'/tmp/systemd-integration-tests/journal/{name.journal}')
a7eec4
+    else:
a7eec4
+        journal_file = (args.meson_build_dir / f'test/journal/{name}.journal').absolute()
a7eec4
+
a7eec4
     journal_file.unlink(missing_ok=True)
a7eec4
 
a7eec4
     if not sys.stderr.isatty():
a7eec4
@@ -551,6 +556,11 @@ def main() -> None:
a7eec4
     ):
a7eec4
         journal_file.unlink(missing_ok=True)
a7eec4
 
a7eec4
+    if os.getenv('TEST_JOURNAL_USE_TMP', '0') == '1':
a7eec4
+        dst = args.meson_build_dir / f'test/journal/{name}.journal'
a7eec4
+        dst.parent.mkdir(parents=True, exist_ok=True)
a7eec4
+        shutil.move(journal_file, dst)
a7eec4
+
a7eec4
     if shell or (result.returncode in (args.exit_code, 77) and not coredumps and not sanitizer):
a7eec4
         exit(0 if shell or result.returncode == args.exit_code else 77)
a7eec4
 
a7eec4
a7eec4
From ce86b8086e92c84e33385fb48467384abe74ca6d Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Fri, 10 Jan 2025 14:29:58 +0100
a7eec4
Subject: [PATCH 15/22] test: Don't register machines with machined unless
a7eec4
 we're in interactive mode
a7eec4
a7eec4
(cherry picked from commit 84b30442d257102a9a39122f9a537fa48fb0bfda)
a7eec4
---
a7eec4
 test/integration-test-wrapper.py | 2 +-
a7eec4
 1 file changed, 1 insertion(+), 1 deletion(-)
a7eec4
a7eec4
diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py
a7eec4
index 1c28cf3776e80..94904cfbc4c05 100755
a7eec4
--- a/test/integration-test-wrapper.py
a7eec4
+++ b/test/integration-test-wrapper.py
a7eec4
@@ -516,7 +516,7 @@ def main() -> None:
a7eec4
             ]
a7eec4
         ),
a7eec4
         '--credential', f"journal.storage={'persistent' if sys.stderr.isatty() else args.storage}",
a7eec4
-        *(['--runtime-build-sources=no'] if not sys.stderr.isatty() else []),
a7eec4
+        *(['--runtime-build-sources=no', '--register=no'] if not sys.stderr.isatty() else []),
a7eec4
         'vm' if args.vm or os.getuid() != 0 or os.getenv('TEST_PREFER_QEMU', '0') == '1' else 'boot',
a7eec4
     ]  # fmt: skip
a7eec4
 
a7eec4
a7eec4
From 504eee6eb099c80b48d8bf7e82ca9e0d6549e076 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Fri, 10 Jan 2025 14:51:24 +0100
a7eec4
Subject: [PATCH 16/22] test: Move StateDirectory= directive into dropin
a7eec4
a7eec4
The integration-test-setup calls require StateDirectory= but some
a7eec4
tests override the test unit used which then won't have StateDirectory=
a7eec4
so let's move StateDirectory= into the dropin as well to avoid this
a7eec4
issue.
a7eec4
a7eec4
(cherry picked from commit 1f17ec0ed419627a686ee6e719ac7f55cf082ada)
a7eec4
---
a7eec4
 test/integration-test-wrapper.py | 1 +
a7eec4
 test/test.service.in             | 1 -
a7eec4
 2 files changed, 1 insertion(+), 1 deletion(-)
a7eec4
a7eec4
diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py
a7eec4
index 94904cfbc4c05..610c34c903425 100755
a7eec4
--- a/test/integration-test-wrapper.py
a7eec4
+++ b/test/integration-test-wrapper.py
a7eec4
@@ -470,6 +470,7 @@ def main() -> None:
a7eec4
             [Service]
a7eec4
             ExecStartPre=/usr/lib/systemd/tests/testdata/integration-test-setup.sh setup
a7eec4
             ExecStopPost=/usr/lib/systemd/tests/testdata/integration-test-setup.sh finalize
a7eec4
+            StateDirectory=%N
a7eec4
             """
a7eec4
         )
a7eec4
 
a7eec4
diff --git a/test/test.service.in b/test/test.service.in
a7eec4
index 75f703698f687..790c513da4338 100644
a7eec4
--- a/test/test.service.in
a7eec4
+++ b/test/test.service.in
a7eec4
@@ -10,4 +10,3 @@ ExecStartPre=rm -f /failed /testok
a7eec4
 ExecStart=@command@
a7eec4
 Type=oneshot
a7eec4
 MemoryAccounting=@memory-accounting@
a7eec4
-StateDirectory=%N
a7eec4
a7eec4
From 4fc1059282f5e39b3385fe175d377de96461f68b Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Fri, 10 Jan 2025 15:26:37 +0100
a7eec4
Subject: [PATCH 17/22] fmf: Bump inotify limits to avoid systemd-nspawn
a7eec4
 failures
a7eec4
a7eec4
(cherry picked from commit c32a8cdaa0f03ae29e9edade1213cc2001b28000)
a7eec4
---
a7eec4
 test/fmf/integration-tests/test.sh | 4 ++++
a7eec4
 1 file changed, 4 insertions(+)
a7eec4
a7eec4
diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh
a7eec4
index d1e43b1d7dbc9..34bf1abfa8943 100755
a7eec4
--- a/test/fmf/integration-tests/test.sh
a7eec4
+++ b/test/fmf/integration-tests/test.sh
a7eec4
@@ -13,6 +13,10 @@ lsmem
a7eec4
 
a7eec4
 echo "Clock source: $(cat /sys/devices/system/clocksource/clocksource0/current_clocksource)"
a7eec4
 
a7eec4
+# Bump inotify limits so nspawn containers don't run out of inotify file descriptors.
a7eec4
+sysctl fs.inotify.max_user_watches=65536
a7eec4
+sysctl fs.inotify.max_user_instances=1024
a7eec4
+
a7eec4
 # Allow running the integration tests downstream in dist-git with something like
a7eec4
 # the following snippet which makes the dist-git sources available in $TMT_SOURCE_DIR:
a7eec4
 #
a7eec4
a7eec4
From 7f3639f9a0ead8ea70f2d975de4271bb7d8ab05b Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Fri, 10 Jan 2025 15:26:54 +0100
a7eec4
Subject: [PATCH 18/22] fmf: Use different heuristic on beefy systems
a7eec4
a7eec4
If we save journals in /tmp, we can run a larger number of tests in
a7eec4
parallel so let's make use of the larger number of CPUs if the tests
a7eec4
run on a beefy machine.
a7eec4
a7eec4
(cherry picked from commit 53546c71fe0a1b30ee296df84bb8c3577f5675a4)
a7eec4
---
a7eec4
 test/fmf/integration-tests/test.sh | 10 +++++++++-
a7eec4
 1 file changed, 9 insertions(+), 1 deletion(-)
a7eec4
a7eec4
diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh
a7eec4
index 34bf1abfa8943..06a98bfd7a0be 100755
a7eec4
--- a/test/fmf/integration-tests/test.sh
a7eec4
+++ b/test/fmf/integration-tests/test.sh
a7eec4
@@ -116,6 +116,14 @@ if [[ ! -e /dev/kvm ]]; then
a7eec4
     export TEST_NO_QEMU=1
a7eec4
 fi
a7eec4
 
a7eec4
+NPROC="$(nproc)"
a7eec4
+if [[ "$NPROC" -ge 10 ]]; then
a7eec4
+    export TEST_JOURNAL_USE_TMP=1
a7eec4
+    NPROC="$((NPROC / 3))"
a7eec4
+else
a7eec4
+    NPROC="$((NPROC - 1))"
a7eec4
+fi
a7eec4
+
a7eec4
 # Create missing mountpoint for mkosi sandbox.
a7eec4
 mkdir -p /etc/pacman.d/gnupg
a7eec4
 
a7eec4
@@ -131,7 +139,7 @@ mkosi -f sandbox \
a7eec4
     --suite integration-tests \
a7eec4
     --print-errorlogs \
a7eec4
     --no-stdsplit \
a7eec4
-    --num-processes "$(($(nproc) - 1))" && EC=0 || EC=$?
a7eec4
+    --num-processes "$NPROC" && EC=0 || EC=$?
a7eec4
 
a7eec4
 find build/meson-logs -type f -exec mv {} "$TMT_TEST_DATA" \;
a7eec4
 find build/test/journal -type f -exec mv {} "$TMT_TEST_DATA" \;
a7eec4
a7eec4
From 3661dcc1cbf43dca2a9a77c3dffe50cbe1a7ea18 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Fri, 10 Jan 2025 15:29:28 +0100
a7eec4
Subject: [PATCH 19/22] fmf: Skip TEST-21-DFUZZER
a7eec4
a7eec4
Similar to Github Actions, since we don't build with sanitizers in
a7eec4
the packit job, let's skip TEST-21-DFUZZER.
a7eec4
a7eec4
(cherry picked from commit e0c2fd6a3345d26afdf4159406c38cd9101d2e0d)
a7eec4
---
a7eec4
 test/fmf/integration-tests/test.sh | 4 ++++
a7eec4
 1 file changed, 4 insertions(+)
a7eec4
a7eec4
diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh
a7eec4
index 06a98bfd7a0be..f82961f9599d0 100755
a7eec4
--- a/test/fmf/integration-tests/test.sh
a7eec4
+++ b/test/fmf/integration-tests/test.sh
a7eec4
@@ -124,6 +124,10 @@ else
a7eec4
     NPROC="$((NPROC - 1))"
a7eec4
 fi
a7eec4
 
a7eec4
+# This test is only really useful if we're building with sanitizers and takes a long time, so let's skip it
a7eec4
+# for now.
a7eec4
+export TEST_SKIP="TEST-21-DFUZZER"
a7eec4
+
a7eec4
 # Create missing mountpoint for mkosi sandbox.
a7eec4
 mkdir -p /etc/pacman.d/gnupg
a7eec4
 
a7eec4
a7eec4
From 25c8ee9dc089b593940cefefb2dba7660768a7a8 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Mon, 13 Jan 2025 10:33:20 +0100
a7eec4
Subject: [PATCH 20/22] test: Fix bug in integration test wrapper
a7eec4
a7eec4
(cherry picked from commit 79ac78e3680a425d86c7a90e6846c630c9583b48)
a7eec4
---
a7eec4
 test/integration-test-wrapper.py | 2 +-
a7eec4
 1 file changed, 1 insertion(+), 1 deletion(-)
a7eec4
a7eec4
diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py
a7eec4
index 610c34c903425..5321faef57818 100755
a7eec4
--- a/test/integration-test-wrapper.py
a7eec4
+++ b/test/integration-test-wrapper.py
a7eec4
@@ -443,7 +443,7 @@ def main() -> None:
a7eec4
         )
a7eec4
 
a7eec4
     if os.getenv('TEST_JOURNAL_USE_TMP', '0') == '1':
a7eec4
-        journal_file = Path(f'/tmp/systemd-integration-tests/journal/{name.journal}')
a7eec4
+        journal_file = Path(f'/tmp/systemd-integration-tests/journal/{name}.journal')
a7eec4
     else:
a7eec4
         journal_file = (args.meson_build_dir / f'test/journal/{name}.journal').absolute()
a7eec4
 
a7eec4
a7eec4
From 051ad7661f7cf29b6cbf99c70a6a504f777bc240 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Tue, 14 Jan 2025 09:52:40 +0100
a7eec4
Subject: [PATCH 21/22] test: Only move journal file if we didn't just unlink
a7eec4
 it
a7eec4
a7eec4
(cherry picked from commit 1d77ac19cfa1c9b194d7e9805430ab6fd38ba97e)
a7eec4
---
a7eec4
 test/integration-test-wrapper.py | 3 +--
a7eec4
 1 file changed, 1 insertion(+), 2 deletions(-)
a7eec4
a7eec4
diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py
a7eec4
index 5321faef57818..a7bf5ea6060d4 100755
a7eec4
--- a/test/integration-test-wrapper.py
a7eec4
+++ b/test/integration-test-wrapper.py
a7eec4
@@ -556,8 +556,7 @@ def main() -> None:
a7eec4
         and not sanitizer
a7eec4
     ):
a7eec4
         journal_file.unlink(missing_ok=True)
a7eec4
-
a7eec4
-    if os.getenv('TEST_JOURNAL_USE_TMP', '0') == '1':
a7eec4
+    elif os.getenv('TEST_JOURNAL_USE_TMP', '0') == '1':
a7eec4
         dst = args.meson_build_dir / f'test/journal/{name}.journal'
a7eec4
         dst.parent.mkdir(parents=True, exist_ok=True)
a7eec4
         shutil.move(journal_file, dst)
a7eec4
a7eec4
From 6cd2c87e4ef1379520c98316ac5d6bcf21ef1bd1 Mon Sep 17 00:00:00 2001
a7eec4
From: Daan De Meyer <daan.j.demeyer@gmail.com>
a7eec4
Date: Tue, 14 Jan 2025 11:41:17 +0100
a7eec4
Subject: [PATCH 22/22] fmf: Only move logs if corresponding directory exists
a7eec4
a7eec4
Otherwise find fails with an error.
a7eec4
a7eec4
(cherry picked from commit 3c2fa8e0501f9f39b3b7ca0506a7d548a39af928)
a7eec4
---
a7eec4
 test/fmf/integration-tests/test.sh | 4 ++--
a7eec4
 1 file changed, 2 insertions(+), 2 deletions(-)
a7eec4
a7eec4
diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh
a7eec4
index f82961f9599d0..aff79340f79fe 100755
a7eec4
--- a/test/fmf/integration-tests/test.sh
a7eec4
+++ b/test/fmf/integration-tests/test.sh
a7eec4
@@ -145,8 +145,8 @@ mkosi -f sandbox \
a7eec4
     --no-stdsplit \
a7eec4
     --num-processes "$NPROC" && EC=0 || EC=$?
a7eec4
 
a7eec4
-find build/meson-logs -type f -exec mv {} "$TMT_TEST_DATA" \;
a7eec4
-find build/test/journal -type f -exec mv {} "$TMT_TEST_DATA" \;
a7eec4
+[[ -d build/meson-logs ]] && find build/meson-logs -type f -exec mv {} "$TMT_TEST_DATA" \;
a7eec4
+[[ -d build/test/journal ]] && find build/test/journal -type f -exec mv {} "$TMT_TEST_DATA" \;
a7eec4
 
a7eec4
 popd
a7eec4