]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/smb: make the runner script easier to use manually 65632/head
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 9 Jan 2026 16:25:43 +0000 (11:25 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 29 Jan 2026 17:07:05 +0000 (12:07 -0500)
When testing the tests it can help speed things up to avoid
recreating the virtualenv, allow an env var SMB_REUSE_VENV=<path>
to supply a specific virtual env dir to (re)use.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
qa/workunits/smb/smb_tests.sh

index cc0334d1470cda663950a727107138f01faba3b0..24337ff6c9c3005cb30c26df5a94655897bdb1e2 100755 (executable)
@@ -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}"