Skip to content

Commit

Permalink
Fix test_inner_hashing failure due to config_db change (#7766)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
JibinBao authored Mar 21, 2023
1 parent 54f7341 commit 38e5991
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/ecmp/inner_hashing/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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])])
Expand Down

0 comments on commit 38e5991

Please sign in to comment.