Skip to content

Bug: [PMON] "is_replaceable" field is missing from TRANSCEIVER_INFO table of CMIS cables and impacting SNMP test #22213

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

Open
keboliu opened this issue Apr 2, 2025 · 0 comments
Assignees
Labels
Bug 🐛 MSFT Triaged this issue has been triaged

Comments

@keboliu
Copy link
Collaborator

keboliu commented Apr 2, 2025

Is it platform specific

generic

Importance or Severity

Critical

Description of the bug

after PR sonic-net/sonic-platform-daemons#590 merged, it removed the "is_replaceable" field from the TRANSCEIVER_INFO table of CMIS cables.

This field is referred by SNMP implementation https://github.com/sonic-net/sonic-snmpagent/blob/25f9e4fa16e8f4789f770b4c93537bb2026c8ec5/src/sonic_ax_impl/mibs/ietf/rfc2737.py#L103

@unique
class XcvrInfoDB(str, Enum):
    """
    Transceiver info keys
    """
    TYPE              = "type"
    VENDOR_REVISION   = "vendor_rev"
    SERIAL_NUMBER     = "serial"
    MANUFACTURE_NAME  = "manufacturer"
    MODEL_NAME        = "model"
    REPLACEABLE       = 'is_replaceable'

and SNMP test test_transceiver_info is failing:
https://github.com/sonic-net/sonic-mgmt/blob/master/tests/snmp/test_snmp_phy_entity.py#L559

Steps to Reproduce

the issue can be reproduced with the master image including PR sonic-net/sonic-platform-daemons#590 on a switch with a CMIS cable plugged in.

Actual Behavior and Expected Behavior

"is_replaceable" filed missing from the table:

{
   "model":"MCP1660-W00AE30 ",
   "media_interface_code":"Copper cable",
   "active_apsel_hostlane6":"N/A",
   "ext_identifier":"Power Class 1 (0.25W Max)",
   "hardware_rev":"0.0",
   "active_apsel_hostlane3":"N/A",
   "host_lane_assignment_option":"1",
   "connector":"No separable connector",
   "host_electrical_interface":"N/A",
   "encoding":"N/A",
   "type_abbrv_name":"QSFP-DD",
   "active_apsel_hostlane8":"N/A",
   "active_apsel_hostlane5":"N/A",
   "media_interface_technology":"Copper cable unequalized",
   "media_lane_assignment_option":"N/A",
   "active_apsel_hostlane1":"N/A",
   "media_lane_count":"0",
   "vendor_oui":"00-02-c9",
   "ext_rateselect_compliance":"N/A",
   "vendor_rev":"A3",
   "cable_type":"Length Cable Assembly(m)",
   "host_lane_count":"8",
   "active_apsel_hostlane2":"N/A",
   "specification_compliance":"passive_copper_media_interface",
   "application_advertisement":"{1: {'host_electrical_interface_id': '400G CR8', 'module_media_interface_id': 'Copper cable', 'media_lane_count': 8, 'host_lane_count': 8, 'host_lane_assignment_options': 1}, 2: {'host_electrical_interface_id': '200GBASE-CR4 (Clause 136)', 'module_media_interface_id': 'Copper cable', 'media_lane_count': 4, 'host_lane_count': 4, 'host_lane_assignment_options': 17}, 3: {'host_electrical_interface_id': '100GBASE-CR2 (Clause 136)', 'module_media_interface_id': 'Copper cable', 'media_lane_count': 2, 'host_lane_count': 2, 'host_lane_assignment_options': 85}, 4: {'host_electrical_interface_id': '100GBASE-CR4 (Clause 92)', 'module_media_interface_id': 'Copper cable', 'media_lane_count': 4, 'host_lane_count': 4, 'host_lane_assignment_options': 17}, 5: {'host_electrical_interface_id': '50GBASE-CR (Clause 126)', 'module_media_interface_id': 'Copper cable', 'media_lane_count': 1, 'host_lane_count': 1, 'host_lane_assignment_options': 255}, 6: {'host_electrical_interface_id': '50GBASE-CR2 (Ethernet Technology Consortium) with no FEC', 'module_media_interface_id': 'Copper cable', 'media_lane_count': 2, 'host_lane_count': 2, 'host_lane_assignment_options': 85}, 7: {'host_electrical_interface_id': '25GBASE-CR CA-N (Clause 110)', 'module_media_interface_id': 'Copper cable', 'media_lane_count': 1, 'host_lane_count': 1, 'host_lane_assignment_options': 255}, 8: {'host_electrical_interface_id': '1000BASE -CX(Clause 39)', 'module_media_interface_id': 'Copper cable', 'media_lane_count': 1, 'host_lane_count': 1, 'host_lane_assignment_options': 255}}",
   "vendor_date":"2021-05-14   ",
   "serial":"MT2120VS03862   ",
   "type":"QSFP-DD Double Density 8X Pluggable Transceiver",
   "nominal_bit_rate":"N/A",
   "cmis_rev":"4.0",
   "active_apsel_hostlane4":"N/A",
   "manufacturer":"Mellanox        ",
   "vdm_supported":"False",
   "cable_length":"0.5",
   "active_apsel_hostlane7":"N/A"
}

