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 and wangxin committed Mar 24, 2023
1 parent 2bb6cec commit df5b858
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/ecmp/inner_hashing/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,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 @@ -161,8 +161,8 @@ def build_fib(duthosts, rand_one_dut_hostname, ptfhost, config_facts, tbinfo):

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']])
if ifname in po:
oports.append([str(mg_facts['minigraph_ptf_indices'][x]) for x in po[ifname]])
else:
if ports.has_key(ifname):
oports.append([str(mg_facts['minigraph_ptf_indices'][ifname])])
Expand Down

0 comments on commit df5b858

Please sign in to comment.