From 0250db0139b159cb9e6c1a87ad91ffdd03e80236 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 8 Jan 2025 10:25:05 +0100 Subject: [PATCH 1/3] fmf: Don't fail if we can't put selinux in permissive mode The tests might be running unprivileged or in an environment without selinux so let's not fail if we can't put it in permissive mode. --- test/fmf/integration-tests/test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh index 4984fb119b..fe139567bd 100755 --- a/test/fmf/integration-tests/test.sh +++ b/test/fmf/integration-tests/test.sh @@ -4,8 +4,8 @@ set -eux set -o pipefail -# Switch SELinux to permissive, since the tests don't set proper contexts -setenforce 0 +# Switch SELinux to permissive if possible, since the tests don't set proper contexts +setenforce 0 || true # Allow running the integration tests downstream in dist-git with something like # the following snippet which makes the dist-git sources available in $TMT_SOURCE_DIR: From 0a85b3757968a2750286119760244e017c990263 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 8 Jan 2025 10:25:50 +0100 Subject: [PATCH 2/3] fmf: Fix dist-git example All that's needed is dist-git-source: true so remove the other settings that aren't required. --- test/fmf/integration-tests/test.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh index fe139567bd..73771d4237 100755 --- a/test/fmf/integration-tests/test.sh +++ b/test/fmf/integration-tests/test.sh @@ -13,9 +13,6 @@ setenforce 0 || true # summary: systemd Fedora test suite # discover: # how: fmf -# url: https://github.com/systemd/systemd -# ref: main -# path: test/fmf # dist-git-source: true # dist-git-install-builddeps: false # prepare: From fc1b08dee2ccf706580fa448e66831d1e853d054 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 8 Jan 2025 10:38:21 +0100 Subject: [PATCH 3/3] fmf: Fix glob Globs inside quotes aren't expanded and we need the glob to be more specific to avoid matching multiple entries inside the tmt source directory. --- test/fmf/integration-tests/test.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh index 73771d4237..0a1595fa97 100755 --- a/test/fmf/integration-tests/test.sh +++ b/test/fmf/integration-tests/test.sh @@ -23,8 +23,11 @@ setenforce 0 || true # execute: # how: tmt +shopt -s extglob + if [[ -n "${TMT_SOURCE_DIR:-}" ]]; then - pushd "$TMT_SOURCE_DIR/*/" + # Match either directories ending with branch names (e.g. systemd-fmf) or releases (e.g systemd-257.1). + pushd "$TMT_SOURCE_DIR"/systemd-+([0-9a-z.~])/ elif [[ -n "${PACKIT_TARGET_URL:-}" ]]; then # Prepare systemd source tree git clone "$PACKIT_TARGET_URL" systemd --branch "$PACKIT_TARGET_BRANCH"