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

Function TestMultiDocCozystack_BondTopology

pkg/engine/render_test.go:1064–1099  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1062}
1063
1064func TestMultiDocCozystack_BondTopology(t *testing.T) {
1065 origLookup := helmEngine.LookupFunc
1066 t.Cleanup(func() { helmEngine.LookupFunc = origLookup })
1067 helmEngine.LookupFunc = bondTopologyLookup()
1068
1069 chrt, err := loader.LoadDir("../../charts/cozystack")
1070 if err != nil {
1071 t.Fatal(err)
1072 }
1073
1074 values := make(map[string]any)
1075 maps.Copy(values, chrt.Values)
1076 values["endpoint"] = testEndpoint
1077
1078 eng := helmEngine.Engine{}
1079 out, err := eng.Render(chrt, chartutil.Values{
1080 "Values": values,
1081 "TalosVersion": "v1.12",
1082 })
1083 if err != nil {
1084 t.Fatal(err)
1085 }
1086
1087 result := out["cozystack/templates/controlplane.yaml"]
1088 assertContains(t, result, "kind: BondConfig")
1089 assertContains(t, result, "name: bond0")
1090 assertContains(t, result, "- eth0")
1091 assertContains(t, result, "- eth1")
1092 assertContains(t, result, "bondMode: 802.3ad")
1093 assertContains(t, result, "xmitHashPolicy: layer3+4")
1094 assertContains(t, result, "lacpRate: fast")
1095 assertContains(t, result, "address: 192.168.1.100/24")
1096 assertContains(t, result, "gateway: 192.168.1.1")
1097 assertNotContains(t, result, "kind: LinkConfig")
1098 assertNotContains(t, result, "kind: VLANConfig")
1099}
1100
1101func TestMultiDocCozystack_VlanOnBondTopology(t *testing.T) {
1102 origLookup := helmEngine.LookupFunc

Callers

nothing calls this directly

Calls 4

RenderMethod · 0.95
bondTopologyLookupFunction · 0.85
assertContainsFunction · 0.85
assertNotContainsFunction · 0.85

Tested by

no test coverage detected