From 5a6a4db7b0701e7908203c188b3b08c1fc14f92c Mon Sep 17 00:00:00 2001 From: Federico Paolinelli Date: Sat, 29 Jun 2024 22:19:00 +0200 Subject: [PATCH] WIP test fix Signed-off-by: Federico Paolinelli --- internal/frr/templates/filters.tmpl | 12 +++++------ .../TestMultipleNeighborsOneV4AndOneV6.golden | 2 -- ...ipleNeighborsOneV4AndOneV6DisableMP.golden | 2 -- .../TestMultipleRoutersMultipleNeighs.golden | 4 ---- internal/frr/testdata/TestSingleSession | 1 - .../frr/testdata/TestSingleSession.golden | 1 - .../frr/testdata/TestSingleSessionBFD.golden | 1 - .../TestSingleSessionWithAlwaysBlock.golden | 11 +++++----- .../TestSingleSessionWithEBGPMultihop.golden | 1 - ...gleSessionWithEBGPMultihopAndExtras.golden | 1 - .../TestSingleSessionWithIPv6SingleHop.golden | 1 - .../TestTwoRoutersTwoNeighbors.golden | 2 -- .../TestTwoRoutersTwoNeighborsBFD.golden | 2 -- .../testdata/TestTwoSessionsAcceptAll.golden | 20 +++++++++---------- .../TestTwoSessionsAcceptSomeV4.golden | 2 -- .../TestTwoSessionsAcceptV4AndV6.golden | 3 --- 16 files changed, 21 insertions(+), 45 deletions(-) diff --git a/internal/frr/templates/filters.tmpl b/internal/frr/templates/filters.tmpl index 3d8b944e..3831a8e5 100644 --- a/internal/frr/templates/filters.tmpl +++ b/internal/frr/templates/filters.tmpl @@ -70,12 +70,17 @@ ipv6 prefix-list {{$plistName}} seq {{counter $plistName}} deny any {{frrIPFamily $i.IPFamily}} prefix-list {{$plistName}} seq {{counter $plistName}} permit {{$i.Prefix}}{{$i.Matcher}} {{- end }} +{{- if .neighbor.Incoming.All }} +ip prefix-list {{$plistName}} seq {{counter $plistName}} permit any +ipv6 prefix-list {{$plistName}} seq {{counter $plistName}} permit any +{{ else}} {{ if not .neighbor.Incoming.PrefixesV4 }} ip prefix-list {{$plistName}} seq {{counter $plistName}} deny any {{- end }} {{ if not .neighbor.Incoming.PrefixesV6 }} ipv6 prefix-list {{$plistName}} seq {{counter $plistName}} deny any {{- end }} +{{- end}} {{- if .neighbor.AlwaysBlock}} @@ -88,15 +93,10 @@ route-map {{$.neighbor.ID}}-in deny {{counter $.neighbor.ID}} match ip address prefix-list {{deniedIncomingList $.neighbor}} route-map {{$.neighbor.ID}}-in deny {{counter $.neighbor.ID}} match ipv6 address prefix-list {{deniedIncomingList $.neighbor}} -{{- end -}} - -{{- if .neighbor.Incoming.All }} -route-map {{$.neighbor.ID}}-in permit {{counter $.neighbor.ID}} -{{ else }} +{{- end }} route-map {{$.neighbor.ID}}-in permit {{counter $.neighbor.ID}} match ip address prefix-list {{allowedIncomingList $.neighbor}} route-map {{$.neighbor.ID}}-in permit {{counter $.neighbor.ID}} match ipv6 address prefix-list {{allowedIncomingList $.neighbor}} -{{- end }} {{- end -}} diff --git a/internal/frr/testdata/TestMultipleNeighborsOneV4AndOneV6.golden b/internal/frr/testdata/TestMultipleNeighborsOneV4AndOneV6.golden index 297f8ef0..c1df9dff 100644 --- a/internal/frr/testdata/TestMultipleNeighborsOneV4AndOneV6.golden +++ b/internal/frr/testdata/TestMultipleNeighborsOneV4AndOneV6.golden @@ -22,7 +22,6 @@ ipv6 prefix-list 192.168.1.2-pl-ipv4 seq 2 deny any - ip prefix-list 192.168.1.2-inpl-ipv4 seq 1 deny any ipv6 prefix-list 192.168.1.2-inpl-ipv4 seq 2 deny any @@ -49,7 +48,6 @@ ip prefix-list 2001:db8::1-pl-ipv6 seq 2 deny any - ip prefix-list 2001:db8::1-inpl-ipv6 seq 1 deny any ipv6 prefix-list 2001:db8::1-inpl-ipv6 seq 2 deny any diff --git a/internal/frr/testdata/TestMultipleNeighborsOneV4AndOneV6DisableMP.golden b/internal/frr/testdata/TestMultipleNeighborsOneV4AndOneV6DisableMP.golden index 120a2984..f33f2057 100644 --- a/internal/frr/testdata/TestMultipleNeighborsOneV4AndOneV6DisableMP.golden +++ b/internal/frr/testdata/TestMultipleNeighborsOneV4AndOneV6DisableMP.golden @@ -22,7 +22,6 @@ ipv6 prefix-list 192.168.1.2-pl-ipv4 seq 2 deny any - ip prefix-list 192.168.1.2-inpl-ipv4 seq 1 deny any ipv6 prefix-list 192.168.1.2-inpl-ipv4 seq 2 deny any @@ -49,7 +48,6 @@ ip prefix-list 2001:db8::1-pl-ipv6 seq 2 deny any - ip prefix-list 2001:db8::1-inpl-ipv6 seq 1 deny any ipv6 prefix-list 2001:db8::1-inpl-ipv6 seq 2 deny any diff --git a/internal/frr/testdata/TestMultipleRoutersMultipleNeighs.golden b/internal/frr/testdata/TestMultipleRoutersMultipleNeighs.golden index 71a0d664..68584f16 100644 --- a/internal/frr/testdata/TestMultipleRoutersMultipleNeighs.golden +++ b/internal/frr/testdata/TestMultipleRoutersMultipleNeighs.golden @@ -22,7 +22,6 @@ ipv6 prefix-list 192.168.1.2-pl-ipv4 seq 2 deny any - ip prefix-list 192.168.1.2-inpl-ipv4 seq 1 deny any ipv6 prefix-list 192.168.1.2-inpl-ipv4 seq 2 deny any @@ -49,7 +48,6 @@ ip prefix-list 2001:db8::1-pl-ipv6 seq 2 deny any - ip prefix-list 2001:db8::1-inpl-ipv6 seq 1 deny any ipv6 prefix-list 2001:db8::1-inpl-ipv6 seq 2 deny any @@ -76,7 +74,6 @@ ipv6 prefix-list 192.170.1.2-pl-ipv4 seq 2 deny any - ip prefix-list 192.170.1.2-inpl-ipv4 seq 1 deny any ipv6 prefix-list 192.170.1.2-inpl-ipv4 seq 2 deny any @@ -103,7 +100,6 @@ ip prefix-list 2001:db9::1-pl-ipv6 seq 2 deny any - ip prefix-list 2001:db9::1-inpl-ipv6 seq 1 deny any ipv6 prefix-list 2001:db9::1-inpl-ipv6 seq 2 deny any diff --git a/internal/frr/testdata/TestSingleSession b/internal/frr/testdata/TestSingleSession index 9c58478b..ab4fbca1 100644 --- a/internal/frr/testdata/TestSingleSession +++ b/internal/frr/testdata/TestSingleSession @@ -26,7 +26,6 @@ ipv6 prefix-list 192.168.1.2-pl-ipv4 seq 3 deny any - ip prefix-list 192.168.1.2-inpl-ipv4 seq 1 deny any ipv6 prefix-list 192.168.1.2-inpl-ipv4 seq 2 deny any diff --git a/internal/frr/testdata/TestSingleSession.golden b/internal/frr/testdata/TestSingleSession.golden index 9c58478b..ab4fbca1 100644 --- a/internal/frr/testdata/TestSingleSession.golden +++ b/internal/frr/testdata/TestSingleSession.golden @@ -26,7 +26,6 @@ ipv6 prefix-list 192.168.1.2-pl-ipv4 seq 3 deny any - ip prefix-list 192.168.1.2-inpl-ipv4 seq 1 deny any ipv6 prefix-list 192.168.1.2-inpl-ipv4 seq 2 deny any diff --git a/internal/frr/testdata/TestSingleSessionBFD.golden b/internal/frr/testdata/TestSingleSessionBFD.golden index 30049af2..89cef43a 100644 --- a/internal/frr/testdata/TestSingleSessionBFD.golden +++ b/internal/frr/testdata/TestSingleSessionBFD.golden @@ -19,7 +19,6 @@ ipv6 prefix-list 192.168.1.2-pl-ipv4 seq 2 deny any - ip prefix-list 192.168.1.2-inpl-ipv4 seq 1 deny any ipv6 prefix-list 192.168.1.2-inpl-ipv4 seq 2 deny any diff --git a/internal/frr/testdata/TestSingleSessionWithAlwaysBlock.golden b/internal/frr/testdata/TestSingleSessionWithAlwaysBlock.golden index 6aa7cc31..4f0a7b8f 100644 --- a/internal/frr/testdata/TestSingleSessionWithAlwaysBlock.golden +++ b/internal/frr/testdata/TestSingleSessionWithAlwaysBlock.golden @@ -18,12 +18,10 @@ ipv6 prefix-list 192.168.1.2-pl-ipv4 seq 2 deny any +ip prefix-list 192.168.1.2-inpl-ipv4 seq 1 permit any +ipv6 prefix-list 192.168.1.2-inpl-ipv4 seq 2 permit any -ip prefix-list 192.168.1.2-inpl-ipv4 seq 1 deny any - -ipv6 prefix-list 192.168.1.2-inpl-ipv4 seq 2 deny any - ip prefix-list 192.168.1.2-denied-inpl-ipv4 seq 1 permit 192.168.1.0/24 le 24 ipv6 prefix-list 192.168.1.2-denied-inpl-ipv4 seq 2 permit fc00:f853:ccd:e800::/64 le 64 @@ -33,7 +31,9 @@ route-map 192.168.1.2-in deny 3 route-map 192.168.1.2-in deny 4 match ipv6 address prefix-list 192.168.1.2-denied-inpl-ipv4 route-map 192.168.1.2-in permit 5 - + match ip address prefix-list 192.168.1.2-inpl-ipv4 +route-map 192.168.1.2-in permit 6 + match ipv6 address prefix-list 192.168.1.2-inpl-ipv4 route-map 192.168.1.6-out permit 1 @@ -52,7 +52,6 @@ ipv6 prefix-list 192.168.1.6-pl-ipv4 seq 2 deny any ip prefix-list 192.168.1.6-inpl-ipv4 seq 1 permit 192.168.2.0/24 - ipv6 prefix-list 192.168.1.6-inpl-ipv4 seq 2 deny any diff --git a/internal/frr/testdata/TestSingleSessionWithEBGPMultihop.golden b/internal/frr/testdata/TestSingleSessionWithEBGPMultihop.golden index d2acaa28..0ccc4e75 100644 --- a/internal/frr/testdata/TestSingleSessionWithEBGPMultihop.golden +++ b/internal/frr/testdata/TestSingleSessionWithEBGPMultihop.golden @@ -26,7 +26,6 @@ ipv6 prefix-list 192.168.1.2-pl-ipv4 seq 3 deny any - ip prefix-list 192.168.1.2-inpl-ipv4 seq 1 deny any ipv6 prefix-list 192.168.1.2-inpl-ipv4 seq 2 deny any diff --git a/internal/frr/testdata/TestSingleSessionWithEBGPMultihopAndExtras.golden b/internal/frr/testdata/TestSingleSessionWithEBGPMultihopAndExtras.golden index c700409a..572c45ac 100644 --- a/internal/frr/testdata/TestSingleSessionWithEBGPMultihopAndExtras.golden +++ b/internal/frr/testdata/TestSingleSessionWithEBGPMultihopAndExtras.golden @@ -26,7 +26,6 @@ ipv6 prefix-list 192.168.1.2-pl-ipv4 seq 3 deny any - ip prefix-list 192.168.1.2-inpl-ipv4 seq 1 deny any ipv6 prefix-list 192.168.1.2-inpl-ipv4 seq 2 deny any diff --git a/internal/frr/testdata/TestSingleSessionWithIPv6SingleHop.golden b/internal/frr/testdata/TestSingleSessionWithIPv6SingleHop.golden index 7e584236..909e653b 100644 --- a/internal/frr/testdata/TestSingleSessionWithIPv6SingleHop.golden +++ b/internal/frr/testdata/TestSingleSessionWithIPv6SingleHop.golden @@ -22,7 +22,6 @@ ip prefix-list 2001:db8::1-pl-ipv6 seq 2 deny any - ip prefix-list 2001:db8::1-inpl-ipv6 seq 1 deny any ipv6 prefix-list 2001:db8::1-inpl-ipv6 seq 2 deny any diff --git a/internal/frr/testdata/TestTwoRoutersTwoNeighbors.golden b/internal/frr/testdata/TestTwoRoutersTwoNeighbors.golden index f2f760bc..e5c9e173 100644 --- a/internal/frr/testdata/TestTwoRoutersTwoNeighbors.golden +++ b/internal/frr/testdata/TestTwoRoutersTwoNeighbors.golden @@ -71,7 +71,6 @@ ipv6 prefix-list 192.168.1.2-pl-ipv4 seq 4 deny any - ip prefix-list 192.168.1.2-inpl-ipv4 seq 1 deny any ipv6 prefix-list 192.168.1.2-inpl-ipv4 seq 2 deny any @@ -98,7 +97,6 @@ ipv6 prefix-list 192.168.1.3-pl-ipv4 seq 2 deny any - ip prefix-list 192.168.1.3-inpl-ipv4 seq 1 deny any ipv6 prefix-list 192.168.1.3-inpl-ipv4 seq 2 deny any diff --git a/internal/frr/testdata/TestTwoRoutersTwoNeighborsBFD.golden b/internal/frr/testdata/TestTwoRoutersTwoNeighborsBFD.golden index 63d18414..a9b7fa07 100644 --- a/internal/frr/testdata/TestTwoRoutersTwoNeighborsBFD.golden +++ b/internal/frr/testdata/TestTwoRoutersTwoNeighborsBFD.golden @@ -19,7 +19,6 @@ ipv6 prefix-list 192.168.1.2-pl-ipv4 seq 2 deny any - ip prefix-list 192.168.1.2-inpl-ipv4 seq 1 deny any ipv6 prefix-list 192.168.1.2-inpl-ipv4 seq 2 deny any @@ -43,7 +42,6 @@ ipv6 prefix-list 192.168.1.3-pl-ipv4 seq 2 deny any - ip prefix-list 192.168.1.3-inpl-ipv4 seq 1 deny any ipv6 prefix-list 192.168.1.3-inpl-ipv4 seq 2 deny any diff --git a/internal/frr/testdata/TestTwoSessionsAcceptAll.golden b/internal/frr/testdata/TestTwoSessionsAcceptAll.golden index 8e6eb978..502f8091 100644 --- a/internal/frr/testdata/TestTwoSessionsAcceptAll.golden +++ b/internal/frr/testdata/TestTwoSessionsAcceptAll.golden @@ -18,13 +18,13 @@ ipv6 prefix-list 192.168.1.2-pl-ipv4 seq 2 deny any +ip prefix-list 192.168.1.2-inpl-ipv4 seq 1 permit any +ipv6 prefix-list 192.168.1.2-inpl-ipv4 seq 2 permit any - -ip prefix-list 192.168.1.2-inpl-ipv4 seq 1 deny any - -ipv6 prefix-list 192.168.1.2-inpl-ipv4 seq 2 deny any route-map 192.168.1.2-in permit 3 - + match ip address prefix-list 192.168.1.2-inpl-ipv4 +route-map 192.168.1.2-in permit 4 + match ipv6 address prefix-list 192.168.1.2-inpl-ipv4 route-map 192.168.1.3-out permit 1 @@ -40,13 +40,13 @@ ipv6 prefix-list 192.168.1.3-pl-ipv4 seq 2 deny any +ip prefix-list 192.168.1.3-inpl-ipv4 seq 1 permit any +ipv6 prefix-list 192.168.1.3-inpl-ipv4 seq 2 permit any - -ip prefix-list 192.168.1.3-inpl-ipv4 seq 1 deny any - -ipv6 prefix-list 192.168.1.3-inpl-ipv4 seq 2 deny any route-map 192.168.1.3-in permit 3 - + match ip address prefix-list 192.168.1.3-inpl-ipv4 +route-map 192.168.1.3-in permit 4 + match ipv6 address prefix-list 192.168.1.3-inpl-ipv4 router bgp 65000 no bgp ebgp-requires-policy diff --git a/internal/frr/testdata/TestTwoSessionsAcceptSomeV4.golden b/internal/frr/testdata/TestTwoSessionsAcceptSomeV4.golden index 6b8f61f4..37bffca1 100644 --- a/internal/frr/testdata/TestTwoSessionsAcceptSomeV4.golden +++ b/internal/frr/testdata/TestTwoSessionsAcceptSomeV4.golden @@ -21,7 +21,6 @@ ipv6 prefix-list 192.168.1.2-pl-ipv4 seq 2 deny any ip prefix-list 192.168.1.2-inpl-ipv4 seq 1 permit 192.168.1.0/24 - ipv6 prefix-list 192.168.1.2-inpl-ipv4 seq 2 deny any route-map 192.168.1.2-in permit 3 match ip address prefix-list 192.168.1.2-inpl-ipv4 @@ -46,7 +45,6 @@ ip prefix-list 192.168.1.3-inpl-ipv4 seq 1 permit 192.170.1.0/24 ip prefix-list 192.168.1.3-inpl-ipv4 seq 2 permit 192.169.1.0/24 - ipv6 prefix-list 192.168.1.3-inpl-ipv4 seq 3 deny any route-map 192.168.1.3-in permit 3 match ip address prefix-list 192.168.1.3-inpl-ipv4 diff --git a/internal/frr/testdata/TestTwoSessionsAcceptV4AndV6.golden b/internal/frr/testdata/TestTwoSessionsAcceptV4AndV6.golden index 8abd16af..173de0ea 100644 --- a/internal/frr/testdata/TestTwoSessionsAcceptV4AndV6.golden +++ b/internal/frr/testdata/TestTwoSessionsAcceptV4AndV6.golden @@ -25,7 +25,6 @@ ip prefix-list 192.168.1.2-inpl-ipv4 seq 4 permit 192.168.3.0/24 le 32 ip prefix-list 192.168.1.2-inpl-ipv4 seq 5 permit 192.168.3.0/24 ge 16 - ipv6 prefix-list 192.168.1.2-inpl-ipv4 seq 6 deny any route-map 192.168.1.2-in permit 3 match ip address prefix-list 192.168.1.2-inpl-ipv4 @@ -52,7 +51,6 @@ ip prefix-list 192.168.1.3-inpl-ipv4 seq 3 permit 192.168.2.0/24 le 26 ge 24 ip prefix-list 192.168.1.3-inpl-ipv4 seq 4 permit 192.168.3.0/24 le 32 ge 27 - ipv6 prefix-list 192.168.1.3-inpl-ipv4 seq 5 deny any route-map 192.168.1.3-in permit 3 match ip address prefix-list 192.168.1.3-inpl-ipv4 @@ -80,7 +78,6 @@ ipv6 prefix-list 192.168.1.4-inpl-ipv4 seq 4 permit fc00:f853:ccd:e801::/64 ge 2 ipv6 prefix-list 192.168.1.4-inpl-ipv4 seq 5 permit fc00:f853:ccd:e802::/64 le 32 - ipv6 prefix-list 192.168.1.4-inpl-ipv4 seq 6 deny any route-map 192.168.1.4-in permit 3 match ip address prefix-list 192.168.1.4-inpl-ipv4