From aa5d34ddb7c1a4499b02caabfab35b45f122cbeb Mon Sep 17 00:00:00 2001 From: Zeref Date: Fri, 1 May 2026 23:23:25 +0530 Subject: [PATCH] chore: cover multiple VRFs for unit test --- .../controller/fixtures/unknown.peer.removal.tmpl | 13 +++++++++++-- .../controller/internal/controller/render_test.go | 6 +++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/controlplane/controller/internal/controller/fixtures/unknown.peer.removal.tmpl b/controlplane/controller/internal/controller/fixtures/unknown.peer.removal.tmpl index c6df425c2f..9593f21d6a 100644 --- a/controlplane/controller/internal/controller/fixtures/unknown.peer.removal.tmpl +++ b/controlplane/controller/internal/controller/fixtures/unknown.peer.removal.tmpl @@ -19,8 +19,10 @@ router pim sparse-mode rp address 10.0.0.0 239.0.0.0/24 override ! vrf instance vrf1 +vrf instance vrf2 ip routing ip routing vrf vrf1 +ip routing vrf vrf2 ! ntp server 0.pool.ntp.org ntp server 1.pool.ntp.org @@ -92,7 +94,7 @@ interface Tunnel500 interface Tunnel501 description USER-UCAST-501 ip access-group SEC-USER-501-IN in - vrf vrf1 + vrf vrf2 mtu 9216 ip address 169.254.0.2/31 tunnel mode gre @@ -105,7 +107,7 @@ interface Tunnel501 interface Tunnel502 description USER-UCAST-502 ip access-group SEC-USER-502-IN in - vrf vrf1 + vrf vrf2 mtu 9216 ip address 169.254.0.4/31 tunnel mode gre @@ -125,6 +127,8 @@ router bgp 65342 ! vrf vrf1 no neighbor 169.254.0.7 + vrf vrf2 + no neighbor 169.254.0.7 ! router bgp 65342 router-id 14.14.14.14 @@ -148,6 +152,11 @@ router bgp 65342 neighbor 169.254.0.1 route-map RM-USER-500-OUT out neighbor 169.254.0.1 maximum-routes 1 neighbor 169.254.0.1 maximum-accepted-routes 1 + vrf vrf2 + rd 65342:2 + route-target import vpn-ipv4 65342:2 + route-target export vpn-ipv4 65342:2 + router-id 7.7.7.7 no neighbor 169.254.0.3 neighbor 169.254.0.3 remote-as 65000 neighbor 169.254.0.3 local-as 21682 no-prepend replace-as diff --git a/controlplane/controller/internal/controller/render_test.go b/controlplane/controller/internal/controller/render_test.go index 0d97c95535..f553a35435 100644 --- a/controlplane/controller/internal/controller/render_test.go +++ b/controlplane/controller/internal/controller/render_test.go @@ -84,7 +84,7 @@ func TestRenderConfig(t *testing.T) { MulticastGroupBlock: "239.0.0.0/24", TelemetryTWAMPListenPort: 862, LocalASN: 21682, - UnicastVrfs: []uint16{1}, + UnicastVrfs: []uint16{1, 2}, Device: &Device{ Interfaces: []Interface{}, PublicIP: net.IP{7, 7, 7, 7}, @@ -113,7 +113,7 @@ func TestRenderConfig(t *testing.T) { OverlayDstIP: net.IP{169, 254, 0, 3}, DzIp: net.IP{100, 0, 0, 1}, Allocated: true, - VrfId: 1, + VrfId: 2, MetroRouting: true, }, { @@ -124,7 +124,7 @@ func TestRenderConfig(t *testing.T) { OverlayDstIP: net.IP{169, 254, 0, 5}, DzIp: net.IP{100, 0, 0, 2}, Allocated: true, - VrfId: 1, + VrfId: 2, MetroRouting: true, }, },