test-framework: Fix Python subprocess shell
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@huawei.com>
This commit is contained in:
parent
5e9bba66c2
commit
5051ef1f1a
@ -1,5 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Copyright(c) 2019-2021 Intel Corporation
|
# Copyright(c) 2019-2021 Intel Corporation
|
||||||
|
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
|
||||||
@ -15,6 +16,7 @@ class LocalExecutor(BaseExecutor):
|
|||||||
completed_process = subprocess.run(
|
completed_process = subprocess.run(
|
||||||
command,
|
command,
|
||||||
shell=True,
|
shell=True,
|
||||||
|
executable="/bin/bash",
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
timeout=timeout.total_seconds())
|
timeout=timeout.total_seconds())
|
||||||
@ -40,6 +42,7 @@ class LocalExecutor(BaseExecutor):
|
|||||||
completed_process = subprocess.run(
|
completed_process = subprocess.run(
|
||||||
f'rsync -r {src} {dst} {" ".join(options)}',
|
f'rsync -r {src} {dst} {" ".join(options)}',
|
||||||
shell=True,
|
shell=True,
|
||||||
|
executable="/bin/bash",
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
timeout=timeout.total_seconds())
|
timeout=timeout.total_seconds())
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Copyright(c) 2019-2021 Intel Corporation
|
# Copyright(c) 2019-2021 Intel Corporation
|
||||||
|
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
import os
|
import os
|
||||||
@ -118,6 +119,7 @@ class SshExecutor(BaseExecutor):
|
|||||||
f'-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" '
|
f'-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" '
|
||||||
+ src_to_dst + f'{" ".join(options)}',
|
+ src_to_dst + f'{" ".join(options)}',
|
||||||
shell=True,
|
shell=True,
|
||||||
|
executable="/bin/bash",
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
timeout=timeout.total_seconds())
|
timeout=timeout.total_seconds())
|
||||||
@ -210,6 +212,7 @@ class SshExecutor(BaseExecutor):
|
|||||||
completed_process = subprocess.run(
|
completed_process = subprocess.run(
|
||||||
f"ssh{identity_str} -p {port}{param} {user_str}{hostname} {command}",
|
f"ssh{identity_str} -p {port}{param} {user_str}{hostname} {command}",
|
||||||
shell=True,
|
shell=True,
|
||||||
|
executable="/bin/bash",
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
timeout=30)
|
timeout=30)
|
||||||
|
Loading…
Reference in New Issue
Block a user