Skip to content

Commit

Permalink
topotato: fix template whitespace
Browse files Browse the repository at this point in the history
whitespace-only change to get consistent formatting *inside* the jinja2
config template strings.

Signed-off-by: David Lamparter <[email protected]>
  • Loading branch information
eqvinox committed Apr 25, 2023
1 parent 209d295 commit a09a405
Show file tree
Hide file tree
Showing 17 changed files with 179 additions and 180 deletions.
4 changes: 2 additions & 2 deletions test_bgp-ebgp-common-subnet-nexthop-unchanged.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ class Configs(FRRConfigs):
#% block main
#% if router.name == 'r1'
interface lo
ip address {{ routers.r1.lo_ip4[0] }}
ip address {{ routers.r1.lo_ip4[0] }}
!
interface r1-eth0
ip address {{ routers.r1.ifaces[0].ip4[0].ip }}
!
#% endif
#% for iface in router.ifaces
interface {{ iface.ifname }}
ip address {{ iface.ip4[0] }}
ip address {{ iface.ip4[0] }}
!
#% endfor
ip forwarding
Expand Down
22 changes: 11 additions & 11 deletions test_bgp_aggregate_address_origin.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ class Configs(FRRConfigs):
#% block main
#% if router.name == 'r2'
router bgp 65001
no bgp ebgp-requires-policy
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} remote-as 65000
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} timers 3 10
exit-address-family
no bgp ebgp-requires-policy
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} remote-as 65000
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} timers 3 10
exit-address-family
!
#% elif router.name == 'r1'
router bgp 65000
no bgp ebgp-requires-policy
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} remote-as 65001
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} timers 3 10
address-family ipv4 unicast
redistribute connected
aggregate-address 172.16.255.0/24 origin igp
exit-address-family
no bgp ebgp-requires-policy
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} remote-as 65001
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} timers 3 10
address-family ipv4 unicast
redistribute connected
aggregate-address 172.16.255.0/24 origin igp
exit-address-family
!
#% endif
#% endblock
Expand Down
24 changes: 12 additions & 12 deletions test_bgp_aggregate_address_route_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,23 @@ class Configs(FRRConfigs):
#% block main
#% if router.name == 'r2'
router bgp 65001
no bgp ebgp-requires-policy
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} remote-as 65000
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} timers 3 10
exit-address-family
no bgp ebgp-requires-policy
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} remote-as 65000
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} timers 3 10
exit-address-family
!
#% elif router.name == 'r1'
router bgp 65000
no bgp ebgp-requires-policy
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} remote-as 65001
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} timers 3 10
address-family ipv4 unicast
redistribute connected
aggregate-address 172.16.255.0/24 route-map aggr-rmap
exit-address-family
no bgp ebgp-requires-policy
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} remote-as 65001
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} timers 3 10
address-family ipv4 unicast
redistribute connected
aggregate-address 172.16.255.0/24 route-map aggr-rmap
exit-address-family
!
route-map aggr-rmap permit 10
set metric 123
set metric 123
!
#% endif
#% endblock
Expand Down
28 changes: 14 additions & 14 deletions test_bgp_as_wide_bgp_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,26 @@ class Configs(FRRConfigs):
#% block main
#% if router.name == 'r1'
router bgp 65001
bgp router-id 10.10.10.10
no bgp ebgp-requires-policy
neighbor 192.168.255.1 remote-as 65002
neighbor 192.168.255.1 timers 3 10
bgp router-id 10.10.10.10
no bgp ebgp-requires-policy
neighbor 192.168.255.1 remote-as 65002
neighbor 192.168.255.1 timers 3 10
!
#% elif router.name == 'r2'
router bgp 65002
bgp router-id 10.10.10.10
no bgp ebgp-requires-policy
neighbor 192.168.255.2 remote-as 65001
neighbor 192.168.255.2 timers 3 10
neighbor 192.168.255.3 remote-as 65002
neighbor 192.168.255.3 timers 3 10
bgp router-id 10.10.10.10
no bgp ebgp-requires-policy
neighbor 192.168.255.2 remote-as 65001
neighbor 192.168.255.2 timers 3 10
neighbor 192.168.255.3 remote-as 65002
neighbor 192.168.255.3 timers 3 10
!
#% elif router.name == 'r3'
router bgp 65002
bgp router-id 10.10.10.10
no bgp ebgp-requires-policy
neighbor 192.168.255.1 remote-as 65002
neighbor 192.168.255.1 timers 3 10
bgp router-id 10.10.10.10
no bgp ebgp-requires-policy
neighbor 192.168.255.1 remote-as 65002
neighbor 192.168.255.1 timers 3 10
!
#% endif
#% endblock
Expand Down
14 changes: 7 additions & 7 deletions test_bgp_aspath_zero.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Configs(FRRConfigs):
#% block main
#% for iface in router.ifaces
interface {{ iface.ifname }}
ip address {{ iface.ip4[0] }}
ip address {{ iface.ip4[0] }}
!
#% endfor
ip forwarding
Expand All @@ -40,16 +40,16 @@ class Configs(FRRConfigs):
"""

bgpd = """
#% block main
#% block main
#% if router.name == 'r1'
router bgp 65534
no bgp ebgp-requires-policy
neighbor {{ routers.peer1.ifaces[0].ip4[0].ip }} remote-as 65001
neighbor {{ routers.peer1.ifaces[0].ip4[0].ip }} timers 3 10
no bgp ebgp-requires-policy
neighbor {{ routers.peer1.ifaces[0].ip4[0].ip }} remote-as 65001
neighbor {{ routers.peer1.ifaces[0].ip4[0].ip }} timers 3 10
!
#% endif
#% endblock
"""
#% endblock
"""


