Skip to content

Commit

Permalink
[SFP-refactor]Fix vendor revision key issue (sonic-net#4816)
Browse files Browse the repository at this point in the history
* [SFP-refactor]Fix vendor revision key issue

* update sfp tests
  • Loading branch information
aravindmani-1 authored and AntonHryshchuk committed Jan 4, 2022
1 parent 5ba0d84 commit 239811a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/common/platform/transceiver_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion tests/platform_tests/api/test_sfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class TestSfpApi(PlatformApiTestBase):
'type',
'manufacturer',
'model',
'hardware_rev',
'vendor_rev',
'serial',
'vendor_oui',
'vendor_date',
Expand Down Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion tests/snmp/test_snmp_phy_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit 239811a

Please sign in to comment.