@@ -2046,6 +2046,7 @@ def test_CmisManagerTask_task_worker(self, mock_chassis, mock_get_status_tbl):
2046
2046
mock_xcvr_api .get_module_type_abbreviation = MagicMock (return_value = 'QSFP-DD' )
2047
2047
mock_xcvr_api .get_datapath_init_duration = MagicMock (return_value = 60000.0 )
2048
2048
mock_xcvr_api .get_module_pwr_up_duration = MagicMock (return_value = 70000.0 )
2049
+ mock_xcvr_api .get_module_pwr_down_duration = MagicMock (return_value = 70000.0 )
2049
2050
mock_xcvr_api .get_datapath_deinit_duration = MagicMock (return_value = 600000.0 )
2050
2051
mock_xcvr_api .get_cmis_rev = MagicMock (return_value = '5.0' )
2051
2052
mock_xcvr_api .get_supported_freq_config = MagicMock (return_value = (0xA0 ,0 ,0 ,191300 ,196100 ))
@@ -2077,7 +2078,6 @@ def test_CmisManagerTask_task_worker(self, mock_chassis, mock_get_status_tbl):
2077
2078
'media_lane_assignment_options' : 15
2078
2079
}
2079
2080
})
2080
- mock_xcvr_api .get_module_state = MagicMock (return_value = 'ModuleReady' )
2081
2081
mock_xcvr_api .get_config_datapath_hostlane_status = MagicMock (return_value = {
2082
2082
'ConfigStatusLane1' : 'ConfigSuccess' ,
2083
2083
'ConfigStatusLane2' : 'ConfigSuccess' ,
@@ -2228,17 +2228,21 @@ def test_CmisManagerTask_task_worker(self, mock_chassis, mock_get_status_tbl):
2228
2228
# Case 1: Module Inserted --> DP_DEINIT
2229
2229
task .is_appl_reconfigure_required = MagicMock (return_value = True )
2230
2230
mock_xcvr_api .decommission_all_datapaths = MagicMock (return_value = True )
2231
+ task .need_lp_mode_for_dpdeinit = MagicMock (return_value = True )
2231
2232
task .task_stopping_event .is_set = MagicMock (side_effect = [False , False , True ])
2232
2233
task .task_worker ()
2233
2234
assert get_cmis_state_from_state_db ('Ethernet0' , task .xcvr_table_helper .get_status_tbl (task .port_mapping .get_asic_id_for_logical_port ('Ethernet0' ))) == CMIS_STATE_DP_DEINIT
2235
+ assert mock_xcvr_api .set_lpmode .call_count == 1
2236
+ mock_xcvr_api .get_module_state = MagicMock (return_value = 'ModuleLowPwr' )
2234
2237
task .task_stopping_event .is_set = MagicMock (side_effect = [False , False , True ])
2235
2238
task .task_worker ()
2236
2239
assert mock_xcvr_api .set_datapath_deinit .call_count == 1
2237
2240
assert mock_xcvr_api .tx_disable_channel .call_count == 1
2238
- assert mock_xcvr_api .set_lpmode .call_count == 1
2241
+ assert mock_xcvr_api .set_lpmode .call_count == 2
2239
2242
assert get_cmis_state_from_state_db ('Ethernet0' , task .xcvr_table_helper .get_status_tbl (task .port_mapping .get_asic_id_for_logical_port ('Ethernet0' ))) == CMIS_STATE_AP_CONF
2240
2243
2241
2244
# Case 2: DP_DEINIT --> AP Configured
2245
+ mock_xcvr_api .get_module_state = MagicMock (return_value = 'ModuleReady' )
2242
2246
task .task_stopping_event .is_set = MagicMock (side_effect = [False , False , True ])
2243
2247
task .task_worker ()
2244
2248
assert mock_xcvr_api .set_application .call_count == 1
0 commit comments