From 160461eec6eacfabd1a3db898df50715ca950bae Mon Sep 17 00:00:00 2001 From: Aravind Mani Date: Mon, 6 Dec 2021 19:44:22 +0530 Subject: [PATCH 1/2] [SFP-refactor]Fix vendor revision key issue --- tests/common/platform/transceiver_utils.py | 2 +- tests/platform_tests/api/test_sfp.py | 2 +- tests/snmp/test_snmp_phy_entity.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/common/platform/transceiver_utils.py b/tests/common/platform/transceiver_utils.py index a2df622754..86f9c59c82 100644 --- a/tests/common/platform/transceiver_utils.py +++ b/tests/common/platform/transceiver_utils.py @@ -78,7 +78,7 @@ def check_transceiver_details(dut, asic_index, interfaces, xcvr_skip_list): """ asichost = dut.asic_instance(asic_index) logging.info("Check detailed transceiver information of each connected port") - expected_fields = ["type", "hardware_rev", "serial", "manufacturer", "model"] + expected_fields = ["type", "vendor_rev", "serial", "manufacturer", "model"] for intf in interfaces: if intf not in xcvr_skip_list[dut.hostname]: cmd = 'redis-cli -n 6 hgetall "TRANSCEIVER_INFO|%s"' % intf diff --git a/tests/platform_tests/api/test_sfp.py b/tests/platform_tests/api/test_sfp.py index 99e1e1b3ff..23c6b57a25 100644 --- a/tests/platform_tests/api/test_sfp.py +++ b/tests/platform_tests/api/test_sfp.py @@ -79,7 +79,7 @@ class TestSfpApi(PlatformApiTestBase): 'type', 'manufacturer', 'model', - 'hardware_rev', + 'vendor_rev', 'serial', 'vendor_oui', 'vendor_date', diff --git a/tests/snmp/test_snmp_phy_entity.py b/tests/snmp/test_snmp_phy_entity.py index d590636571..de87f761c2 100644 --- a/tests/snmp/test_snmp_phy_entity.py +++ b/tests/snmp/test_snmp_phy_entity.py @@ -511,7 +511,7 @@ def test_transceiver_info(duthosts, enum_rand_one_per_hwsku_hostname, snmp_physi assert transceiver_snmp_fact['entPhysClass'] == PHYSICAL_CLASS_PORT assert transceiver_snmp_fact['entPhyParentRelPos'] == -1 assert transceiver_snmp_fact['entPhysName'] == name - assert transceiver_snmp_fact['entPhysHwVer'] == transceiver_info['hardware_rev'] + assert transceiver_snmp_fact['entPhysHwVer'] == transceiver_info['vendor_rev'] assert transceiver_snmp_fact['entPhysFwVer'] == '' assert transceiver_snmp_fact['entPhysSwVer'] == '' assert transceiver_snmp_fact['entPhysSerialNum'] == transceiver_info['serial'] From a231a7783e416d3f422843e339985d0c0462ed70 Mon Sep 17 00:00:00 2001 From: Aravind Mani Date: Tue, 21 Dec 2021 23:43:06 +0530 Subject: [PATCH 2/2] update sfp tests --- tests/platform_tests/api/test_sfp.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/platform_tests/api/test_sfp.py b/tests/platform_tests/api/test_sfp.py index 23c6b57a25..ec8e25c400 100644 --- a/tests/platform_tests/api/test_sfp.py +++ b/tests/platform_tests/api/test_sfp.py @@ -259,6 +259,9 @@ def test_get_transceiver_info(self, duthosts, enum_rand_one_per_hwsku_hostname, unexpected_keys = set(actual_keys) - set(self.EXPECTED_XCVR_INFO_KEYS + self.NEWLY_ADDED_XCVR_INFO_KEYS) for key in unexpected_keys: + #hardware_rev is applicable only for QSFP-DD + if key == 'hardware_rev' and info_dict["type_abbrv_name"] == "QSFP-DD": + continue self.expect(False, "Transceiver {} info contains unexpected field '{}'".format(i, key)) self.assert_expectations()