From 38e5991dd846aa5902958694d24a55b53348f72f Mon Sep 17 00:00:00 2001 From: Jibin Bao Date: Tue, 21 Mar 2023 15:56:14 +0800 Subject: [PATCH] Fix test_inner_hashing failure due to config_db change (#7766) KeyError: 'members' is introduced by this PR sonic-net/sonic-buildimage#13660. In original config, we use PORTCHANNEL, now it is changed to PORTCHANNEL_MEMBER. So, the relevant test should be updated accordingly. Test log: oports = [] for ifname in ifnames: if po.has_key(ifname): oports.append([str(mg_facts['minigraph_ptf_indices'][x]) for x in po[ifname]['members']]) E KeyError: 'members' What is the motivation for this PR? Fix test_inner_harhing issue How did you do it? PORTCHANNEL is changed to PORTCHANNEL_MEMBER How did you verify/test it? Run test_inner_hashing --- tests/ecmp/inner_hashing/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ecmp/inner_hashing/conftest.py b/tests/ecmp/inner_hashing/conftest.py index 92ff574794..3e3c750f5b 100644 --- a/tests/ecmp/inner_hashing/conftest.py +++ b/tests/ecmp/inner_hashing/conftest.py @@ -149,7 +149,7 @@ def build_fib(duthosts, rand_one_dut_hostname, ptfhost, config_facts, tbinfo): duthost.shell("redis-dump -d 0 -k 'ROUTE*' -y > /tmp/fib.{}.txt".format(timestamp)) duthost.fetch(src="/tmp/fib.{}.txt".format(timestamp), dest="/tmp/fib") - po = config_facts.get('PORTCHANNEL', {}) + po = config_facts.get('PORTCHANNEL_MEMBER', {}) ports = config_facts.get('PORT', {}) tmp_fib_info = tempfile.NamedTemporaryFile() @@ -164,7 +164,7 @@ def build_fib(duthosts, rand_one_dut_hostname, ptfhost, config_facts, tbinfo): oports = [] for ifname in ifnames: if ifname in po: - oports.append([str(mg_facts['minigraph_ptf_indices'][x]) for x in po[ifname]['members']]) + oports.append([str(mg_facts['minigraph_ptf_indices'][x]) for x in po[ifname]]) else: if ifname in ports: oports.append([str(mg_facts['minigraph_ptf_indices'][ifname])])