Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display target firmware version through CLI #3274

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scripts/sfpshow
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ class SFPShow(object):
output += covert_application_advertisement_to_output_string(indent, sfp_info_dict)
elif key == 'active_firmware' or key == 'inactive_firmware':
output += '{}{}: {}\n'.format(indent, data_map[key], sfp_firmware_info_dict[key] if key in sfp_firmware_info_dict else 'N/A')
elif key.startswith(('e1_', 'e2_')):
if key in sfp_firmware_info_dict:
output += '{}{}: {}\n'.format(indent, data_map[key], sfp_firmware_info_dict[key])
else:
output += '{}{}: {}\n'.format(indent, data_map[key], sfp_info_dict[key])

Expand Down
8 changes: 7 additions & 1 deletion tests/mock_tables/asic1/state_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@
},
"TRANSCEIVER_FIRMWARE_INFO|Ethernet64": {
"active_firmware": "X.X",
"inactive_firmware": "X.X"
"inactive_firmware": "X.X",
"e1_active_firmware" : "X.X",
"e1_inactive_firmware" : "Y.Y",
"e1_server_firmware" : "A.B.C.D",
"e2_active_firmware" : "X.X",
"e2_inactive_firmware" : "Y.Y",
"e2_server_firmware" : "A.B.C.D"
},
"CHASSIS_INFO|chassis 1": {
"psu_num": "2"
Expand Down
8 changes: 7 additions & 1 deletion tests/mock_tables/state_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,13 @@
},
"TRANSCEIVER_FIRMWARE_INFO|Ethernet64": {
"active_firmware": "X.X",
"inactive_firmware": "X.X"
"inactive_firmware": "X.X",
"e1_active_firmware" : "X.X",
"e1_inactive_firmware" : "Y.Y",
"e1_server_firmware" : "A.B.C.D",
"e2_active_firmware" : "X.X",
"e2_inactive_firmware" : "Y.Y",
"e2_server_firmware" : "A.B.C.D"
},
"TRANSCEIVER_INFO|Ethernet72": {
"active_apsel_hostlane4": "N/A",
Expand Down
18 changes: 18 additions & 0 deletions tests/sfp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,12 @@
100GAUI-2 C2M (Annex 135G) - Host Assign (0x55) - 400ZR, DWDM, amplified - Media Assign (0x1)
CMIS Rev: 4.1
Connector: LC
E1 Active Firmware: X.X
E1 Inactive Firmware: Y.Y
E1 Server Firmware: A.B.C.D
E2 Active Firmware: X.X
E2 Inactive Firmware: Y.Y
E2 Server Firmware: A.B.C.D
Encoding: N/A
Extended Identifier: Power Class 8 (20.0W Max)
Extended RateSelect Compliance: N/A
Expand Down Expand Up @@ -689,6 +695,12 @@
100GAUI-2 C2M (Annex 135G) - Host Assign (0x55) - 400ZR, DWDM, amplified - Media Assign (0x1)
CMIS Rev: 4.1
Connector: LC
E1 Active Firmware: X.X
E1 Inactive Firmware: Y.Y
E1 Server Firmware: A.B.C.D
E2 Active Firmware: X.X
E2 Inactive Firmware: Y.Y
E2 Server Firmware: A.B.C.D
Encoding: N/A
Extended Identifier: Power Class 8 (20.0W Max)
Extended RateSelect Compliance: N/A
Expand Down Expand Up @@ -779,6 +791,12 @@
100GAUI-2 C2M (Annex 135G) - Host Assign (0x55) - 400ZR, DWDM, amplified - Media Assign (0x1)
CMIS Rev: 4.1
Connector: LC
E1 Active Firmware: X.X
E1 Inactive Firmware: Y.Y
E1 Server Firmware: A.B.C.D
E2 Active Firmware: X.X
E2 Inactive Firmware: Y.Y
E2 Server Firmware: A.B.C.D
Encoding: N/A
Extended Identifier: Power Class 8 (20.0W Max)
Extended RateSelect Compliance: N/A
Expand Down
8 changes: 7 additions & 1 deletion utilities_common/sfp_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@
'supported_max_tx_power': 'Supported Max TX Power',
'supported_min_tx_power': 'Supported Min TX Power',
'supported_max_laser_freq': 'Supported Max Laser Frequency',
'supported_min_laser_freq': 'Supported Min Laser Frequency'
'supported_min_laser_freq': 'Supported Min Laser Frequency',
'e1_active_firmware': 'E1 Active Firmware',
'e1_inactive_firmware': 'E1 Inactive Firmware',
'e1_server_firmware': 'E1 Server Firmware',
'e2_active_firmware': 'E2 Active Firmware',
'e2_inactive_firmware': 'E2 Inactive Firmware',
'e2_server_firmware': 'E2 Server Firmware'
}

CMIS_DATA_MAP = {**QSFP_DATA_MAP, **QSFP_CMIS_DELTA_DATA_MAP}
Expand Down
Loading