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

Function TestMultiDocGeneric_BondTopology

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

Source from the content-addressed store, hash-verified

1133}
1134
1135func TestMultiDocGeneric_BondTopology(t *testing.T) {
1136 origLookup := helmEngine.LookupFunc
1137 t.Cleanup(func() { helmEngine.LookupFunc = origLookup })
1138 helmEngine.LookupFunc = bondTopologyLookup()
1139
1140 chrt, err := loader.LoadDir("../../charts/generic")
1141 if err != nil {
1142 t.Fatal(err)
1143 }
1144
1145 values := make(map[string]any)
1146 maps.Copy(values, chrt.Values)
1147 values["endpoint"] = testEndpoint
1148
1149 eng := helmEngine.Engine{}
1150 out, err := eng.Render(chrt, chartutil.Values{
1151 "Values": values,
1152 "TalosVersion": "v1.12",
1153 })
1154 if err != nil {
1155 t.Fatal(err)
1156 }
1157
1158 result := out["generic/templates/controlplane.yaml"]
1159 assertContains(t, result, "kind: BondConfig")
1160 assertContains(t, result, "name: bond0")
1161 assertContains(t, result, "bondMode: 802.3ad")
1162 assertContains(t, result, "- eth0")
1163 assertContains(t, result, "- eth1")
1164 assertNotContains(t, result, "kind: LinkConfig")
1165 assertNotContains(t, result, "kind: VLANConfig")
1166}
1167
1168func TestMultiDocGeneric_VlanOnBondTopology(t *testing.T) {
1169 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