From e739083d06a8836574a3c1b87f3031a362772c7a Mon Sep 17 00:00:00 2001 From: vedganes Date: Mon, 28 Jun 2021 23:23:08 -0400 Subject: [PATCH 1/3] [vstest] VS test failues fix after fabric port orch PR merge Changes include: - Set the FABRIC_NUM_PORTS to 16. This is required since addition of fabric port orch adds 16 fabrics in asic db internally. - Added back the skipped tests Signed-off-by: vedganes --- tests/conftest.py | 2 +- tests/test_virtual_chassis.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 0ec6626fe9..08e289f4b7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -36,7 +36,7 @@ # 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. -FABRIC_NUM_PORTS = 0 +FABRIC_NUM_PORTS = 16 def ensure_system(cmd): rc, output = subprocess.getstatusoutput(cmd) diff --git a/tests/test_virtual_chassis.py b/tests/test_virtual_chassis.py index a963a55f23..831e8ebf5a 100644 --- a/tests/test_virtual_chassis.py +++ b/tests/test_virtual_chassis.py @@ -136,7 +136,6 @@ def test_voq_switch(self, vct): spcfg = ast.literal_eval(value) assert spcfg['count'] == sp_count, "Number of systems ports configured is invalid" - @pytest.mark.skip(reason="This test is not stable enough") def test_chassis_app_db_sync(self, vct): """Test chassis app db syncing. @@ -213,7 +212,6 @@ def test_chassis_system_interface(self, vct): # Remote system ports's switch id should not match local switch id assert spcfginfo["attached_switch_id"] != lc_switch_id, "RIF system port with wrong switch_id" - @pytest.mark.skip(reason="This test is not stable enough") def test_chassis_system_neigh(self, vct): """Test neigh record create/delete and syncing to chassis app db. @@ -470,7 +468,6 @@ def test_chassis_system_neigh(self, vct): # Cleanup inband if configuration self.del_inbandif_port(vct, inband_port) - @pytest.mark.skip(reason="This test is not stable enough") def test_chassis_system_lag(self, vct): """Test PortChannel in VOQ based chassis systems. From bb422242a48d04ecef48ff5df8cc3b0df308a1d5 Mon Sep 17 00:00:00 2001 From: vedganes Date: Tue, 29 Jun 2021 11:20:49 -0400 Subject: [PATCH 2/3] [vstest] Code review comments fix - 1 Changes done to remove comments and LGTM warnings. Signed-off-by: vedganes --- tests/conftest.py | 18 +++--------------- tests/test_virtual_chassis.py | 1 - 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 08e289f4b7..4139cbfa15 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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): @@ -526,22 +524,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.""" diff --git a/tests/test_virtual_chassis.py b/tests/test_virtual_chassis.py index 831e8ebf5a..1709dfb047 100644 --- a/tests/test_virtual_chassis.py +++ b/tests/test_virtual_chassis.py @@ -1,4 +1,3 @@ -import pytest from swsscommon import swsscommon from dvslib.dvs_database import DVSDatabase import ast From 460244fc3ff3b7258e89549030e8620033ab9dd6 Mon Sep 17 00:00:00 2001 From: vedganes Date: Sun, 7 Nov 2021 15:06:59 -0500 Subject: [PATCH 3/3] Revert "[VS test] Skip flaky virtual chassis test (#2004)" This reverts commit facdef51706827fe10ea176ad97056860f325a41. With the changes in platfrom/vs/docker-sonic-vs/start.sh done via sonic-buildimage PR https://github.com/Azure/sonic-buildimage/pull/8008 all tests will pass. No need to skip the tests. So reverting this commit --- tests/test_virtual_chassis.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test_virtual_chassis.py b/tests/test_virtual_chassis.py index 1709dfb047..d76f976ecc 100644 --- a/tests/test_virtual_chassis.py +++ b/tests/test_virtual_chassis.py @@ -603,7 +603,6 @@ def test_chassis_system_lag(self, vct): break - @pytest.mark.skip(reason="This test is not stable enough") def test_chassis_system_lag_id_allocator_table_full(self, vct): """Test lag id allocator table full. @@ -681,7 +680,6 @@ def test_chassis_system_lag_id_allocator_table_full(self, vct): break - @pytest.mark.skip(reason="This test is not stable enough") def test_chassis_system_lag_id_allocator_del_id(self, vct): """Test lag id allocator's release id and re-use id processing.