Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions framework/python/src/net_orc/network_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 5 additions & 1 deletion framework/python/src/test_orc/test_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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",
Expand Down