Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion tests/bgp/route_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def parse_routes_on_eos(dut_host, neigh_hosts, ip_ver, exp_community=[]):
mg_facts = dut_host.minigraph_facts(
host=dut_host.hostname)['ansible_facts']
asn = mg_facts['minigraph_bgp_asn']
confed_asn = dut_host.get_bgp_confed_asn()
all_routes = {}
BGP_ENTRY_HEADING = r"BGP routing table entry for "
BGP_COMMUNITY_HEADING = r"Community: "
Expand All @@ -83,7 +84,15 @@ def parse_routes_process(node=None, results=None, my_community=exp_community):
# get hostname('ARISTA11T0') by VM name('VM0122')
hostname = host_name_map[node['host'].hostname]
host = node['host']
peer_ips = node['conf']['bgp']['peers'][asn]
peer_in_bgp_confed = node['conf']['bgp'].get('peer_in_bgp_confed', False)
try:
peer_ips = node['conf']['bgp']['peers'][asn]
except KeyError as e:
if peer_in_bgp_confed:
peer_ips = node['conf']['bgp']['peers'][int(confed_asn)]
else:
raise e

for ip in peer_ips:
if ipaddress.IPNetwork(ip).version == 4:
peer_ip_v4 = ip
Expand Down
5 changes: 4 additions & 1 deletion tests/bgp/test_traffic_shift.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from tests.bgp.constants import TS_NORMAL, TS_MAINTENANCE, TS_NO_NEIGHBORS

pytestmark = [
pytest.mark.topology('t1')
pytest.mark.topology('t1', 'lt2', 'ft2')
]

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -291,6 +291,9 @@ def test_load_minigraph_with_traffic_shift_away(duthosts, enum_rand_one_per_hwsk
Verify all routes are announced to bgp monitor, and only loopback routes are announced to neighs
"""
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
if tbinfo['topo']['type'] in ['lt2', 'ft2'] and duthost.get_bgp_confed_asn():
pytest.skip("Skip test on LT2/FT2 as BGP confederation configuration can only be loaded from golden config")

# Initially make sure both supervisor and line cards are in BGP operational normal state
if tbinfo['topo']['type'] == 't2':
initial_tsa_check_before_and_after_test(duthosts)
Expand Down