Skip to content

Commit

Permalink
WIP test fix
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Paolinelli <[email protected]>
  • Loading branch information
fedepaol committed Jun 29, 2024
1 parent 7da96e0 commit 9e974f2
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 45 deletions.
12 changes: 6 additions & 6 deletions internal/frr/templates/filters.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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}}

Expand All @@ -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 -}}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion internal/frr/testdata/TestSingleSession
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion internal/frr/testdata/TestSingleSession.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion internal/frr/testdata/TestSingleSessionBFD.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 5 additions & 6 deletions internal/frr/testdata/TestSingleSessionWithAlwaysBlock.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions internal/frr/testdata/TestTwoRoutersTwoNeighbors.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions internal/frr/testdata/TestTwoRoutersTwoNeighborsBFD.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
20 changes: 10 additions & 10 deletions internal/frr/testdata/TestTwoSessionsAcceptAll.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions internal/frr/testdata/TestTwoSessionsAcceptSomeV4.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions internal/frr/testdata/TestTwoSessionsAcceptV4AndV6.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9e974f2

Please sign in to comment.