feat(vm-provision): declare the guest agent per guest OS, Linux only
CI / test (3.10) (push) Successful in 30s
CI / test (3.11) (push) Successful in 26s
CI / test (3.12) (push) Successful in 28s
CI / test (3.10) (pull_request) Successful in 27s
CI / test (3.11) (pull_request) Successful in 26s
CI / test (3.12) (pull_request) Successful in 27s

Follows napalm-device-types 3.0, which replaces GUEST_AGENT_PACKAGES /
GUEST_AGENT_RUNCMD with GUEST_AGENTS = {guest_os: (packages, runcmd)}.
VMware lists Linux with open-vm-tools, as before, and refuses any other
guest_os before anything is created: BSD guests on VMware are optional
for now (NetOrk/netork#801).

The NoCloud network-config moved to napalm-device-types
(`provisioning.network_config`), which Proxmox now uses as well; the seed
module's copy is gone, and the tests check that the generic one is used.
This commit is contained in:
Christian Manivong
2026-10-08 07:54:13 +02:00
parent 0430ded280
commit b5c830acfe
8 changed files with 53 additions and 35 deletions
+12
View File
@@ -152,6 +152,18 @@ class TestCreate:
staged.cache.return_value.vmdk.assert_not_called()
staged.import_ovf.assert_not_called()
@pytest.mark.parametrize("guest_os", ["freebsd", "openbsd"])
def test_a_guest_other_than_linux_is_refused_before_anything_happens(
self, driver, staged, guest_os
):
with pytest.raises(ValueError, match=guest_os):
_create(driver, guest_os=guest_os)
staged.cache.return_value.vmdk.assert_not_called()
staged.import_ovf.assert_not_called()
def test_linux_is_the_default_guest(self, driver, staged):
assert _create(driver, guest_os="linux")["vmid"] == "uuid-99"
def test_placement_refusal_is_a_runtime_error(self, driver, staged):
with patch.object(prov, "choose_placement", side_effect=ValueError("no host")):
with pytest.raises(RuntimeError, match="no host"):