|
31 | 31 | # ports in the system (much like the rest of the test suite). This should be adjusted to accomodate |
32 | 32 | # a dynamic number of ports. GitHub Issue: Azure/sonic-swss#1384. |
33 | 33 | 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 |
35 | 38 |
|
36 | 39 | def ensure_system(cmd): |
37 | 40 | rc, output = subprocess.getstatusoutput(cmd) |
@@ -488,12 +491,22 @@ def _polling_function(): |
488 | 491 |
|
489 | 492 | # Verify that all ports have been created |
490 | 493 | 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 |
492 | 505 |
|
493 | 506 | # Verify that fabric ports are monitored in STATE_DB |
494 | 507 | if metadata.get('switch_type', 'npu') in ['voq', 'fabric']: |
495 | 508 | 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) |
497 | 510 |
|
498 | 511 | def net_cleanup(self) -> None: |
499 | 512 | """Clean up network, remove extra links.""" |
|
0 commit comments