From 0a82b7a3c547fb9f9fc8c9846cce20c17c268714 Mon Sep 17 00:00:00 2001 From: Kamil Gierszewski Date: Wed, 15 May 2024 23:42:31 +0200 Subject: [PATCH] test-framework: add bash_path to fix LocalRun on windows Signed-off-by: Kamil Gierszewski --- connection/local_executor.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/connection/local_executor.py b/connection/local_executor.py index 9a64a19..4bafeb0 100644 --- a/connection/local_executor.py +++ b/connection/local_executor.py @@ -8,15 +8,18 @@ import subprocess from datetime import timedelta from connection.base_executor import BaseExecutor +from core.test_run import TestRun from test_utils.output import Output class LocalExecutor(BaseExecutor): def _execute(self, command, timeout): + bash_path = TestRun.config.get("bash_path", "/bin/bash") + completed_process = subprocess.run( command, shell=True, - executable="/bin/bash", + executable=bash_path, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=timeout.total_seconds(), @@ -38,6 +41,7 @@ class LocalExecutor(BaseExecutor): dut_to_controller=False, ): options = [] + bash_path = TestRun.config.get("bash_path", "/bin/bash") if delete: options.append("--delete") @@ -52,7 +56,7 @@ class LocalExecutor(BaseExecutor): completed_process = subprocess.run( f'rsync -r {src} {dst} {" ".join(options)}', shell=True, - executable="/bin/bash", + executable=bash_path, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=timeout.total_seconds(),