-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DPinit timeout seen for Innolight transceiver during CMIS init + tran…
…sceiver OIR causing CMIS init failure (#450) * Create fr8_800g.py Implementation of Innolight FR8 module specific in addition to the CMIS specification. * Update xcvr_api_factory.py Assign CMIS api implementation for Cisco-Innolight * return items in list format * Update and rename fr8_800g.py to fr_800g.py * Update xcvr_api_factory.py * Add mock test case for INL * Create test_fr_800g.py Add test_fr_800g.py to mock INL get_fw_info api
- Loading branch information
1 parent
b893c95
commit fa99327
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
""" | ||
fr_800g.py | ||
Implementation of Innolight FR module specific in addition to the CMIS specification. | ||
""" | ||
|
||
from ...fields import consts | ||
from ..public.cmis import CmisApi | ||
|
||
class CmisFr800gApi(CmisApi): | ||
def get_transceiver_info_firmware_versions(self): | ||
return_dict = {"active_firmware" : "N/A", "inactive_firmware" : "N/A"} | ||
|
||
InactiveFirmware = self.get_module_inactive_firmware() | ||
ActiveFirmware = self.get_module_active_firmware() | ||
|
||
return_dict["active_firmware"] = ActiveFirmware + ".0" | ||
return_dict["inactive_firmware"] = InactiveFirmware + ".0" | ||
return return_dict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from unittest.mock import patch | ||
from mock import MagicMock | ||
import pytest | ||
|
||
from sonic_platform_base.sonic_xcvr.api.public.cmis import CmisApi | ||
from sonic_platform_base.sonic_xcvr.mem_maps.public.cmis import CmisMemMap | ||
from sonic_platform_base.sonic_xcvr.xcvr_eeprom import XcvrEeprom | ||
from sonic_platform_base.sonic_xcvr.codes.public.cmis import CmisCodes | ||
from sonic_platform_base.sonic_xcvr.fields import consts | ||
from sonic_platform_base.sonic_xcvr.api.innolight.fr_800g import CmisFr800gApi | ||
|
||
class TestCmisFr800gApi(object): | ||
codes = CmisCodes | ||
mem_map = CmisMemMap(codes) | ||
reader = MagicMock(return_value=None) | ||
writer = MagicMock() | ||
eeprom = XcvrEeprom(reader, writer, mem_map) | ||
api = CmisFr800gApi(eeprom) | ||
|
||
def test_get_transceiver_info_firmware_versions(self): | ||
self.api.get_module_inactive_firmware = MagicMock() | ||
self.api.get_module_inactive_firmware.return_value = "1.0" | ||
self.api.get_module_active_firmware = MagicMock() | ||
self.api.get_module_active_firmware.return_value = "1.1" | ||
expected_result = {"active_firmware" : "1.1.0", "inactive_firmware" : "1.0.0"} | ||
result = self.api.get_transceiver_info_firmware_versions() | ||
assert result == expected_result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters