From 2c92acec1edf3f7602bbcca369f3f3c62cc09b71 Mon Sep 17 00:00:00 2001 From: Nana He Date: Wed, 8 Mar 2023 19:03:56 +0800 Subject: [PATCH] Fix bgp_gr_helper and iface_loopback action failure du to config_db change The PR#13660 removed the 'members' key in "PORTCHANNEL" in config_db.json, need to align the test --- tests/bgp/test_bgp_gr_helper.py | 4 ++-- tests/iface_loopback_action/iface_loopback_action_helper.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/bgp/test_bgp_gr_helper.py b/tests/bgp/test_bgp_gr_helper.py index 67b1e9164ce..df07bd6a75f 100644 --- a/tests/bgp/test_bgp_gr_helper.py +++ b/tests/bgp/test_bgp_gr_helper.py @@ -104,7 +104,7 @@ def _verify_prefix_counters_from_neighbor_after_graceful_restart(duthost, bgp_ne config_facts = duthost.config_facts(host=duthost.hostname, source="running")['ansible_facts'] bgp_neighbors = config_facts.get('BGP_NEIGHBOR', {}) - portchannels = config_facts.get('PORTCHANNEL_MEMBER', {}) + portchannels_memebers = config_facts.get('PORTCHANNEL_MEMBER', {}) dev_nbrs = config_facts.get('DEVICE_NEIGHBOR', {}) configurations = tbinfo['topo']['properties']['configuration_properties'] exabgp_ips = [configurations['common']['nhipv4'], configurations['common']['nhipv6']] @@ -130,7 +130,7 @@ def _verify_prefix_counters_from_neighbor_after_graceful_restart(duthost, bgp_ne # get neighbor device connected ports nbr_ports = [] if test_interface.startswith("PortChannel"): - for member in portchannels[test_interface].keys(): + for member in portchannels_memebers[test_interface].keys(): nbr_ports.append(dev_nbrs[member]['port']) test_neighbor_name = dev_nbrs[member]['name'] else: diff --git a/tests/iface_loopback_action/iface_loopback_action_helper.py b/tests/iface_loopback_action/iface_loopback_action_helper.py index d7a10866d7a..240f9a705f9 100644 --- a/tests/iface_loopback_action/iface_loopback_action_helper.py +++ b/tests/iface_loopback_action/iface_loopback_action_helper.py @@ -144,7 +144,7 @@ def get_portchannel_of_port(config_facts, port): """ portchannels = config_facts['PORTCHANNEL'].keys() if 'PORTCHANNEL' in config_facts else [] for portchannel in portchannels: - portchannel_members = config_facts['PORTCHANNEL'][portchannel].get('members') + portchannel_members = config_facts['PORTCHANNEL_MEMBER'][portchannel].keys() if port in portchannel_members: return portchannel