From 4d938fa865c52c9c327e1b2b45548031ae8e058c Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 21 Mar 2025 15:13:22 +0100 Subject: [PATCH] packit: Load fmf metadata from rpm spec repository Maintaining the fmf metadata and script upstream makes it painful to reuse downstream so let's move the metadata and testing script downstream and load it upstream instead. --- .packit.yml | 15 +++- test/fmf/.fmf/version | 1 - test/fmf/integration-tests/main.fmf | 13 ---- test/fmf/integration-tests/test.sh | 109 ---------------------------- test/fmf/plans/ci.fmf | 12 --- tools/fetch-distro.py | 16 +++- 6 files changed, 25 insertions(+), 141 deletions(-) delete mode 100644 test/fmf/.fmf/version delete mode 100644 test/fmf/integration-tests/main.fmf delete mode 100755 test/fmf/integration-tests/test.sh delete mode 100644 test/fmf/plans/ci.fmf diff --git a/.packit.yml b/.packit.yml index 9111c0e07a0..8989fd43113 100644 --- a/.packit.yml +++ b/.packit.yml @@ -37,8 +37,17 @@ jobs: - job: tests trigger: pull_request - fmf_path: test/fmf - tmt_plan: ci - use_target_repo_for_fmf_url: true + fmf_url: https://src.fedoraproject.org/rpms/systemd + # This is automatically updated by tools/fetch-distro.py --update fedora + fmf_ref: 2ecfbec1a444a2ec9e3dab91d04565330cf809ea targets: - fedora-rawhide-x86_64 + # testing-farm in the Fedora repository is explicitly configured to use testing-farm bare metal runners as + # the volume of pull requests there is very low. Upstream the volume of pull requests is much higher and + # we'll bottleneck ourselves if we insist on bare metal runners, so explicitly do not request support for + # nested virtualization so we don't only consider bare metal runners. + tf_extra_params: + environments: + - hardware: + virtualization: + is-supported: false diff --git a/test/fmf/.fmf/version b/test/fmf/.fmf/version deleted file mode 100644 index d00491fd7e5..00000000000 --- a/test/fmf/.fmf/version +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/test/fmf/integration-tests/main.fmf b/test/fmf/integration-tests/main.fmf deleted file mode 100644 index e7a38d3c009..00000000000 --- a/test/fmf/integration-tests/main.fmf +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later - -summary: Run the upstream integration test suite -test: ./test.sh -duration: 2h -require: - - coreutils - - distribution-gpg-keys - - dnf - - git-core - - koji - - centos-packager - - copr-cli diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh deleted file mode 100755 index 447ab30bf92..00000000000 --- a/test/fmf/integration-tests/test.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: LGPL-2.1-or-later - -set -eux -set -o pipefail - -# Switch SELinux to permissive if possible, since the tests don't set proper contexts -setenforce 0 || true - -echo "CPU and Memory information:" -lscpu -lsmem - -echo "Clock source: $(cat /sys/devices/system/clocksource/clocksource0/current_clocksource)" - -# Bump inotify limits if we can so nspawn containers don't run out of inotify file descriptors. -sysctl fs.inotify.max_user_watches=65536 || true -sysctl fs.inotify.max_user_instances=1024 || true - -if [[ -n "${KOJI_TASK_ID:-}" ]]; then - koji download-task --noprogress --arch="src,noarch,$(rpm --eval '%{_arch}')" "$KOJI_TASK_ID" -elif [[ -n "${CBS_TASK_ID:-}" ]]; then - cbs download-task --noprogress --arch="src,noarch,$(rpm --eval '%{_arch}')" "$CBS_TASK_ID" -elif [[ -n "${PACKIT_SRPM_URL:-}" ]]; then - COPR_BUILD_ID="$(basename "$(dirname "$PACKIT_SRPM_URL")")" - COPR_CHROOT="$(basename "$(dirname "$(dirname "$PACKIT_BUILD_LOG_URL")")")" - copr download-build --rpms --chroot "$COPR_CHROOT" "$COPR_BUILD_ID" - mv "$COPR_CHROOT"/* . -else - echo "Not running within packit and no CBS/koji task ID provided" - exit 1 -fi - -mkdir systemd -rpm2cpio ./systemd-*.src.rpm | cpio --to-stdout --extract './systemd-*.tar.gz' | tar xz --strip-components=1 -C systemd -pushd systemd - -# Now prepare mkosi at the same version required by the systemd repo. -git clone https://github.com/systemd/mkosi -mkosi_hash="$(grep systemd/mkosi@ .github/workflows/mkosi.yml | sed "s|.*systemd/mkosi@||g")" -git -C mkosi checkout "$mkosi_hash" - -export PATH="$PWD/mkosi/bin:$PATH" - -# shellcheck source=/dev/null -. /etc/os-release || . /usr/lib/os-release - -tee mkosi.local.conf <