Skip to content

Commit 3282ab3

Browse files
authored
DOM for flat memory transceiver modules (sonic-net#3950)
* Fix: show interface transceiver info Ethernet0 command fails for CMIS SFP * Fix variable name error. * Return DOM for flat memory modules if it's available. * Update unit tests. * Update unit tests. * Update unit tests. * Update unit tests.
1 parent 6f1a794 commit 3282ab3

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

sfputil/main.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -695,10 +695,6 @@ def eeprom(port, dump_dom, namespace):
695695
output += "API is none while getting DOM info!\n"
696696
click.echo(output)
697697
sys.exit(ERROR_NOT_IMPLEMENTED)
698-
else:
699-
if api.is_flat_memory():
700-
output += "DOM values not supported for flat memory module\n"
701-
continue
702698
try:
703699
xcvr_dom_info = platform_chassis.get_sfp(physical_port).get_transceiver_dom_real_value()
704700
except NotImplementedError:

tests/sfputil_test.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@
6060
Vendor Rev: A2
6161
Vendor SN: MT1636VS10561
6262
"""
63+
EMPTY_DOM_VALUES = """ ChannelMonitorValues:
64+
ChannelThresholdValues:
65+
ModuleMonitorValues:
66+
ModuleThresholdValues:
67+
68+
69+
"""
6370

6471
class TestSfputil(object):
6572
def test_format_dict_value_to_string(self):
@@ -676,7 +683,7 @@ def test_show_eeprom_RJ45(self, mock_chassis):
676683
@patch('sfputil.main.platform_sfputil', MagicMock(is_logical_port=MagicMock(return_value=1)))
677684
@patch('sfputil.main.is_port_type_rj45', MagicMock(return_value=False))
678685
@pytest.mark.parametrize("exception, xcvr_api_none, expected_output", [
679-
(None, False, '''DOM values not supported for flat memory module\n\n'''),
686+
(None, False, EMPTY_DOM_VALUES),
680687
(NotImplementedError, False, '''API is currently not implemented for this platform\n\n'''),
681688
(None, True, '''API is none while getting DOM info!\n\n''')
682689
])

0 commit comments

Comments
 (0)