packit: Move fmf metadata into upstream (#35700)

This moves https://src.fedoraproject.org/tests/systemd into upstream so
it's one less moving piece that we need to remember.
This commit is contained in:
Yu Watanabe
2025-01-06 10:37:56 +09:00
committed by GitHub
20 changed files with 130 additions and 17 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: systemd/mkosi@ba07d53000b6c560ad0b9f07550aca93c0284e88
- uses: systemd/mkosi@7051715d8541d4d077a218f7445976225ec74d78
# Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space
# immediately, we remove the files in the background. However, we first move them to a different location
+1 -1
View File
@@ -113,7 +113,7 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: systemd/mkosi@ba07d53000b6c560ad0b9f07550aca93c0284e88
- uses: systemd/mkosi@7051715d8541d4d077a218f7445976225ec74d78
# Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space
# immediately, we remove the files in the background. However, we first move them to a different location
+1 -2
View File
@@ -57,8 +57,7 @@ jobs:
- job: tests
trigger: pull_request
fmf_url: https://src.fedoraproject.org/tests/systemd
fmf_ref: main
fmf_path: test/fmf
tmt_plan: ci
targets:
- fedora-rawhide-x86_64
+4 -1
View File
@@ -12,8 +12,11 @@ for DEPS in --requires --recommends --suggests; do
# We need --latest-limit=1 to only consider the newest version of the packages.
# --latest-limit=1 is per <name>.<arch> so we have to pass --arch= explicitly to make sure i686 packages
# are not considered on x86-64.
# Because mkosi does not download the filelists repository metadata, we have to exclude all path based
# dependencies, (even those within /usr and /bin because of
# https://bugzilla.redhat.com/show_bug.cgi?id=2263771).
dnf repoquery --arch="$DISTRIBUTION_ARCHITECTURE,noarch" --latest-limit=1 --quiet "$DEPS" "${PACKAGES[@]}" |
grep --extended-regexp --invert-match --regexp "$(IFS=\| ; echo "${PACKAGES[*]}")" --regexp /bin/sh --regexp grubby --regexp sdubby --regexp libcurl-minimal |
grep --extended-regexp --invert-match --regexp "$(IFS=\| ; echo "${PACKAGES[*]}")" --regexp /bin --regexp /usr --regexp grubby --regexp sdubby --regexp libcurl-minimal |
sort --unique |
xargs --delimiter '\n' --no-run-if-empty mkosi-install
done
@@ -11,7 +11,7 @@ config["QemuArgs"] += ["-device", "virtio-scsi-pci,id=scsi0"]
for i in range(4):
id = f"drivebtrfsbasic{i}"
config["QemuDrives"] += [
config["Drives"] += [
{
"Id": id,
"Size": "350M" if i == 0 else "128M",
@@ -11,7 +11,7 @@ config["QemuArgs"] += ["-device", "virtio-scsi-pci,id=scsi0"]
for i in range(4):
id = f"driveiscsibasic{i}"
config["QemuDrives"] += [
config["Drives"] += [
{
"Id": id,
"Size": "150M" if i == 0 else "70M",
@@ -7,7 +7,7 @@ import sys
config = json.load(sys.stdin)
config["QemuDrives"] += [
config["Drives"] += [
{
"Id": "drive0",
"Size": "64M",
@@ -11,7 +11,7 @@ config["QemuArgs"] += ["-device", "virtio-scsi-pci,id=scsi0"]
for i in range(4):
id = f"drivelvmbasic{i}"
config["QemuDrives"] += [
config["Drives"] += [
{
"Id": id,
"Size": "32M",
@@ -11,7 +11,7 @@ config["QemuArgs"] += ["-device", "virtio-scsi-pci,id=scsi0"]
for i in range(5):
id = f"drivemdadmbasic{i}"
config["QemuDrives"] += [
config["Drives"] += [
{
"Id": id,
"Size": "64M",
@@ -11,7 +11,7 @@ config["QemuArgs"] += ["-device", "virtio-scsi-pci,id=scsi0"]
for i in range(5):
id = f"drivemdadmlvm{i}"
config["QemuDrives"] += [
config["Drives"] += [
{
"Id": id,
"Size": "64M",
@@ -18,7 +18,7 @@ for ndisk in range(16):
for nback in range(4):
id = f"drive{ndisk}x{nback}"
config["QemuDrives"] += [
config["Drives"] += [
{
"Id": id,
"Size": size,
@@ -18,7 +18,7 @@ if 'name "nvme"' not in result.stdout:
def add_drive(i: int, serial: str) -> None:
global config
id = f"nvme{i}"
config["QemuDrives"] += [
config["Drives"] += [
{
"Id": id,
"Size": "1M",
@@ -16,7 +16,7 @@ if 'name "nvme"' not in result.stdout:
exit(77)
for id in ("nvme0", "nvme1"):
config["QemuDrives"] += [
config["Drives"] += [
{
"Id": id,
"Size": "1M",
@@ -9,7 +9,7 @@ config = json.load(sys.stdin)
for i in range(10):
id = f"drivesimultaneousevents{i}"
config["QemuDrives"] += [
config["Drives"] += [
{
"Id": id,
"Size": "128M",
@@ -12,7 +12,7 @@ for i in range(4):
for i in range(128):
id = f"drive{i}"
config["QemuDrives"] += [
config["Drives"] += [
{
"Id": id,
"Size": "1M",
@@ -21,7 +21,7 @@ config["QemuArgs"] += ["-device", "virtio-scsi-pci,id=scsi0,num_queues=4"]
for i in range(0, num_disk):
id = f"drive{i}"
config["QemuDrives"] += [
config["Drives"] += [
{
"Id": id,
"Size": "40M",
+1
View File
@@ -0,0 +1 @@
1
+10
View File
@@ -0,0 +1,10 @@
# 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
+88
View File
@@ -0,0 +1,88 @@
#!/bin/bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -eux
set -o pipefail
# Switch SELinux to permissive, since the tests don't set proper contexts
setenforce 0
# Prepare systemd source tree
git clone "$PACKIT_TARGET_URL" systemd
pushd systemd
# If we're running in a pull request job, merge the remote branch into the current main
if [[ -n "${PACKIT_SOURCE_URL:-}" ]]; then
git remote add pr "${PACKIT_SOURCE_URL:?}"
git fetch pr "${PACKIT_SOURCE_BRANCH:?}"
git merge "pr/$PACKIT_SOURCE_BRANCH"
fi
git log --oneline -5
popd
# Now prepare mkosi, possibly at the same version required by the systemd repo
git clone https://github.com/systemd/mkosi
# If we have it, pin the mkosi version to the same one used by Github Actions, to ensure consistency
if [ -f .github/workflows/mkosi.yml ]; then
mkosi_hash="$(grep systemd/mkosi@ .github/workflows/mkosi.yml | sed "s|.*systemd/mkosi@||g")"
git -C mkosi checkout "$mkosi_hash"
fi
export PATH="$PWD/mkosi/bin:$PATH"
pushd systemd
# shellcheck source=/dev/null
. /etc/os-release || . /usr/lib/os-release
tee mkosi.local.conf <<EOF
[Distribution]
Release=${VERSION_ID:-rawhide}
[Build]
ToolsTreeDistribution=$ID
ToolsTreeRelease=${VERSION_ID:-rawhide}
ToolsTreeSandboxTrees=
/etc/yum.repos.d/:/etc/yum.repos.d/
/var/share/test-artifacts/:/var/share/test-artifacts/
SandboxTrees=
/etc/yum.repos.d/:/etc/yum.repos.d/
/var/share/test-artifacts/:/var/share/test-artifacts/
Environment=NO_BUILD=1
EOF
cat /etc/dnf/dnf.conf
cat /etc/yum.repos.d/*
# Ensure packages built for this test have highest priority
echo -e "\npriority=1" >> /etc/yum.repos.d/copr_build*
# Disable mkosi's own repository logic
touch /etc/yum.repos.d/mkosi.repo
# TODO: drop once BTRFS regression is fixed in kernel 6.13
sed -i "s/Format=btrfs/Format=ext4/" mkosi.repart/10-root.conf
# If we don't have KVM, skip running in qemu, as it's too slow. But try to load the module first.
modprobe kvm || true
if [[ ! -e /dev/kvm ]]; then
export TEST_NO_QEMU=1
fi
# Create missing mountpoint for mkosi sandbox.
mkdir -p /etc/pacman.d/gnupg
mkosi summary
mkosi -f sandbox true
mkosi -f sandbox meson setup --buildtype=debugoptimized -Dintegration-tests=true build
mkosi genkey
mkosi -f sandbox meson compile -C build mkosi
mkosi -f sandbox \
meson test \
-C build \
--no-rebuild \
--suite integration-tests \
--print-errorlogs \
--no-stdsplit \
--num-processes "$(($(nproc) - 1))"
popd
+12
View File
@@ -0,0 +1,12 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
summary: systemd Fedora test suite
discover:
how: fmf
prepare:
- name: systemd
how: install
exclude:
- systemd-standalone-.*
execute:
how: tmt