From: John Mulligan Date: Fri, 9 Jan 2026 16:25:43 +0000 (-0500) Subject: qa/workunits/smb: make the runner script easier to use manually X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ec861dc8eac7e52495327bbbc5a413ff2ef10d25;p=ceph.git 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 --- 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}"