diff --git a/sonic_platform_base/sonic_xcvr/api/public/cmis.py b/sonic_platform_base/sonic_xcvr/api/public/cmis.py index d2534b83dccb..86620dcd042d 100644 --- a/sonic_platform_base/sonic_xcvr/api/public/cmis.py +++ b/sonic_platform_base/sonic_xcvr/api/public/cmis.py @@ -1929,6 +1929,11 @@ def get_application_advertisement(self): break buf['host_lane_assignment_options'] = val + key = "{}_{}".format(consts.MEDIA_LANE_ASSIGNMENT_OPTION, app) + val = dic.get(key) + if val is not None: + buf['media_lane_assignment_options'] = val + ret[app] = buf return ret diff --git a/tests/sonic_xcvr/test_cmis.py b/tests/sonic_xcvr/test_cmis.py index 3993eb608d20..8364a5c89b18 100644 --- a/tests/sonic_xcvr/test_cmis.py +++ b/tests/sonic_xcvr/test_cmis.py @@ -1044,7 +1044,7 @@ def test_get_module_fw_info(self, mock_response, expected): if result['status'] == False: # Check 'result' when 'status' == False for distinguishing error type. assert result['result'] == expected['result'] assert result['status'] == expected['status'] - + @pytest.mark.parametrize("input_param, mock_response, expected", [ (1, 1, (True, 'Module FW run: Success\n')), (1, 64, (False, 'Module FW run: Fail\nFW_run_status 64\n')), @@ -2006,7 +2006,8 @@ def test_get_application_advertisement(self): consts.MODULE_MEDIA_INTERFACE_SM + "_1": "400GBASE-DR4 (Cl 124)", consts.MEDIA_LANE_COUNT + "_1": 4, consts.HOST_LANE_COUNT + "_1": 8, - consts.HOST_LANE_ASSIGNMENT_OPTION + "_1": 0x01 + consts.HOST_LANE_ASSIGNMENT_OPTION + "_1": 0x01, + consts.MEDIA_LANE_ASSIGNMENT_OPTION + "_1": 0x02 }, Sff8024.MODULE_MEDIA_TYPE[2] ] @@ -2018,6 +2019,7 @@ def test_get_application_advertisement(self): assert result[1]['host_lane_count'] == 8 assert result[1]['media_lane_count'] == 4 assert result[1]['host_lane_assignment_options'] == 0x01 + assert result[1]['media_lane_assignment_options'] == 0x02 def test_get_application_advertisement_non_support(self): self.api.xcvr_eeprom.read = MagicMock(return_value = None)