Skip to content

Commit

Permalink
[vstest] Code review comments fix - 1
Browse files Browse the repository at this point in the history
Changes done to remove comments and LGTM warnings.

Signed-off-by: vedganes <vedavinayagam.ganesan@nokia.com>
  • Loading branch information
vedganes committed Nov 2, 2021
1 parent daf8848 commit 6392d3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
18 changes: 3 additions & 15 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
# a dynamic number of ports. GitHub Issue: Azure/sonic-swss#1384.
NUM_PORTS = 32

# FIXME: Voq asics will have 16 fabric ports created (defined in Azure/sonic-buildimage#6185).
# Right now, we set FABRIC_NUM_PORTS to 0, and change to 16 when PR#6185 merges. PR#6185 can't
# be merged before this PR. Otherwise it will cause swss voq test failures.
# Voq asics will have 16 fabric ports created (defined in Azure/sonic-buildimage#7629).
FABRIC_NUM_PORTS = 16

def ensure_system(cmd):
Expand Down Expand Up @@ -518,22 +516,12 @@ def _polling_function():

# Verify that all ports have been created
asic_db = self.get_asic_db()

# Verify that we have "at least" NUM_PORTS + FABRIC_NUM_PORTS, rather exact number.
# Right now, FABRIC_NUM_PORTS = 0. So it essentially waits for at least NUM_PORTS.
# This will allow us to merge Azure/sonic-buildimage#6185 that creates 16 fabric ports.
# When PR#6185 merges, FABRIC_NUM_PORTS should be 16, and so this verification (at least
# NUM_PORTS) still holds.
# Will update FABRIC_NUM_PORTS to 16, and revert back to wait exact NUM_PORTS + FABRIC_NUM_PORTS
# when PR#6185 merges.
wait_at_least_n_keys = True

asic_db.wait_for_n_keys("ASIC_STATE:SAI_OBJECT_TYPE_PORT", num_ports + 1, wait_at_least_n_keys) # +1 CPU Port
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", FABRIC_NUM_PORTS, wait_at_least_n_keys)
self.state_db.wait_for_n_keys("FABRIC_PORT_TABLE", FABRIC_NUM_PORTS)

def net_cleanup(self) -> None:
"""Clean up network, remove extra links."""
Expand Down
1 change: 0 additions & 1 deletion tests/test_virtual_chassis.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest
from swsscommon import swsscommon
from dvslib.dvs_database import DVSDatabase
import ast
Expand Down

0 comments on commit 6392d3b

Please sign in to comment.