Skip to content

Commit

Permalink
Adding test for non default vrf part
Browse files Browse the repository at this point in the history
  • Loading branch information
Laxmikant Chintakindi authored and Laxmikant Chintakindi committed Nov 11, 2024
1 parent 6f727f7 commit d86885b
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ router bfd
multihop interval 1200 min-rx 1200 multiplier 3
!
router bgp 65104
router-id 192.168.255.14
update wait-install
no bgp default ipv4-unicast
maximum-paths 4 ecmp 4
Expand Down Expand Up @@ -414,7 +413,6 @@ router bgp 65104
rd 192.168.254.14:15
route-target import evpn 65104:15
route-target export evpn 65104:15
router-id 192.168.255.14
redistribute connected
!
vrf Tenant_A_WAN_Zone
Expand All @@ -425,7 +423,6 @@ router bgp 65104
route-target export evpn 65104:14
route-target export evpn 65000:789
route-target export vpn-ipv4 65000:123
router-id 192.168.255.14
update wait-install
neighbor 123.1.1.10 remote-as 1234
neighbor 123.1.1.10 shutdown
Expand Down Expand Up @@ -475,31 +472,30 @@ router bgp 65104
rd 192.168.254.14:20
route-target import evpn 65104:20
route-target export evpn 65104:20
router-id 192.168.255.14
redistribute connected
!
vrf Tenant_B_WAN_Zone
rd 192.168.254.14:21
route-target import evpn 65104:21
route-target export evpn 65104:21
router-id 192.168.255.14
redistribute connected
!
vrf Tenant_C_WAN_Zone
rd 192.168.254.14:31
route-target import evpn 65104:31
route-target export evpn 65104:31
router-id 192.168.255.14
redistribute connected
!
vrf TENANT_D_WAN_ZONE
rd 192.168.254.14:42
route-target import evpn 65104:42
route-target export evpn 65104:42
router-id 192.168.255.14
!
router general
router-id ipv4 192.168.255.14
exit
!
router ospf 14 vrf Tenant_A_WAN_Zone
router-id 192.168.255.14
passive-interface default
no passive-interface Ethernet7
no passive-interface Vlan150
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ hostname: DC1-BL1A
is_deployed: true
router_bgp:
as: '65104'
router_id: 192.168.255.14
bgp_defaults:
- distance bgp 20 200 200
bgp:
Expand Down Expand Up @@ -131,7 +130,6 @@ router_bgp:
- address_family: evpn
route_targets:
- '65104:15'
router_id: 192.168.255.14
redistribute:
connected:
enabled: true
Expand All @@ -154,7 +152,6 @@ router_bgp:
- address_family: vpn-ipv4
route_targets:
- 65000:123
router_id: 192.168.255.14
redistribute:
connected:
enabled: true
Expand Down Expand Up @@ -228,7 +225,6 @@ router_bgp:
- address_family: evpn
route_targets:
- '65104:20'
router_id: 192.168.255.14
redistribute:
connected:
enabled: true
Expand All @@ -243,7 +239,6 @@ router_bgp:
- address_family: evpn
route_targets:
- '65104:21'
router_id: 192.168.255.14
redistribute:
connected:
enabled: true
Expand All @@ -258,7 +253,6 @@ router_bgp:
- address_family: evpn
route_targets:
- '65104:31'
router_id: 192.168.255.14
redistribute:
connected:
enabled: true
Expand All @@ -273,7 +267,6 @@ router_bgp:
- address_family: evpn
route_targets:
- '65104:42'
router_id: 192.168.255.14
vlan_aware_bundles:
- name: Tenant_A_WAN_Zone
rd: 192.168.254.14:14
Expand Down Expand Up @@ -452,6 +445,9 @@ ntp: null
snmp_server:
contact: [email protected]
location: EOS_DESIGNS_UNIT_TESTS DC1-BL1A
router_general:
router_id:
ipv4: 192.168.255.14
ethernet_interfaces:
- name: Ethernet1
peer: DC1-SPINE1
Expand Down Expand Up @@ -728,7 +724,6 @@ router_ospf:
- Ethernet7
- Vlan150
max_lsa: 15000
router_id: 192.168.255.14
redistribute:
bgp:
enabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ my_special_dci_ethernet_interfaces:

custom_structured_configuration_list_merge: append

use_router_general_for_router_id: true

# Test appending to list of ip name-servers.
override_ip_name_servers:
- ip_address: 1.1.1.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def router_bgp(self) -> dict | None:

router_bgp = {
"as": self.shared_utils.bgp_as,
"router_id": self.shared_utils.router_id if self.shared_utils.use_router_general_for_router_id is False else None,
"router_id": self.shared_utils.router_id if not self.shared_utils.use_router_general_for_router_id else None,
"distance": get(self._hostvars, "bgp_distance"),
"bgp_defaults": get(self.shared_utils.switch_data_combined, "bgp_defaults"),
"bgp": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def _router_bgp_vrfs(self: AvdStructuredConfigNetworkServices) -> dict:
bgp_vrf_redistribute_connected = get(vrf, "redistribute_connected", default=True)
if vrf_name != "default":
# Non-default VRF
if self.shared_utils.use_router_general_for_router_id is False:
if not self.shared_utils.use_router_general_for_router_id:
bgp_vrf["router_id"] = self.shared_utils.router_id

if bgp_vrf_redistribute_connected is True:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def router_ospf(self: AvdStructuredConfigNetworkServices) -> dict | None:

if ospf_router_id := get(vrf, "ospf.router_id"):
process["router_id"] = ospf_router_id
elif self.shared_utils.use_router_general_for_router_id is False:
elif not self.shared_utils.use_router_general_for_router_id:
process["router_id"] = self.shared_utils.router_id

process_redistribute = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def mpls(self: AvdStructuredConfigUnderlay) -> dict | None:
"ip": True,
"ldp": {
"interface_disabled_default": True,
"router_id": self.shared_utils.router_id if self.shared_utils.use_router_general_for_router_id is False else None,
"router_id": self.shared_utils.router_id if not self.shared_utils.use_router_general_for_router_id else None,
"shutdown": False,
"transport_address_interface": "Loopback0",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def router_isis(self: AvdStructuredConfigUnderlay) -> dict | None:
"instance": self.shared_utils.isis_instance_name,
"log_adjacency_changes": True,
"net": self._isis_net,
"router_id": self.shared_utils.router_id if self.shared_utils.use_router_general_for_router_id is False else None,
"router_id": self.shared_utils.router_id if not self.shared_utils.use_router_general_for_router_id else None,
"is_type": self._is_type,
"address_family_ipv4": {"enabled": True, "maximum_paths": get(self._hostvars, "isis_maximum_paths", default=4)},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def router_ospf(self: AvdStructuredConfigUnderlay) -> dict | None:
process = {
"id": process_id,
"passive_interface_default": True,
"router_id": self.shared_utils.router_id if self.shared_utils.use_router_general_for_router_id is False else None,
"router_id": self.shared_utils.router_id if not self.shared_utils.use_router_general_for_router_id else None,
"max_lsa": get(self._hostvars, "underlay_ospf_max_lsa", default=12000),
"no_passive_interfaces": no_passive_interfaces,
"bfd_enable": get(self._hostvars, "underlay_ospf_bfd_enable", default=False),
Expand Down

0 comments on commit d86885b

Please sign in to comment.