From ec861dc8eac7e52495327bbbc5a413ff2ef10d25 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Fri, 9 Jan 2026 11:25:43 -0500 Subject: [PATCH] qa/workunits/smb: make the runner script easier to use manually When testing the tests it can help speed things up to avoid recreating the virtualenv, allow an env var SMB_REUSE_VENV= to supply a specific virtual env dir to (re)use. Signed-off-by: John Mulligan --- qa/workunits/smb/smb_tests.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/qa/workunits/smb/smb_tests.sh b/qa/workunits/smb/smb_tests.sh index cc0334d1470c..24337ff6c9c3 100755 --- a/qa/workunits/smb/smb_tests.sh +++ b/qa/workunits/smb/smb_tests.sh @@ -2,15 +2,24 @@ set -ex -HERE=$(dirname $0) +HERE=$(dirname "$0") PY=${PYTHON:-python3} -VENV=${HERE}/"_smb_tests_$$" +if [ "${SMB_REUSE_VENV}" ]; then + VENV="${SMB_REUSE_VENV}" +else + VENV=${HERE}/"_smb_tests_$$" +fi cleanup() { + if [ "${SMB_REUSE_VENV}" ]; then + return + fi rm -rf "${VENV}" } -$PY -m venv "${VENV}" +if ! [ -d "${VENV}" ]; then + $PY -m venv "${VENV}" +fi trap cleanup EXIT cd "${HERE}" -- 2.47.3