diff --git a/sonic-xcvrd/tests/test_xcvrd.py b/sonic-xcvrd/tests/test_xcvrd.py index 924f9dfcf..82296f59e 100644 --- a/sonic-xcvrd/tests/test_xcvrd.py +++ b/sonic-xcvrd/tests/test_xcvrd.py @@ -1480,11 +1480,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'), diff --git a/sonic-xcvrd/xcvrd/xcvrd.py b/sonic-xcvrd/xcvrd/xcvrd.py index 5f9f9a201..9be206abc 100644 --- a/sonic-xcvrd/xcvrd/xcvrd.py +++ b/sonic-xcvrd/xcvrd/xcvrd.py @@ -1449,7 +1449,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