From 7e6e1a3916097bc378788814343db02915d0c53e Mon Sep 17 00:00:00 2001 From: Anoop Kamath <115578705+AnoopKamath@users.noreply.github.com> Date: Wed, 29 May 2024 10:51:08 -0700 Subject: [PATCH 1/2] Update xcvrd.py --- sonic-xcvrd/xcvrd/xcvrd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonic-xcvrd/xcvrd/xcvrd.py b/sonic-xcvrd/xcvrd/xcvrd.py index 2593eba1e..7039ca32b 100644 --- a/sonic-xcvrd/xcvrd/xcvrd.py +++ b/sonic-xcvrd/xcvrd/xcvrd.py @@ -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 From 7c6b0a7cf43773907abd257024ab43131d1538ba Mon Sep 17 00:00:00 2001 From: Anoop Kamath <115578705+AnoopKamath@users.noreply.github.com> Date: Thu, 30 May 2024 17:01:48 -0700 Subject: [PATCH 2/2] Update test_xcvrd.py --- sonic-xcvrd/tests/test_xcvrd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sonic-xcvrd/tests/test_xcvrd.py b/sonic-xcvrd/tests/test_xcvrd.py index f28052642..89c55e4d1 100644 --- a/sonic-xcvrd/tests/test_xcvrd.py +++ b/sonic-xcvrd/tests/test_xcvrd.py @@ -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'),