Skip to content

Commit

Permalink
working on coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
rameshraghupathy committed Nov 14, 2024
1 parent 778c342 commit c9f503d
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions sonic-chassisd/tests/test_chassisd.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,8 @@ def test_midplane_presence_dpu_modules(mock_open, mock_makedirs):

# Run chassis db clean up
module_updater.module_down_chassis_db_cleanup()
module_updater.chassis_state_db = None
module_updater.module_down_chassis_db_cleanup()

#Deinit
module_updater.deinit()
Expand Down Expand Up @@ -1327,7 +1329,6 @@ def test_daemon_run_supervisor_invalid_slot():
daemon_chassisd.stop = MagicMock()
daemon_chassisd.stop.wait.return_value = True
module_updater.my_slot = ModuleBase.MODULE_INVALID_SLOT
module_updater.slot = ModuleBase.MODULE_INVALID_SLOT
module_updater.supervisor_slot = ModuleBase.MODULE_INVALID_SLOT
daemon_chassisd.run()

Expand Down Expand Up @@ -1381,24 +1382,6 @@ def test_daemon_run_linecard():
daemon_chassisd.run()


def test_daemon_run_linecard_invalid_slot():
# Test the chassisd run
chassis = MockChassis()

chassis.get_supervisor_slot = Mock()
chassis.get_supervisor_slot.return_value = ModuleBase.MODULE_INVALID_SLOT
chassis.get_my_slot = Mock()
chassis.get_my_slot.return_value = ModuleBase.MODULE_INVALID_SLOT

daemon_chassisd = ChassisdDaemon(SYSLOG_IDENTIFIER, chassis)
daemon_chassisd.stop = MagicMock()
daemon_chassisd.stop.wait.return_value = True
daemon_chassisd.run()
module_updater.slot = ModuleBase.MODULE_INVALID_SLOT
module_updater.supervisor_slot = ModuleBase.MODULE_INVALID_SLOT
daemon_chassisd.run()


def test_chassis_db_cleanup():
chassis = MockChassis()

Expand Down

0 comments on commit c9f503d

Please sign in to comment.