forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests of FRR templates which rendered by sonic-cfggen (sonic-net#4875)
* Tests of FRR templates which rendered by sonic-cfggen
- Loading branch information
1 parent
2e0aa4f
commit b72fed7
Showing
37 changed files
with
910 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
! | ||
! template: bgpd/bgpd.conf.j2 | ||
! | ||
! =========== Managed by sonic-cfggen DO NOT edit manually! ==================== | ||
! generated by templates/quagga/bgpd.conf.j2 with config DB data | ||
! file: bgpd.conf | ||
! | ||
! template: common/daemons.common.conf.j2 | ||
! | ||
hostname new_hostname | ||
password zebra | ||
enable password zebra | ||
! | ||
log syslog informational | ||
log facility local4 | ||
! | ||
! end of template: common/daemons.common.conf.j2! | ||
agentx | ||
! | ||
! template: bgpd/bgpd.main.conf.j2 | ||
! | ||
! bgp multiple-instance | ||
! | ||
! BGP configuration | ||
! | ||
! TSA configuration | ||
! | ||
ip prefix-list PL_LoopbackV4 permit 55.55.55.55/32 | ||
! | ||
ipv6 prefix-list PL_LoopbackV6 permit fc00::/64 | ||
! | ||
route-map HIDE_INTERNAL permit 10 | ||
set community local-AS | ||
! | ||
router bgp 55555 | ||
! | ||
bgp log-neighbor-changes | ||
no bgp default ipv4-unicast | ||
! | ||
bgp bestpath as-path multipath-relax | ||
! | ||
bgp graceful-restart restart-time 480 | ||
bgp graceful-restart | ||
bgp graceful-restart preserve-fw-state | ||
! | ||
bgp router-id 55.55.55.55 | ||
! | ||
network 55.55.55.55/32 | ||
! | ||
address-family ipv6 | ||
network fc00::1/64 | ||
exit-address-family | ||
! | ||
network 10.10.10.1/24 | ||
address-family ipv6 | ||
network fc01::1/64 | ||
exit-address-family | ||
! | ||
address-family ipv4 | ||
redistribute connected route-map HIDE_INTERNAL | ||
exit-address-family | ||
address-family ipv6 | ||
redistribute connected route-map HIDE_INTERNAL | ||
exit-address-family | ||
! | ||
address-family ipv4 | ||
maximum-paths 32 | ||
exit-address-family | ||
address-family ipv6 | ||
maximum-paths 32 | ||
exit-address-family | ||
! | ||
! end of template: bgpd/bgpd.main.conf.j2 | ||
!! | ||
! end of template: bgpd/bgpd.conf.j2 | ||
! |
33 changes: 33 additions & 0 deletions
33
src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"DEVICE_METADATA": { | ||
"localhost": { | ||
"hostname": "new_hostname", | ||
"bgp_asn": "55555", | ||
"sub_role": "FrontEnd" | ||
} | ||
}, | ||
"LOOPBACK_INTERFACE": { | ||
"Loopback0|55.55.55.55/32": {}, | ||
"Loopback0|fc00::1/128": {} | ||
}, | ||
"VLAN_INTERFACE": { | ||
"Vlan10|10.10.10.1/24": {}, | ||
"Vlan10|fc01::1/64": {} | ||
}, | ||
"constants": { | ||
"bgp": { | ||
"multipath_relax": { | ||
"enabled": true | ||
}, | ||
"graceful_restart": { | ||
"enabled": true, | ||
"restart_time": 480 | ||
}, | ||
"maximum_paths": { | ||
"enabled": true, | ||
"ipv4": 32, | ||
"ipv6": 32 | ||
} | ||
} | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
! | ||
! template: bgpd/bgpd.main.conf.j2 | ||
! | ||
! bgp multiple-instance | ||
! | ||
! BGP configuration | ||
! | ||
! TSA configuration | ||
! | ||
ip prefix-list PL_LoopbackV4 permit 55.55.55.55/32 | ||
! | ||
ipv6 prefix-list PL_LoopbackV6 permit fc00::/64 | ||
! | ||
route-map HIDE_INTERNAL permit 10 | ||
set community local-AS | ||
! | ||
router bgp 55555 | ||
! | ||
bgp log-neighbor-changes | ||
no bgp default ipv4-unicast | ||
! | ||
bgp bestpath as-path multipath-relax | ||
! | ||
bgp graceful-restart restart-time 480 | ||
bgp graceful-restart | ||
bgp graceful-restart preserve-fw-state | ||
! | ||
bgp router-id 55.55.55.55 | ||
! | ||
network 55.55.55.55/32 | ||
! | ||
address-family ipv6 | ||
network fc00::1/64 | ||
exit-address-family | ||
! | ||
network 10.10.10.1/24 | ||
address-family ipv6 | ||
network fc01::1/64 | ||
exit-address-family | ||
! | ||
address-family ipv4 | ||
redistribute connected route-map HIDE_INTERNAL | ||
exit-address-family | ||
address-family ipv6 | ||
redistribute connected route-map HIDE_INTERNAL | ||
exit-address-family | ||
! | ||
address-family ipv4 | ||
maximum-paths 32 | ||
exit-address-family | ||
address-family ipv6 | ||
maximum-paths 32 | ||
exit-address-family | ||
! | ||
! end of template: bgpd/bgpd.main.conf.j2 | ||
! |
32 changes: 32 additions & 0 deletions
32
src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"DEVICE_METADATA": { | ||
"localhost": { | ||
"bgp_asn": "55555", | ||
"sub_role": "FrontEnd" | ||
} | ||
}, | ||
"LOOPBACK_INTERFACE": { | ||
"Loopback0|55.55.55.55/32": {}, | ||
"Loopback0|fc00::1/128": {} | ||
}, | ||
"VLAN_INTERFACE": { | ||
"Vlan10|10.10.10.1/24": {}, | ||
"Vlan10|fc01::1/64": {} | ||
}, | ||
"constants": { | ||
"bgp": { | ||
"multipath_relax": { | ||
"enabled": true | ||
}, | ||
"graceful_restart": { | ||
"enabled": true, | ||
"restart_time": 480 | ||
}, | ||
"maximum_paths": { | ||
"enabled": true, | ||
"ipv4": 32, | ||
"ipv6": 32 | ||
} | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/base.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
! | ||
! template: bgpd/bgpd.main.conf.j2 | ||
! | ||
! bgp multiple-instance | ||
! | ||
! BGP configuration | ||
! | ||
! TSA configuration | ||
! | ||
ip prefix-list PL_LoopbackV4 permit 55.55.55.55/32 | ||
! | ||
router bgp 55555 | ||
! | ||
bgp log-neighbor-changes | ||
no bgp default ipv4-unicast | ||
! | ||
bgp router-id 55.55.55.55 | ||
! | ||
network 55.55.55.55/32 | ||
! | ||
! end of template: bgpd/bgpd.main.conf.j2 | ||
! |
19 changes: 19 additions & 0 deletions
19
src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/base.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"DEVICE_METADATA": { | ||
"localhost": { | ||
"bgp_asn": "55555", | ||
"sub_role": "" | ||
} | ||
}, | ||
"LOOPBACK_INTERFACE": { | ||
"Loopback0|55.55.55.55/32": {}, | ||
"Loopback1|fc00::1/128": {} | ||
}, | ||
"constants": { | ||
"bgp": { | ||
"multipath_relax": {}, | ||
"graceful_restart": {}, | ||
"maximum_paths": {} | ||
} | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
! | ||
! template: bgpd/bgpd.main.conf.j2 | ||
! | ||
! bgp multiple-instance | ||
! | ||
! BGP configuration | ||
! | ||
! TSA configuration | ||
! | ||
ip prefix-list PL_LoopbackV4 permit 55.55.55.55/32 | ||
! | ||
ipv6 prefix-list PL_LoopbackV6 permit fc00::/64 | ||
! | ||
route-map HIDE_INTERNAL permit 10 | ||
set community local-AS | ||
! | ||
router bgp 55555 | ||
! | ||
bgp log-neighbor-changes | ||
no bgp default ipv4-unicast | ||
! | ||
bgp bestpath as-path multipath-relax | ||
! | ||
bgp graceful-restart restart-time 240 | ||
bgp graceful-restart | ||
bgp graceful-restart preserve-fw-state | ||
! | ||
bgp router-id 55.55.55.55 | ||
! | ||
network 55.55.55.55/32 | ||
! | ||
address-family ipv6 | ||
network fc00::1/64 | ||
exit-address-family | ||
! | ||
network 10.10.10.1/24 | ||
address-family ipv6 | ||
network fc01::1/64 | ||
exit-address-family | ||
! | ||
address-family ipv4 | ||
redistribute connected route-map HIDE_INTERNAL | ||
exit-address-family | ||
address-family ipv6 | ||
redistribute connected route-map HIDE_INTERNAL | ||
exit-address-family | ||
! | ||
address-family ipv4 | ||
maximum-paths 64 | ||
exit-address-family | ||
address-family ipv6 | ||
maximum-paths 64 | ||
exit-address-family | ||
! | ||
! end of template: bgpd/bgpd.main.conf.j2 | ||
! |
29 changes: 29 additions & 0 deletions
29
src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"DEVICE_METADATA": { | ||
"localhost": { | ||
"bgp_asn": "55555", | ||
"sub_role": "FrontEnd" | ||
} | ||
}, | ||
"LOOPBACK_INTERFACE": { | ||
"Loopback0|55.55.55.55/32": {}, | ||
"Loopback0|fc00::1/128": {} | ||
}, | ||
"VLAN_INTERFACE": { | ||
"Vlan10|10.10.10.1/24": {}, | ||
"Vlan10|fc01::1/64": {} | ||
}, | ||
"constants": { | ||
"bgp": { | ||
"multipath_relax": { | ||
"enabled": true | ||
}, | ||
"graceful_restart": { | ||
"enabled": true | ||
}, | ||
"maximum_paths": { | ||
"enabled": true | ||
} | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...onic-bgpcfgd/tests/data/sonic-cfggen/bgpd.spine_chassis_frontend_router.conf.j2/base.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
! | ||
! Vnet BGP instance | ||
router bgp 555 vrf First | ||
no bgp default ipv4-unicast | ||
bgp log-neighbor-changes | ||
bgp bestpath as-path multipath-relax | ||
no bgp default ipv4-unicast | ||
bgp graceful-restart restart-time 240 | ||
bgp graceful-restart | ||
bgp router-id 10.20.30.40 | ||
neighbor 10.10.10.1 remote-as 10 | ||
neighbor 10.10.10.1 description session1 | ||
address-family ipv4 unicast | ||
neighbor 10.10.10.1 activate | ||
neighbor 10.10.10.1 soft-reconfiguration inbound | ||
maximum-paths 64 | ||
exit-address-family | ||
address-family l2vpn evpn | ||
advertise ipv4 unicast | ||
exit-address-family | ||
router bgp 555 vrf Second | ||
no bgp default ipv4-unicast | ||
bgp log-neighbor-changes | ||
bgp bestpath as-path multipath-relax | ||
no bgp default ipv4-unicast | ||
bgp graceful-restart restart-time 240 | ||
bgp graceful-restart | ||
bgp router-id 10.20.30.40 | ||
neighbor 20.20.20.1 remote-as 20 | ||
neighbor 20.20.20.1 description session2 | ||
address-family ipv4 unicast | ||
neighbor 20.20.20.1 activate | ||
neighbor 20.20.20.1 soft-reconfiguration inbound | ||
maximum-paths 64 | ||
exit-address-family | ||
address-family l2vpn evpn | ||
advertise ipv4 unicast | ||
exit-address-family | ||
! |
Oops, something went wrong.