Skip to content

Commit

Permalink
Fix vstest for voq and fabric asics with fabric ports.
Browse files Browse the repository at this point in the history
Now voq and fabric asics are enabled with fabric ports. Need to fix
the tests to count for fabric ports. vstest infrastructure for fabric
ports merged in sonic-net/sonic-sairedis#737 and
769. This infrastructure requires sonic-net/sonic-buildimage#6185
to be effective. However, this PR (6185) will have some swss tests
failing. We need to disable those tests, let the PR merge, and reenable
the tests.
  • Loading branch information
ngoc-do committed Feb 8, 2021
1 parent 8c3e3e7 commit fe3664e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# ports in the system (much like the rest of the test suite). This should be adjusted to accomodate
# a dynamic number of ports. GitHub Issue: Azure/sonic-swss#1384.
NUM_PORTS = 32

FABRIC_NUM_PORTS = 16

def ensure_system(cmd):
rc, output = subprocess.getstatusoutput(cmd)
Expand Down Expand Up @@ -469,6 +469,12 @@ def check_swss_ready(self, timeout: int = 300) -> None:
"""
num_ports = NUM_PORTS

# Voq and fabric asics have fabric ports enabled
self.get_config_db()
metadata = self.config_db.get_entry('DEVICE_METADATA|localhost', '')
if metadata.get('switch_type', 'npu') in ['voq', 'fabric']:
num_ports = NUM_PORTS + FABRIC_NUM_PORTS

# Verify that all ports have been initialized and configured
app_db = self.get_app_db()
startup_polling_config = PollingConfig(5, timeout, strict=True)
Expand All @@ -483,6 +489,11 @@ def _polling_function():
asic_db = self.get_asic_db()
asic_db.wait_for_n_keys("ASIC_STATE:SAI_OBJECT_TYPE_PORT", num_ports + 1) # +1 CPU Port

# Verify that fabric ports are monitored in STATE_DB
if metadata.get('switch_type', 'npu') in ['voq', 'fabric']:
self.get_state_db()
self.state_db.wait_for_n_keys("FABRIC_PORT_TABLE", 16)

def net_cleanup(self) -> None:
"""Clean up network, remove extra links."""
re_space = re.compile(r'\s+')
Expand Down

0 comments on commit fe3664e

Please sign in to comment.