Skip to content

Commit e368411

Browse files
committed
Disable checking fabric ports ready until sonic-buildimage#6185 merges.
Signed-off-by: ngocdo <[email protected]>
1 parent 9ceefbb commit e368411

2 files changed

Lines changed: 21 additions & 4 deletions

File tree

tests/conftest.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@
3131
# ports in the system (much like the rest of the test suite). This should be adjusted to accomodate
3232
# a dynamic number of ports. GitHub Issue: Azure/sonic-swss#1384.
3333
NUM_PORTS = 32
34-
FABRIC_NUM_PORTS = 16
34+
35+
# FIXME: Voq asics will have 16 fabric ports created (defined in Azure/sonic-buildimage#6185).
36+
# Right now, we set FABRIC_NUM_PORTS to 0, and change to 16 when PR#6185 merges.
37+
FABRIC_NUM_PORTS = 0
3538

3639
def ensure_system(cmd):
3740
rc, output = subprocess.getstatusoutput(cmd)
@@ -488,12 +491,22 @@ def _polling_function():
488491

489492
# Verify that all ports have been created
490493
asic_db = self.get_asic_db()
491-
asic_db.wait_for_n_keys("ASIC_STATE:SAI_OBJECT_TYPE_PORT", num_ports + 1) # +1 CPU Port
494+
495+
# Verify that we have "at least" NUM_PORTS + FABRIC_NUM_PORTS, rather exact number.
496+
# Right now, FABRIC_NUM_PORTS = 0. So it essentially waits for at least NUM_PORTS.
497+
# This will allow us to merge Azure/sonic-buildimage#6185 that creates 16 fabric ports.
498+
# When PR#6185 merges, FABRIC_NUM_PORTS should be 16, and so this verification (at least
499+
# NUM_PORTS) still holds.
500+
# Will update FABRIC_NUM_PORTS to 16, and revert back to wait exact NUM_PORTS + FABRIC_NUM_PORTS
501+
# when PR#6185 merges.
502+
wait_at_least_n_keys = True
503+
504+
asic_db.wait_for_n_keys("ASIC_STATE:SAI_OBJECT_TYPE_PORT", num_ports + 1, wait_at_least_n_keys) # +1 CPU Port
492505

493506
# Verify that fabric ports are monitored in STATE_DB
494507
if metadata.get('switch_type', 'npu') in ['voq', 'fabric']:
495508
self.get_state_db()
496-
self.state_db.wait_for_n_keys("FABRIC_PORT_TABLE", 16)
509+
self.state_db.wait_for_n_keys("FABRIC_PORT_TABLE", FABRIC_NUM_PORTS, wait_at_least_n_keys)
497510

498511
def net_cleanup(self) -> None:
499512
"""Clean up network, remove extra links."""

tests/dvslib/dvs_database.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ def wait_for_n_keys(
330330
self,
331331
table_name: str,
332332
num_keys: int,
333+
wait_at_least_n_keys: bool = False,
333334
polling_config: PollingConfig = PollingConfig(),
334335
failure_message: str = None,
335336
) -> List[str]:
@@ -348,7 +349,10 @@ def wait_for_n_keys(
348349

349350
def access_function():
350351
keys = self.get_keys(table_name)
351-
return (len(keys) == num_keys, keys)
352+
if wait_at_least_n_keys:
353+
return (len(keys) >= num_keys, keys)
354+
else:
355+
return (len(keys) == num_keys, keys)
352356

353357
status, result = wait_for_result(
354358
access_function, self._disable_strict_polling(polling_config)

0 commit comments

Comments
 (0)