diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 0da8ccaf04a..433a467ddc5 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -60,48 +60,56 @@ jobs: llvm: 0 cflags: "-O2 -D_FORTIFY_SOURCE=3" relabel: no + qemu: 1 - distro: debian release: testing sanitizers: "" llvm: 0 cflags: "-Og" relabel: no + qemu: 0 - distro: ubuntu release: noble sanitizers: "" llvm: 0 cflags: "-Og" relabel: no + qemu: 0 - distro: fedora release: "41" sanitizers: "" llvm: 0 cflags: "-Og" relabel: yes + qemu: 0 - distro: fedora release: rawhide sanitizers: address,undefined llvm: 1 cflags: "-Og" relabel: yes + qemu: 0 - distro: opensuse release: tumbleweed sanitizers: "" llvm: 0 cflags: "-Og" relabel: no + qemu: 0 - distro: centos release: "9" sanitizers: "" llvm: 0 cflags: "-Og" relabel: yes + qemu: 0 - distro: centos release: "10" sanitizers: "" llvm: 0 cflags: "-Og" relabel: yes + qemu: 0 steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 @@ -210,7 +218,7 @@ jobs: run: sudo meson compile -C build mkosi - name: Run integration tests - run: sudo --preserve-env meson test -C build --no-rebuild --suite integration-tests --print-errorlogs --no-stdsplit --num-processes "$(($(nproc) - 1))" + run: sudo --preserve-env env TEST_PREFER_QEMU=${{ matrix.qemu }} meson test -C build --no-rebuild --suite integration-tests --print-errorlogs --no-stdsplit --num-processes "$(($(nproc) - 1))" - name: Archive failed test journals uses: actions/upload-artifact@v4 diff --git a/test/README.testsuite b/test/README.testsuite index c020847a164..719b9066dc7 100644 --- a/test/README.testsuite +++ b/test/README.testsuite @@ -199,6 +199,8 @@ $ sudo NO_BUILD=1 test/run-integration-tests `TEST_PREFER_NSPAWN=1`: Run all tests that do not require qemu under systemd-nspawn. +`TEST_PREFER_QEMU=1`: Run all tests under qemu. + `TEST_NO_KVM=1`: Disable qemu KVM auto-detection (may be necessary when you're trying to run the *vanilla* qemu and have both qemu and qemu-kvm installed) diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py index 737bbd42724..b417b86441f 100755 --- a/test/integration-test-wrapper.py +++ b/test/integration-test-wrapper.py @@ -177,7 +177,7 @@ def main() -> None: ), '--credential', f"journal.storage={'persistent' if sys.stderr.isatty() else args.storage}", *(['--runtime-build-sources=no'] if not sys.stderr.isatty() else []), - 'qemu' if args.vm or os.getuid() != 0 else 'boot', + 'qemu' if args.vm or os.getuid() != 0 or os.getenv('TEST_PREFER_QEMU', '0') == '1' else 'boot', ] # fmt: skip result = subprocess.run(cmd)