Skip to content

Commit

Permalink
Address review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ganglyu committed Dec 13, 2024
1 parent 9cf89e6 commit ff61057
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/gnmi/test_gnmi_smartswitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ def test_gnmi_appldb_01(duthosts, rand_one_dut_hostname, ptfhost):
target = None
result = duthost.shell("show chassis module status")
headers = result['stdout_lines'][0].split()
name_idx = None
oper_status_idx = None
for i, header in enumerate(headers):
if header == "Name":
name_idx = i
if header == "Oper-Status":
oper_status_idx = i
assert name_idx is not None, "Can't locate Name in the headers"
assert oper_status_idx is not None, "Can't locate Oper-Status in the headers"
for line in result['stdout_lines']:
module_status = line.split()
if module_status[oper_status_idx] == "Online":
Expand Down

0 comments on commit ff61057

Please sign in to comment.