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

Function TestMultiDocLayer2VIPLinkOnBondDefaultGateway

pkg/engine/render_test.go:1964–1975  ·  view source on GitHub ↗

TestMultiDocLayer2VIPLinkOnBondDefaultGateway pins that the discovery-derived Layer2VIPConfig.link points at the bond master when the bond is the IPv4-default link. Mirror of the VLAN-as- default-gateway test; physical-as-default-gateway is covered by existing TestMultiDocCozystack_Layer2VIPConfigWh

(t *testing.T)

Source from the content-addressed store, hash-verified

1962// default-gateway test; physical-as-default-gateway is covered by
1963// existing TestMultiDocCozystack_Layer2VIPConfigWhenFloatingIPSet.
1964func TestMultiDocLayer2VIPLinkOnBondDefaultGateway(t *testing.T) {
1965 output := renderCozystackWith(t, bondWithSlavesLookup(), map[string]any{
1966 "floatingIP": "192.168.201.5",
1967 })
1968
1969 if !strings.Contains(output, "kind: Layer2VIPConfig") {
1970 t.Errorf("expected Layer2VIPConfig in the rendered output:\n%s", output)
1971 }
1972 if !strings.Contains(output, "link: bond0") {
1973 t.Errorf("expected Layer2VIPConfig.link: bond0 (the bond master carrying the default route), got:\n%s", output)
1974 }
1975}
1976
1977// TestMultiDocFailsWhenVLANHasNoParent pins that the renderer
1978// surfaces a clear error when a VLAN link discovered without a

Callers

nothing calls this directly

Calls 2

renderCozystackWithFunction · 0.85
bondWithSlavesLookupFunction · 0.85

Tested by

no test coverage detected