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)
| 1962 | // default-gateway test; physical-as-default-gateway is covered by |
| 1963 | // existing TestMultiDocCozystack_Layer2VIPConfigWhenFloatingIPSet. |
| 1964 | func 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 |
nothing calls this directly
no test coverage detected