Relevant log output

def test_transceiver_info(duthosts, enum_rand_one_per_hwsku_hostname, snmp_physical_entity_and_sensor_info):
        """
        Verify transceiver information in physical entity mib with redis database
        :param duthost: DUT host object
        :param snmp_physical_entity_info: Physical entity information from snmp fact
        :return:
        """
        snmp_physical_entity_info = snmp_physical_entity_and_sensor_info["entity_mib"]
        duthost = duthosts[enum_rand_one_per_hwsku_hostname]
        keys = redis_get_keys(duthost, STATE_DB, XCVR_KEY_TEMPLATE.format('*'))
        # Ignore the test if the platform does not have interfaces (e.g Supervisor)
        if not keys:
            pytest.skip('Transceiver information does not exist in DB, skipping this test')
        name_to_snmp_facts = {}
        for oid, values in list(snmp_physical_entity_info.items()):
            values['oid'] = oid
            name_to_snmp_facts[values['entPhysName']] = values
    
        transceiver_rev_key = "vendor_rev"
        release_list = ["201911", "202012", "202106", "202111"]
        if any(release in duthost.os_version for release in release_list):
            transceiver_rev_key = "hardware_rev"
    
        for key in keys:
            name = key.split(TABLE_NAME_SEPARATOR_VBAR)[-1]
            assert name in name_to_snmp_facts, 'Cannot find port {} in physical entity mib'.format(
                name)
            transceiver_info = redis_hgetall(duthost, STATE_DB, key)
            transceiver_snmp_fact = name_to_snmp_facts[name]
            assert transceiver_snmp_fact['entPhysDescr'] is not None
            assert transceiver_snmp_fact['entPhysContainedIn'] == CHASSIS_SUB_ID
            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[transceiver_rev_key]
            assert transceiver_snmp_fact['entPhysFwVer'] == ''
            assert transceiver_snmp_fact['entPhysSwVer'] == ''
            assert transceiver_snmp_fact['entPhysSerialNum'] == transceiver_info['serial']
            assert transceiver_snmp_fact['entPhysMfgName'] == transceiver_info['manufacturer']
            assert transceiver_snmp_fact['entPhysModelName'] == transceiver_info['model']
>           assert transceiver_snmp_fact['entPhysIsFRU'] == REPLACEABLE if transceiver_info[
                'is_replaceable'] == 'True' else NOT_REPLACEABLE
E           KeyError: 'is_replaceable'

Output of show version, show techsupport

Attach files (if any)

No response

@prgeor prgeor added Triaged this issue has been triaged MSFT labels Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 MSFT Triaged this issue has been triaged
Projects
None yet
Development

No branches or pull requests

3 participants