mkosi: Various tools tree fixes (#36059)

This commit is contained in:
Daan De Meyer
2025-01-21 15:17:36 +01:00
committed by GitHub
16 changed files with 60 additions and 35 deletions

View File

@@ -25,7 +25,7 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: systemd/mkosi@c1ae257e270e768088eadf7b44fbbbb48c575709
- uses: systemd/mkosi@00db6f1a12fb04ed9f837b40ff34f82fab4d4a03
# 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
@@ -83,21 +83,25 @@ jobs:
run: mkosi summary
- name: Build tools tree
run: mkosi -f sandbox true
- name: PATH
run: echo "$PATH"
run: sudo --preserve-env mkosi -f sandbox true
- name: Configure meson
run: mkosi sandbox meson setup --buildtype=debugoptimized -Dintegration-tests=true build
run: |
sudo --preserve-env --preserve-env=PATH \
mkosi sandbox \
meson setup \
--buildtype=debugoptimized \
-Dintegration-tests=true \
build
- name: Build image
run: sudo --preserve-env mkosi sandbox meson compile -C build mkosi
- name: Initial coverage report
run: |
mkdir -p build/test/coverage
mkosi sandbox \
sudo --preserve-env mkdir -p build/test/coverage
sudo --preserve-env \
mkosi sandbox \
lcov \
--directory build/mkosi.builddir/arch~rolling~x86-64 \
--capture \
@@ -141,7 +145,7 @@ jobs:
lcov_args+=(--add-tracefile "${file}")
done < <(find build/test/coverage -name "TEST-*.coverage-info")
mkosi sandbox lcov --ignore-errors inconsistent,inconsistent "${lcov_args[@]}" --output-file build/test/coverage/everything.coverage-info
sudo --preserve-env mkosi sandbox lcov --ignore-errors inconsistent,inconsistent "${lcov_args[@]}" --output-file build/test/coverage/everything.coverage-info
- name: List coverage report
run: mkosi sandbox lcov --ignore-errors inconsistent,inconsistent --list build/test/coverage/everything.coverage-info

View File

@@ -120,7 +120,7 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: systemd/mkosi@c1ae257e270e768088eadf7b44fbbbb48c575709
- uses: systemd/mkosi@00db6f1a12fb04ed9f837b40ff34f82fab4d4a03
# 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
@@ -159,8 +159,8 @@ jobs:
[Build]
UseSubvolumes=yes
ToolsTreeDistribution=fedora
ToolsTreeRelease=rawhide
ToolsTreeDistribution=${{ matrix.distro }}
ToolsTreeRelease=${{ matrix.release }}
WorkspaceDirectory=$TMPDIR
PackageCacheDirectory=$TMPDIR/cache
@@ -188,16 +188,28 @@ jobs:
run: mkosi summary
- name: Build tools tree
run: mkosi -f sandbox true
run: sudo --preserve-env mkosi -f sandbox true
- name: Configure meson
run: mkosi sandbox meson setup --buildtype=debugoptimized -Dintegration-tests=true build
run: |
sudo --preserve-env --preserve-env=PATH \
mkosi sandbox \
meson setup \
--buildtype=debugoptimized \
-Dintegration-tests=true \
build
- name: Build image
run: sudo --preserve-env mkosi sandbox meson compile -C build mkosi
- name: Run integration tests
run: |
if [[ "$(mkosi sandbox meson test --help)" == *"--max-lines"* ]]; then
MAX_LINES=(--max-lines 300)
else
MAX_LINES=()
fi
sudo --preserve-env \
mkosi sandbox \
env \
@@ -210,7 +222,7 @@ jobs:
--print-errorlogs \
--no-stdsplit \
--num-processes "$(($(nproc) - 1))" \
--max-lines 300
"${MAX_LINES[@]}"
- name: Archive failed test journals
uses: actions/upload-artifact@v4

View File

@@ -5,7 +5,6 @@ ToolsTreePackages=
gcc
gdb
gperf
lcov
llvm
meson
pkgconf

View File

@@ -7,6 +7,7 @@ ToolsTreeDistribution=arch
ToolsTreePackages=
cryptsetup
github-cli
lcov
libcap
libmicrohttpd
libxslt

View File

@@ -18,6 +18,5 @@ ToolsTreePackages=
python3-lxml
python3-mypy
python3-pytest
shellcheck
libxslt
docbook-style-xsl

View File

@@ -1,7 +0,0 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Match]
ToolsTreeDistribution=centos
[Build]
ToolsTreeRepositories=epel,epel-next

View File

@@ -7,6 +7,7 @@ ToolsTreeDistribution=|ubuntu
[Build]
ToolsTreePackages=
gh
lcov
libblkid-dev
libcap-dev
libcryptsetup-dev

View File

@@ -5,5 +5,7 @@ ToolsTreeDistribution=fedora
[Build]
ToolsTreePackages=
lcov
gh
ruff
shellcheck

View File

@@ -5,6 +5,7 @@ ToolsTreeDistribution=opensuse
[Build]
ToolsTreePackages=
lcov
libz1
gh
mypy

View File

@@ -12,9 +12,6 @@ Environment=
# fails to mount on duplicate filesystem UUIDs which happens when running tests in parallel so we use
# ext4 instead.
SYSTEMD_REPART_OVERRIDE_FSTYPE_ROOT=ext4
# The kernel versions in CentOS Stream 9 doesn't support orphan_file, but later versions of
# mkfs.ext4 enabled it by default, so we disable it explicitly.
SYSTEMD_REPART_MKFS_OPTIONS_EXT4="-O ^orphan_file"
[Content]
Packages=

View File

@@ -0,0 +1,13 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Match]
ToolsTreeDistribution=|!centos
ToolsTreeRelease=|!9
[Build]
# The kernel versions in CentOS Stream 9 doesn't support orphan_file, but later versions of
# mkfs.ext4 enabled it by default, so we disable it explicitly. Except that older versions
# of mkfs.ext4 don't know about "orphan_file" so we skip it on some tools tree variants where
# we know "orphan_file" is not supported.
Environment=
SYSTEMD_REPART_MKFS_OPTIONS_EXT4="-O ^orphan_file"

View File

@@ -3,13 +3,14 @@
import json
import os
import shutil
import subprocess
import sys
config = json.load(sys.stdin)
qemu = f"qemu-system-{os.environ['QEMU_ARCHITECTURE']}"
qemu = shutil.which("/usr/libexec/qemu-kvm") or f"qemu-system-{os.environ['QEMU_ARCHITECTURE']}"
result = subprocess.run([qemu, "-device", "help"], check=True, text=True, stdout=subprocess.PIPE)
if 'name "nvme"' not in result.stdout:
print("nvme device driver is not available, skipping test...", file=sys.stderr)

View File

@@ -3,13 +3,14 @@
import json
import os
import shutil
import subprocess
import sys
config = json.load(sys.stdin)
qemu = f"qemu-system-{os.environ['QEMU_ARCHITECTURE']}"
qemu = shutil.which("/usr/libexec/qemu-kvm") or f"qemu-system-{os.environ['QEMU_ARCHITECTURE']}"
result = subprocess.run([qemu, "-device", "help"], check=True, text=True, stdout=subprocess.PIPE)
if 'name "nvme"' not in result.stdout:
print("nvme device driver is not available, skipping test...", file=sys.stderr)

View File

@@ -3,13 +3,14 @@
import json
import os
import shutil
import subprocess
import sys
config = json.load(sys.stdin)
qemu = f"qemu-system-{os.environ['QEMU_ARCHITECTURE']}"
qemu = shutil.which("/usr/libexec/qemu-kvm") or f"qemu-system-{os.environ['QEMU_ARCHITECTURE']}"
result = subprocess.run([qemu, "-device", "help"], check=True, text=True, stdout=subprocess.PIPE)
if 'name "virtio-scsi-pci"' not in result.stdout:
print("virtio-scsi-pci device driver is not available, skipping test...", file=sys.stderr)

View File

@@ -205,3 +205,8 @@ varlinkctl call /run/systemd/io.systemd.PCRLock io.systemd.PCRLock.MakePolicy '{
varlinkctl call --collect --json=pretty /run/systemd/io.systemd.PCRLock io.systemd.PCRLock.ReadEventLog '{}'
rm "$img" /tmp/pcrlockpwd
# For issue #35746
for _ in {0..10}; do
run0 /usr/lib/systemd/systemd-pcrlock
done

View File

@@ -271,11 +271,6 @@ if [[ -e /usr/lib/pam.d/systemd-run0 ]] || [[ -e /etc/pam.d/systemd-run0 ]]; the
# Validate when we invoke run0 without a tty, that depending on --pty it either allocates a tty or not
assert_neq "$(run0 --pty tty < /dev/null)" "not a tty"
assert_eq "$(run0 --pipe tty < /dev/null)" "not a tty"
# For issue #35746
for _ in {0..10}; do
run0 /usr/lib/systemd/systemd-pcrlock
done
fi
# Tests whether intermediate disconnects corrupt us (modified testcase from https://github.com/systemd/systemd/issues/27204)