Skip to content

Commit

Permalink
Fix fabric_cli_and_db so it only tests on connected links. (#16309)
Browse files Browse the repository at this point in the history
Description of PR
Summary: Fix the fabric_cli_and_db test so it only tests connected links.
Fixes # (issue)

The fabric_cli_and_db failed in cases where the test selected a link that was not connected. This issue occurred because the portList set was not reset for each chip, allowing links that were connected on other chips to be tested, even though they were not connected on the chip being tested. In this PR, the portList is reset for each chip, and the 'show fabric reachability' command is also run on each chip. As a result, the test now only choose connected links on the chip under test.

Type of change
 Bug fix
  • Loading branch information
jfeng-arista authored Jan 4, 2025
1 parent 1723d66 commit 8043026
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/voq/test_fabric_cli_and_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

def test_fabric_cli_isolate_linecards(duthosts, enum_frontend_dut_hostname):
"""compare the CLI output with the reference data"""
allPortsList = []

duthost = duthosts[enum_frontend_dut_hostname]
logger.info("duthost: {}".format(duthost.hostname))
Expand All @@ -38,15 +37,18 @@ def test_fabric_cli_isolate_linecards(duthosts, enum_frontend_dut_hostname):
num_asics = duthost.num_asics()
logger.info("num_asics: {}".format(num_asics))
for asic in range(num_asics):
cmd = "show fabric reachability"
cmd_output = duthost.shell(cmd, module_ignore_errors=True)["stdout"].split("\n")
allPortsList = []

asicName = "asic{}".format(asic)
logger.info(asicName)
if num_asics > 1:
asicNamespaceOption = "-n {}".format(asicName)
else:
asicNamespaceOption = ""

cmd = "show fabric reachability {}".format(asicNamespaceOption)
cmd_output = duthost.shell(cmd, module_ignore_errors=True)["stdout"].split("\n")

# Create list of ports
for line in cmd_output:
if not line:
Expand Down

0 comments on commit 8043026

Please sign in to comment.