From: Daan De Meyer Date: Tue, 21 Jan 2025 19:18:15 +0000 (+0100) Subject: tests: Skip booting from directory in user namespace with single user X-Git-Tag: v25~12^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3584d30d354118fb468ddc1a7ab142efcfa493f9;p=thirdparty%2Fmkosi.git tests: Skip booting from directory in user namespace with single user We need newuidmap/newgidmap to be able to boot from a directory which can't ever work in a user namespace with a single user so skip the test in that case. --- diff --git a/tests/test_boot.py b/tests/test_boot.py index 142933aa2..3608b1b0c 100644 --- a/tests/test_boot.py +++ b/tests/test_boot.py @@ -9,6 +9,7 @@ from mkosi.config import Bootloader, Firmware, OutputFormat from mkosi.distributions import Distribution from mkosi.qemu import find_virtiofsd from mkosi.run import find_binary, run +from mkosi.sandbox import userns_has_single_user from mkosi.versioncomp import GenericVersion from . import Image, ImageConfig @@ -51,7 +52,13 @@ def test_format(config: ImageConfig, format: OutputFormat) -> None: if format in (OutputFormat.tar, OutputFormat.oci, OutputFormat.none, OutputFormat.portable): return - if format == OutputFormat.directory and not find_virtiofsd(): + if format == OutputFormat.directory: + if not find_virtiofsd(): + pytest.skip("virtiofsd is not installed, cannot boot from directory output") + + if userns_has_single_user(): + pytest.skip("Running in user namespace with single user, cannot boot from directory") + return image.vm()