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
+10 -11
View File
@@ -6,8 +6,11 @@ import io
import pycdlib
import yaml
from napalm_device_types import provisioning as generic
from napalm_vmware.provision.seed import meta_data, network_config, nocloud_iso, user_data
from napalm_vmware import provisioning as prov
from napalm_vmware.provision import seed
from napalm_vmware.provision.seed import meta_data, nocloud_iso, user_data
class TestUserData:
@@ -34,17 +37,13 @@ def test_meta_data():
class TestNetworkConfig:
def test_dhcp_nics_matched_by_mac(self):
cfg = network_config([("00:50:56:aa:bb:cc", True), ("00:50:56:aa:bb:dd", False)])
assert cfg == {
"version": 2,
"ethernets": {
"nic0": {"match": {"macaddress": "00:50:56:aa:bb:cc"}, "dhcp4": True},
},
}
"""Written by napalm-device-types, which Proxmox uses as well (NetOrk/netork#794)."""
def test_no_dhcp_nic_means_no_network_config(self):
assert network_config([("00:50:56:aa:bb:cc", False)]) is None
def test_the_seed_is_built_with_the_generic_network_config(self):
assert prov.network_config is generic.network_config
def test_no_copy_of_it_is_left_here(self):
assert not hasattr(seed, "network_config")
def _read(iso: bytes, name: str) -> str: