diff --git a/framework/python/src/net_orc/network_orchestrator.py b/framework/python/src/net_orc/network_orchestrator.py index e410c7848..f20093a28 100644 --- a/framework/python/src/net_orc/network_orchestrator.py +++ b/framework/python/src/net_orc/network_orchestrator.py @@ -288,6 +288,12 @@ def _start_device_monitor(self, device): while sniffer.running: time.sleep(1) + + # Check Testrun hasn't been cancelled + if self._session.get_status() == 'Cancelled': + sniffer.stop() + return + if not self._ip_ctrl.check_interface_status( self._session.get_device_interface()): sniffer.stop() diff --git a/framework/python/src/test_orc/test_orchestrator.py b/framework/python/src/test_orc/test_orchestrator.py index 403034c72..cb23c3a9c 100644 --- a/framework/python/src/test_orc/test_orchestrator.py +++ b/framework/python/src/test_orc/test_orchestrator.py @@ -256,6 +256,10 @@ def _timestamp_results(self, device): shutil.copytree(cur_results_dir, completed_results_dir, dirs_exist_ok=True) util.run_command(f"chown -R {self._host_user} '{completed_results_dir}'") + # Copy Testrun log to testing directory + shutil.copy(os.path.join(self._root_path, "testrun.log"), + os.path.join(completed_results_dir, "testrun.log")) + return completed_results_dir def zip_results(self, @@ -272,7 +276,7 @@ def zip_results(self, timestamp) # Define temp directory to store files before zipping - results_dir = os.path.join(f'/tmp/testrun/{time.time()}') + results_dir = os.path.join(f"/tmp/testrun/{time.time()}") # Define where to save the zip file zip_location = os.path.join("/tmp/testrun",