class BGPAggregatorZero(TestBase, AutoFixture, topo=topology, configs=Configs):
Expand Down
32 changes: 16 additions & 16 deletions test_bgp_default-originate_route-map_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,31 @@ class Configs(FRRConfigs):
#% block main
#% if router.name == 'r2'
router bgp 65001
no bgp ebgp-requires-policy
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} remote-as 65000
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} timers 3 10
address-family ipv4 unicast
redistribute connected
exit-address-family
no bgp ebgp-requires-policy
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} remote-as 65000
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} timers 3 10
address-family ipv4 unicast
redistribute connected
exit-address-family
!
#% elif router.name == 'r1'
router bgp 65000
no bgp ebgp-requires-policy
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} remote-as 65001
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} timers 3 10
address-family ipv4 unicast
redistribute connected
network 192.168.13.0/24 route-map internal
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} default-originate route-map default
exit-address-family
no bgp ebgp-requires-policy
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} remote-as 65001
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} timers 3 10
address-family ipv4 unicast
redistribute connected
network 192.168.13.0/24 route-map internal
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} default-originate route-map default
exit-address-family
!
bgp community-list standard default seq 5 permit 65000:1
!
route-map default permit 10
match community default
match community default
!
route-map internal permit 10
set community 65000:1
set community 65000:1
!
#% endif
#% endblock
Expand Down
30 changes: 15 additions & 15 deletions test_bgp_default_originate.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ class Configs(FRRConfigs):
#% block main
#% if router.name == 'r1'
interface lo
ip address {{ routers.r1.lo_ip4[0] }}
ip address {{ routers.r1.lo_ip4[0] }}
!
#% endif
#% for iface in router.ifaces
interface {{ iface.ifname }}
ip address {{ iface.ip4[0] }}
ip address {{ iface.ip4[0] }}
!
#% endfor
ip forwarding
Expand All @@ -46,26 +46,26 @@ class Configs(FRRConfigs):
"""

bgpd = """
#% block main
#% block main
#% if router.name == 'r2'
router bgp 65001
no bgp ebgp-requires-policy
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} remote-as 65000
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} timers 3 10
exit-address-family
no bgp ebgp-requires-policy
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} remote-as 65000
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} timers 3 10
exit-address-family
!
#% elif router.name == 'r1'
router bgp 65000
no bgp ebgp-requires-policy
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} remote-as 65001
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} timers 3 10
address-family ipv4 unicast
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} default-originate
exit-address-family
no bgp ebgp-requires-policy
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} remote-as 65001
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} timers 3 10
address-family ipv4 unicast
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} default-originate
exit-address-family
!
#% endif
#% endblock
"""
#% endblock
"""


