diff --git a/tests/test_bootstrap.py b/tests/test_bootstrap.py index 0e69bef7c..7d8156530 100755 --- a/tests/test_bootstrap.py +++ b/tests/test_bootstrap.py @@ -67,6 +67,10 @@ LINUX_INSTALLER_REMEDY = re.compile(r"^host-setup/linux/install-tools\.sh --upgrade (\S+)$") WINDOWS_INSTALLER_REMEDY = re.compile(r"^host-setup/windows/install-tools\.ps1 -Upgrade (\S+)$") +RUNS_LINUX_INSTALLER = unittest.skipUnless( + sys.platform == "linux", "executes install-tools.sh, which only a Linux host can run" +) + # A spec tool an installer deliberately does not manage, and the reason, recorded so an omission is a decision somebody made rather than one nobody noticed. # Both sets are empty, which is itself the assertion: docker installs the same way on a hypervisor and a workstation on both platforms now, and the one case that differs, a WSL distribution, is handled inside install-tools.sh itself (it skips the native install and points at Docker Desktop's own WSL integration) rather than by leaving docker unmanaged on Linux entirely. NOT_MANAGED: dict[str, dict[str, str]] = { @@ -240,6 +244,7 @@ def test_ripgrep_uses_the_platform_package_managers(self) -> None: r"Name = 'ripgrep'; Package = 'BurntSushi\.ripgrep\.MSVC'; Probe = 'rg'", ) + @RUNS_LINUX_INSTALLER def test_linux_installer_lists_a_repository_apt_package(self) -> None: """A repository package joins the managed set without becoming executable text.""" declaration = { @@ -263,6 +268,7 @@ def test_linux_installer_lists_a_repository_apt_package(self) -> None: self.assertIn("virt-customize", result.stdout) self.assertIn("apt:libguestfs-tools (repository)", result.stdout) + @RUNS_LINUX_INSTALLER def test_linux_installer_rejects_a_repository_collision(self) -> None: """Repository metadata cannot replace a fleet tool's specialized installer.""" declaration = { @@ -285,6 +291,7 @@ def test_linux_installer_rejects_a_repository_collision(self) -> None: self.assertNotEqual(result.returncode, 0) self.assertIn("cannot replace it", result.stderr) + @RUNS_LINUX_INSTALLER def test_linux_installer_rejects_duplicate_repository_names(self) -> None: """Duplicate overlay names are ambiguous and fail before selection.""" entry = { @@ -305,6 +312,7 @@ def test_linux_installer_rejects_duplicate_repository_names(self) -> None: self.assertNotEqual(result.returncode, 0) self.assertIn("more than once", result.stderr) + @RUNS_LINUX_INSTALLER def test_linux_installer_rejects_an_unnamed_repository_tool(self) -> None: """Malformed applicable metadata fails instead of disappearing from the catalog.""" declaration = { @@ -322,6 +330,7 @@ def test_linux_installer_rejects_an_unnamed_repository_tool(self) -> None: self.assertNotEqual(result.returncode, 0) self.assertIn("Cannot read constrained Linux install metadata", result.stderr) + @RUNS_LINUX_INSTALLER def test_linux_installer_rejects_a_non_string_package(self) -> None: """JSON scalars do not become package identifiers through jq stringification.""" declaration = { @@ -344,6 +353,7 @@ def test_linux_installer_rejects_a_non_string_package(self) -> None: self.assertNotEqual(result.returncode, 0) self.assertIn("Cannot read constrained Linux install metadata", result.stderr) + @RUNS_LINUX_INSTALLER def test_linux_installer_rejects_extra_install_metadata(self) -> None: """The runtime trust boundary matches the schema's closed package object.""" declaration = {