]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: add option to set python executable
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 11 May 2023 16:16:59 +0000 (12:16 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 7 Jun 2023 01:39:41 +0000 (21:39 -0400)
To support systems like mine with multiple python installs.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
qa/workunits/fs/damage/test-first-damage.sh

index 5cbae5f37fa125ace04de3e43ad7f4b97720d9c4..e13f1ef13e0daf3529086736ea14f97ab70cf24b 100755 (executable)
@@ -6,6 +6,7 @@ FIRST_DAMAGE="first-damage.py"
 FS=cephfs
 METADATA_POOL=cephfs_meta
 MOUNT=~/mnt/mnt.0
+PYTHON=python3
 
 function usage {
   printf '%s: [--fs=<fs_name>] [--metadata-pool=<pool>] [--first-damage=</path/to/first-damage.py>]\n'
@@ -83,9 +84,9 @@ function recover {
   sleep 5
   cephfs-journal-tool --rank="$FS":0 event recover_dentries summary
   cephfs-journal-tool --rank="$FS":0 journal reset
-  python3 $FIRST_DAMAGE --debug /tmp/debug1 --memo /tmp/memo1 "$METADATA_POOL"
-  python3 $FIRST_DAMAGE --debug /tmp/debug2 --memo /tmp/memo2 --repair-nosnap  "$METADATA_POOL"
-  python3 $FIRST_DAMAGE --debug /tmp/debug3 --memo /tmp/memo3 --remove "$METADATA_POOL"
+  "$PYTHON" $FIRST_DAMAGE --debug /tmp/debug1 --memo /tmp/memo1 "$METADATA_POOL"
+  "$PYTHON" $FIRST_DAMAGE --debug /tmp/debug2 --memo /tmp/memo2 --repair-nosnap  "$METADATA_POOL"
+  "$PYTHON" $FIRST_DAMAGE --debug /tmp/debug3 --memo /tmp/memo3 --remove "$METADATA_POOL"
   ceph fs set "$FS" joinable true
 }
 
@@ -123,7 +124,7 @@ function mount {
 }
 
 function main {
-  eval set -- $(getopt --name "$0" --options '' --longoptions 'help,fs:,metadata-pool:,first-damage:,mount:' -- "$@")
+  eval set -- $(getopt --name "$0" --options '' --longoptions 'help,fs:,metadata-pool:,first-damage:,mount:,python:' -- "$@")
 
   while [ "$#" -gt 0 ]; do
       echo "$*"
@@ -148,6 +149,10 @@ function main {
               FIRST_DAMAGE="$2"
               shift 2
               ;;
+          --python)
+              PYTHON="$2"
+              shift 2
+              ;;
           --)
               shift
               break