class BGPDefaultOriginate(TestBase, AutoFixture, topo=topology, configs=Configs):
Expand Down
36 changes: 18 additions & 18 deletions test_bgp_default_originate_route_map_match_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,33 +57,33 @@ class Configs(FRRConfigs):
#% block main
#% if router.name == 'r2'
router bgp 65001
no bgp ebgp-requires-policy
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} remote-as 65000
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} timers 3 10
address-family ipv4 unicast
redistribute connected
exit-address-family
no bgp ebgp-requires-policy
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} remote-as 65000
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} timers 3 10
address-family ipv4 unicast
redistribute connected
exit-address-family
!
#% elif router.name == 'r1'
router bgp 65000
no bgp ebgp-requires-policy
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} remote-as 65001
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} timers 3 10
address-family ipv4 unicast
redistribute connected
network 192.168.13.0/24 route-map internal
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} default-originate route-map default
exit-address-family
no bgp ebgp-requires-policy
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} remote-as 65001
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} timers 3 10
address-family ipv4 unicast
redistribute connected
network 192.168.13.0/24 route-map internal
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} default-originate route-map default
exit-address-family
!
bgp community-list standard default seq 5 permit 65000:1
!
route-map default permit 10
match community default
set metric 123
set as-path prepend 65000 65000 65000
match community default
set metric 123
set as-path prepend 65000 65000 65000
!
route-map internal permit 10
set community 65000:1
set community 65000:1
!
#% endif
#% endblock
Expand Down
8 changes: 4 additions & 4 deletions test_bgp_disable_addpath_rx.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Configs(FRRConfigs):
#% endif
#% for iface in router.ifaces
interface {{ iface.ifname }}
ip address {{ iface.ip4[0] }}
ip address {{ iface.ip4[0] }}
!
#% endfor
ip forwarding
Expand All @@ -61,7 +61,7 @@ class Configs(FRRConfigs):
"""

bgpd = """
#% block main
#% block main
#% if router.name == 'r1'
router bgp 65001
timers 3 10
Expand Down Expand Up @@ -107,8 +107,8 @@ class Configs(FRRConfigs):
exit-address-family
!
#% endif
#% endblock
"""
#% endblock
"""


class BGPDisableAddpathRx(TestBase, AutoFixture, topo=topology, configs=Configs):
Expand Down
22 changes: 11 additions & 11 deletions test_bgp_distance_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ class Configs(FRRConfigs):
#% block main
#% if router.name == 'r2'
interface lo
ip address {{ routers.r2.lo_ip4[0] }}
ip address {{ routers.r2.lo_ip4[0] }}
!
#% endif
#% for iface in router.ifaces
interface {{ iface.ifname }}
ip address {{ iface.ip4[0] }}
ip address {{ iface.ip4[0] }}
!
#% endfor
ip forwarding
Expand All @@ -56,17 +56,17 @@ class Configs(FRRConfigs):
#% block main
#% if router.name == 'r2'
router bgp 65001
no bgp ebgp-requires-policy
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} remote-as 65000
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} timers 3 10
address-family ipv4
redistribute connected
exit-address-family
no bgp ebgp-requires-policy
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} remote-as 65000
neighbor {{ routers.r1.ifaces[0].ip4[0].ip }} timers 3 10
address-family ipv4
redistribute connected
exit-address-family
#% elif router.name == 'r1'
router bgp 65000
no bgp ebgp-requires-policy
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} remote-as 65001
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} timers 3 10
no bgp ebgp-requires-policy
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} remote-as 65001
neighbor {{ routers.r2.ifaces[0].ip4[0].ip }} timers 3 10
!
#% endif
#% endblock
Expand Down
Loading

0 comments on commit a09a405

Please sign in to comment.