Skip to content

Commit

Permalink
Fix for #19116 [xcvrd] typo "log_notifce" results in port oper down (#…
Browse files Browse the repository at this point in the history
…493)

* Update xcvrd.py

* Update test_xcvrd.py
  • Loading branch information
AnoopKamath authored May 31, 2024
1 parent f41ecca commit 76cf1dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion sonic-xcvrd/tests/test_xcvrd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1945,11 +1945,12 @@ def test_CmisManagerTask_task_worker(self, mock_chassis, mock_get_status_tbl):
task.configure_tx_output_power = MagicMock(return_value=1)
task.configure_laser_frequency = MagicMock(return_value=1)

# Shouldn't proceed to DP_DEINIT on error
task.is_appl_reconfigure_required = MagicMock(return_value=True)
mock_xcvr_api.decommission_all_datapaths = MagicMock(return_value=False)
task.task_stopping_event.is_set = MagicMock(side_effect=[False, False, True])
task.task_worker()
assert get_cmis_state_from_state_db('Ethernet1', task.xcvr_table_helper.get_status_tbl(task.port_mapping.get_asic_id_for_logical_port('Ethernet1'))) == CMIS_STATE_FAILED
assert not get_cmis_state_from_state_db('Ethernet1', task.xcvr_table_helper.get_status_tbl(task.port_mapping.get_asic_id_for_logical_port('Ethernet1'))) == CMIS_STATE_DP_DEINIT

@pytest.mark.parametrize("lport, expected_dom_polling", [
('Ethernet0', 'disabled'),
Expand Down
2 changes: 1 addition & 1 deletion sonic-xcvrd/xcvrd/xcvrd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,7 @@ def task_worker(self):
if True == self.is_appl_reconfigure_required(api, appl):
self.log_notice("{}: Decommissioning all lanes/datapaths to default AppSel=0".format(lport))
if True != api.decommission_all_datapaths():
self.log_notifce("{}: Failed to default to AppSel=0".format(lport))
self.log_notice("{}: Failed to default to AppSel=0".format(lport))
self.force_cmis_reinit(lport, retries + 1)
continue

Expand Down

0 comments on commit 76cf1dc

Please sign in to comment.