From 656ade1a233a1abf958e2468abe6793ec633f93c Mon Sep 17 00:00:00 2001 From: Aravind Mani <53524901+aravindmani-1@users.noreply.github.com> Date: Mon, 6 Dec 2021 18:53:11 +0530 Subject: [PATCH] SFP-Refactor: Vendor revision is not displayed properly (#1950) * SFP: Vendor revision is not displayed properly --- scripts/sfpshow | 2 +- sfputil/main.py | 2 +- tests/mock_tables/asic0/state_db.json | 2 +- tests/mock_tables/asic1/state_db.json | 2 +- tests/mock_tables/asic2/state_db.json | 2 +- tests/mock_tables/state_db.json | 6 +-- tests/mock_tables/t1/state_db.json | 64 +++++++++++++-------------- tests/sfputil_test.py | 2 +- 8 files changed, 41 insertions(+), 41 deletions(-) diff --git a/scripts/sfpshow b/scripts/sfpshow index d05268f74d88..f61f3ec2ca74 100755 --- a/scripts/sfpshow +++ b/scripts/sfpshow @@ -38,7 +38,7 @@ QSFP_DATA_MAP = { 'vendor_oui': 'Vendor OUI', 'vendor_date': 'Vendor Date Code(YYYY-MM-DD Lot)', 'manufacturer': 'Vendor Name', - 'hardware_rev': 'Vendor Rev', + 'vendor_rev': 'Vendor Rev', 'serial': 'Vendor SN', 'type': 'Identifier', 'ext_identifier': 'Extended Identifier', diff --git a/sfputil/main.py b/sfputil/main.py index 9a335599de32..55818d15ccf2 100644 --- a/sfputil/main.py +++ b/sfputil/main.py @@ -39,7 +39,7 @@ 'vendor_oui': 'Vendor OUI', 'vendor_date': 'Vendor Date Code(YYYY-MM-DD Lot)', 'manufacturer': 'Vendor Name', - 'hardware_rev': 'Vendor Rev', + 'vendor_rev': 'Vendor Rev', 'serial': 'Vendor SN', 'type': 'Identifier', 'ext_identifier': 'Extended Identifier', diff --git a/tests/mock_tables/asic0/state_db.json b/tests/mock_tables/asic0/state_db.json index 0fb30da28a02..97fbb3d33c7e 100644 --- a/tests/mock_tables/asic0/state_db.json +++ b/tests/mock_tables/asic0/state_db.json @@ -1,7 +1,7 @@ { "TRANSCEIVER_INFO|Ethernet0": { "type": "QSFP28 or later", - "hardware_rev": "AC", + "vendor_rev": "AC", "serial": "MT1706FT02064", "manufacturer": "Mellanox", "model": "MFA1A00-C003", diff --git a/tests/mock_tables/asic1/state_db.json b/tests/mock_tables/asic1/state_db.json index cd5e2b38614f..354f66f70859 100644 --- a/tests/mock_tables/asic1/state_db.json +++ b/tests/mock_tables/asic1/state_db.json @@ -1,7 +1,7 @@ { "TRANSCEIVER_INFO|Ethernet64": { "type": "QSFP28 or later", - "hardware_rev": "AC", + "vendor_rev": "AC", "serial": "MT1706FT02064", "manufacturer": "Mellanox", "model": "MFA1A00-C003", diff --git a/tests/mock_tables/asic2/state_db.json b/tests/mock_tables/asic2/state_db.json index 98f361b6c587..f6e3eee4cfc1 100644 --- a/tests/mock_tables/asic2/state_db.json +++ b/tests/mock_tables/asic2/state_db.json @@ -1,7 +1,7 @@ { "TRANSCEIVER_INFO|Ethernet20": { "type": "QSFP28 or later", - "hardware_rev": "AC", + "vendor_rev": "AC", "serial": "MT1706FT02064", "manufacturer": "Mellanox", "model": "MFA1A00-C003", diff --git a/tests/mock_tables/state_db.json b/tests/mock_tables/state_db.json index 7c96a5df500d..9e7501c32058 100644 --- a/tests/mock_tables/state_db.json +++ b/tests/mock_tables/state_db.json @@ -1,7 +1,7 @@ { "TRANSCEIVER_INFO|Ethernet0": { "type": "QSFP28 or later", - "hardware_rev": "AC", + "vendor_rev": "AC", "serial": "MT1706FT02064", "manufacturer": "Mellanox", "model": "MFA1A00-C003", @@ -19,7 +19,7 @@ }, "TRANSCEIVER_INFO|Ethernet12": { "type": "QSFP28 or later", - "hardware_rev": "AC", + "vendor_rev": "AC", "serial": "MT1706FT02064", "manufacturer": "Credo", "model": "CACL1X321P2PA1MS", @@ -69,7 +69,7 @@ }, "TRANSCEIVER_INFO|Ethernet8": { "type": "QSFP-DD Double Density 8X Pluggable Transceiver", - "hardware_rev": "2A", + "vendor_rev": "2A", "serial": "INKAO2900002A", "manufacturer": "INNOLIGHT", "model": "C-DQ8FNM010-N00", diff --git a/tests/mock_tables/t1/state_db.json b/tests/mock_tables/t1/state_db.json index 3221fbaf74ca..5e1c9b53de67 100644 --- a/tests/mock_tables/t1/state_db.json +++ b/tests/mock_tables/t1/state_db.json @@ -6823,7 +6823,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002979026", "nominal_bit_rate": "0", @@ -6846,7 +6846,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -6869,7 +6869,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -6892,7 +6892,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -6915,7 +6915,7 @@ "encoding": "64B66B", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "P", + "vendor_rev": "P", "manufacturer": "Amphenol", "model": "NDAAFF-0006", "nominal_bit_rate": "255", @@ -6938,7 +6938,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -6961,7 +6961,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002979026", "nominal_bit_rate": "0", @@ -6984,7 +6984,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -7007,7 +7007,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002979026", "nominal_bit_rate": "0", @@ -7030,7 +7030,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002979026", "nominal_bit_rate": "0", @@ -7053,7 +7053,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002979026", "nominal_bit_rate": "0", @@ -7076,7 +7076,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002979026", "nominal_bit_rate": "0", @@ -7099,7 +7099,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002979026", "nominal_bit_rate": "0", @@ -7122,7 +7122,7 @@ "encoding": "64B66B", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "C", + "vendor_rev": "C", "manufacturer": "Amphenol", "model": "NDAAFF-M202", "nominal_bit_rate": "255", @@ -7145,7 +7145,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002979026", "nominal_bit_rate": "0", @@ -7168,7 +7168,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002979026", "nominal_bit_rate": "0", @@ -7191,7 +7191,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -7214,7 +7214,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -7237,7 +7237,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -7260,7 +7260,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -7283,7 +7283,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -7306,7 +7306,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -7329,7 +7329,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -7352,7 +7352,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -7375,7 +7375,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -7398,7 +7398,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -7421,7 +7421,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002979026", "nominal_bit_rate": "0", @@ -7444,7 +7444,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -7467,7 +7467,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -7490,7 +7490,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -7513,7 +7513,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", @@ -7536,7 +7536,7 @@ "encoding": "Unspecified", "ext_identifier": "Power Class 1(1.5W max)", "ext_rateselect_compliance": "QSFP+ Rate Select Version 1", - "hardware_rev": "", + "vendor_rev": "", "manufacturer": "Molex", "model": "1002971101", "nominal_bit_rate": "255", diff --git a/tests/sfputil_test.py b/tests/sfputil_test.py index 23afd31dad1b..2ef8aa6f2434 100644 --- a/tests/sfputil_test.py +++ b/tests/sfputil_test.py @@ -83,7 +83,7 @@ def test_convert_sfp_info_to_output_string(self): 'type_abbrv_name': 'QSFP28', 'manufacturer': 'Mellanox', 'model': 'MCP1600-C003', - 'hardware_rev': 'A2', + 'vendor_rev': 'A2', 'serial': 'MT1636VS10561', 'vendor_oui': '00-02-c9', 'vendor_date': '2016-07-18',