Summary
The render_peer_removal_successful unit test in controlplane/controller/internal/controller/render_test.go only tests unknown BGP peer removal with a single VRF. The template (tunnel.tmpl) iterates UnknownBgpPeers inside each VRF block, but that code path is never exercised with multiple VRFs in the test suite.
What to change
render_test.go — In the render_peer_removal_successful test case:
- Change
UnicastVrfs: []uint16{1} to []uint16{1, 2}
- Assign some tunnels to
VrfId: 2 (e.g., keep tunnel 500 in VRF 1, move 501/502 to VRF 2)
fixtures/unknown.peer.removal.tmpl — Update the golden file to reflect multi-VRF output:
- Add
vrf instance vrf2 and ip routing vrf vrf2
- Move affected tunnel interface declarations to
vrf vrf2
- Add a
vrf vrf2 BGP section with the appropriate neighbors and no neighbor cleanup lines for the unknown peer
Why
The tunnel.tmpl template applies unknown peer removal inside each VRF iteration (lines 300–302):
{{- range $vrfId := .UnicastVrfs }}
vrf vrf{{ $vrfId }}
...
{{- range $.UnknownBgpPeers }}
no neighbor {{ . }}
{{- end }}
{{- end }}
Today, this is only tested with one VRF. A regression in multi-VRF unknown peer removal would go undetected by the unit test suite. The existing multi.vrf.tunnel.tmpl fixture tests multi-VRF rendering but uses UnknownBgpPeers: nil, so it doesn't cover this case.
Scope
Small change — roughly 15 lines in the test data and 20–30 lines in the fixture. No new test infrastructure needed.
Summary
The
render_peer_removal_successfulunit test incontrolplane/controller/internal/controller/render_test.goonly tests unknown BGP peer removal with a single VRF. The template (tunnel.tmpl) iteratesUnknownBgpPeersinside each VRF block, but that code path is never exercised with multiple VRFs in the test suite.What to change
render_test.go— In therender_peer_removal_successfultest case:UnicastVrfs: []uint16{1}to[]uint16{1, 2}VrfId: 2(e.g., keep tunnel 500 in VRF 1, move 501/502 to VRF 2)fixtures/unknown.peer.removal.tmpl— Update the golden file to reflect multi-VRF output:vrf instance vrf2andip routing vrf vrf2vrf vrf2vrf vrf2BGP section with the appropriate neighbors andno neighborcleanup lines for the unknown peerWhy
The
tunnel.tmpltemplate applies unknown peer removal inside each VRF iteration (lines 300–302):Today, this is only tested with one VRF. A regression in multi-VRF unknown peer removal would go undetected by the unit test suite. The existing
multi.vrf.tunnel.tmplfixture tests multi-VRF rendering but usesUnknownBgpPeers: nil, so it doesn't cover this case.Scope
Small change — roughly 15 lines in the test data and 20–30 lines in the fixture. No new test infrastructure needed.