MCPcopy Create free account
hub / github.com/cozystack/talm / TestMultiDocLayer2VIPLinkOnVLANDefaultGateway

Function TestMultiDocLayer2VIPLinkOnVLANDefaultGateway

pkg/engine/render_test.go:2084–2095  ·  view source on GitHub ↗

TestMultiDocLayer2VIPLinkOnVLANDefaultGateway pins that the discovery-derived Layer2VIPConfig.link points at the VLAN sub-interface when the VLAN is the link carrying the default route. The single-link renderer set $vipLinkName = $defaultLinkName on the VLAN branch; the rewrite preserves that semant

(t *testing.T)

Source from the content-addressed store, hash-verified

2082// existing test pinned the VLAN-default-gateway case with floatingIP
2083// set.
2084func TestMultiDocLayer2VIPLinkOnVLANDefaultGateway(t *testing.T) {
2085 output := renderCozystackWith(t, multiNicWithVLANLookup(), map[string]any{
2086 "floatingIP": "192.168.100.10",
2087 })
2088
2089 if !strings.Contains(output, "kind: Layer2VIPConfig") {
2090 t.Errorf("expected Layer2VIPConfig in the rendered output:\n%s", output)
2091 }
2092 if !strings.Contains(output, "link: eth0.4000") {
2093 t.Errorf("expected Layer2VIPConfig.link: eth0.4000 (the VLAN sub-interface carrying the default route), got:\n%s", output)
2094 }
2095}
2096
2097// TestMultiDocBondConfigOmitsMissingBondMasterFields pins the
2098// gracefully-degrading BondConfig render: when discovery returns a

Callers

nothing calls this directly

Calls 2

renderCozystackWithFunction · 0.85
multiNicWithVLANLookupFunction · 0.85

Tested by

no test coverage detected