From 859f9a3d903a09fa03ee4744f8688e10f292c192 Mon Sep 17 00:00:00 2001 From: Carolina Lopes Date: Tue, 31 Oct 2023 15:25:55 +0000 Subject: [PATCH] Run simulated app to perform decommissioning --- app/chip_tool/chip_tool.py | 6 ++++++ app/chip_tool/test_suite.py | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/app/chip_tool/chip_tool.py b/app/chip_tool/chip_tool.py index 348a9554..3bc5a3e7 100644 --- a/app/chip_tool/chip_tool.py +++ b/app/chip_tool/chip_tool.py @@ -394,6 +394,12 @@ def destroy_device(self) -> None: container_manager.destroy(self.__chip_tool_container) self.__chip_tool_container = None + async def start_runner(self) -> None: + await self.__test_harness_runner.start() + + async def stop_runner(self) -> None: + await self.__test_harness_runner.stop() + def send_command( self, command: Union[str, list], diff --git a/app/chip_tool/test_suite.py b/app/chip_tool/test_suite.py index 3db81128..7fb57a85 100644 --- a/app/chip_tool/test_suite.py +++ b/app/chip_tool/test_suite.py @@ -159,9 +159,16 @@ async def cleanup(self) -> None: logger.info("Unpairing chip_tool from device") await self.chip_tool.unpair() # Need a better way to trigger unpair for chip-app. + # Currently the runner is being stopped automatically once + # the test completes. So we need to start it again to + # perform decommissioning elif self.test_type == ChipToolTestType.CHIP_APP: + logger.info("Run simulated app instance to perform decommissioning") + await self.chip_tool.start_runner() logger.info("Prompt user to perform decommissioning") await self.__prompt_user_to_perform_decommission() + logger.info("Stop simulated app instance") + await self.chip_tool.stop_runner() logger.info("Stopping chip-tool container") self.chip_tool.destroy_device()