INNER CODE UNIT · Python
test_node_defaults_exported
onedr0p/cluster-template · template/scripts/test_validate.py:150
def test_node_defaults_exported():
data = _load_raw(config_from("private.toml")).model_dump(mode="json")
node = data["nodes"][0]
assert node["mtu"] == 1500
assert node["secureboot"] is False
assert node["kernel_modules"] == []
def test_gateways_may_leave_node_cidr_only_with_bgp():
with_bgp = config_from("public.toml", **{"gateways.external": "192.168.50.1"})
_load_raw(with_bgp) # public.toml enables BGP
without_bgp = config_from("private.toml", **{"gateways.external": "192.168.50.1"})
with pytest.raises(ConfigError, match="required unless BGP is enabled"):
_load_raw(without_bgp)