diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index b8f54094ed..abe4bbd467 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -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 diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 6f87b76a6c..47a43c689f 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -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 diff --git a/mkosi.conf.d/05-tools/mkosi.conf b/mkosi.conf.d/05-tools/mkosi.conf index 322851b627..6656cee287 100644 --- a/mkosi.conf.d/05-tools/mkosi.conf +++ b/mkosi.conf.d/05-tools/mkosi.conf @@ -5,7 +5,6 @@ ToolsTreePackages= gcc gdb gperf - lcov llvm meson pkgconf diff --git a/mkosi.conf.d/05-tools/mkosi.conf.d/arch.conf b/mkosi.conf.d/05-tools/mkosi.conf.d/arch.conf index c6ec83a6b0..fdb147a1c7 100644 --- a/mkosi.conf.d/05-tools/mkosi.conf.d/arch.conf +++ b/mkosi.conf.d/05-tools/mkosi.conf.d/arch.conf @@ -7,6 +7,7 @@ ToolsTreeDistribution=arch ToolsTreePackages= cryptsetup github-cli + lcov libcap libmicrohttpd libxslt diff --git a/mkosi.conf.d/05-tools/mkosi.conf.d/centos-fedora.conf b/mkosi.conf.d/05-tools/mkosi.conf.d/centos-fedora.conf index 80874391e5..5dc5662115 100644 --- a/mkosi.conf.d/05-tools/mkosi.conf.d/centos-fedora.conf +++ b/mkosi.conf.d/05-tools/mkosi.conf.d/centos-fedora.conf @@ -18,6 +18,5 @@ ToolsTreePackages= python3-lxml python3-mypy python3-pytest - shellcheck libxslt docbook-style-xsl diff --git a/mkosi.conf.d/05-tools/mkosi.conf.d/centos.conf b/mkosi.conf.d/05-tools/mkosi.conf.d/centos.conf deleted file mode 100644 index 737fec3a3d..0000000000 --- a/mkosi.conf.d/05-tools/mkosi.conf.d/centos.conf +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later - -[Match] -ToolsTreeDistribution=centos - -[Build] -ToolsTreeRepositories=epel,epel-next diff --git a/mkosi.conf.d/05-tools/mkosi.conf.d/debian-ubuntu.conf b/mkosi.conf.d/05-tools/mkosi.conf.d/debian-ubuntu.conf index 106072f541..c060e57e82 100644 --- a/mkosi.conf.d/05-tools/mkosi.conf.d/debian-ubuntu.conf +++ b/mkosi.conf.d/05-tools/mkosi.conf.d/debian-ubuntu.conf @@ -7,6 +7,7 @@ ToolsTreeDistribution=|ubuntu [Build] ToolsTreePackages= gh + lcov libblkid-dev libcap-dev libcryptsetup-dev diff --git a/mkosi.conf.d/05-tools/mkosi.conf.d/fedora.conf b/mkosi.conf.d/05-tools/mkosi.conf.d/fedora.conf index 777c13f45c..66592b86ad 100644 --- a/mkosi.conf.d/05-tools/mkosi.conf.d/fedora.conf +++ b/mkosi.conf.d/05-tools/mkosi.conf.d/fedora.conf @@ -5,5 +5,7 @@ ToolsTreeDistribution=fedora [Build] ToolsTreePackages= + lcov gh ruff + shellcheck diff --git a/mkosi.conf.d/05-tools/mkosi.conf.d/opensuse.conf b/mkosi.conf.d/05-tools/mkosi.conf.d/opensuse.conf index 8a659360fa..aeaa325d06 100644 --- a/mkosi.conf.d/05-tools/mkosi.conf.d/opensuse.conf +++ b/mkosi.conf.d/05-tools/mkosi.conf.d/opensuse.conf @@ -5,6 +5,7 @@ ToolsTreeDistribution=opensuse [Build] ToolsTreePackages= + lcov libz1 gh mypy diff --git a/mkosi.conf.d/10-centos/mkosi.conf b/mkosi.conf.d/10-centos/mkosi.conf index d2178315a2..33ba3b8334 100644 --- a/mkosi.conf.d/10-centos/mkosi.conf +++ b/mkosi.conf.d/10-centos/mkosi.conf @@ -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= diff --git a/mkosi.conf.d/10-centos/mkosi.conf.d/10-orphan-file.conf b/mkosi.conf.d/10-centos/mkosi.conf.d/10-orphan-file.conf new file mode 100644 index 0000000000..075df65196 --- /dev/null +++ b/mkosi.conf.d/10-centos/mkosi.conf.d/10-orphan-file.conf @@ -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" diff --git a/test/TEST-64-UDEV-STORAGE/nvme_basic.configure b/test/TEST-64-UDEV-STORAGE/nvme_basic.configure index 948003e4de..ed8304d804 100755 --- a/test/TEST-64-UDEV-STORAGE/nvme_basic.configure +++ b/test/TEST-64-UDEV-STORAGE/nvme_basic.configure @@ -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) diff --git a/test/TEST-64-UDEV-STORAGE/nvme_subsystem.configure b/test/TEST-64-UDEV-STORAGE/nvme_subsystem.configure index 029d4360ba..ed8b39ac5f 100755 --- a/test/TEST-64-UDEV-STORAGE/nvme_subsystem.configure +++ b/test/TEST-64-UDEV-STORAGE/nvme_subsystem.configure @@ -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) diff --git a/test/TEST-64-UDEV-STORAGE/virtio_scsi_identically_named_partitions.configure b/test/TEST-64-UDEV-STORAGE/virtio_scsi_identically_named_partitions.configure index dce6b1503f..5ffade5800 100755 --- a/test/TEST-64-UDEV-STORAGE/virtio_scsi_identically_named_partitions.configure +++ b/test/TEST-64-UDEV-STORAGE/virtio_scsi_identically_named_partitions.configure @@ -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) diff --git a/test/units/TEST-70-TPM2.pcrlock.sh b/test/units/TEST-70-TPM2.pcrlock.sh index 19af3a774d..38274991db 100755 --- a/test/units/TEST-70-TPM2.pcrlock.sh +++ b/test/units/TEST-70-TPM2.pcrlock.sh @@ -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 diff --git a/test/units/TEST-74-AUX-UTILS.run.sh b/test/units/TEST-74-AUX-UTILS.run.sh index d47550c801..83ae352943 100755 --- a/test/units/TEST-74-AUX-UTILS.run.sh +++ b/test/units/TEST-74-AUX-UTILS.run.sh @@ -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)