]> git.proxmox.com Git - ceph.git/blobdiff - ceph/qa/workunits/fs/damage/test-first-damage.sh
update ceph source to reef 18.2.0
[ceph.git] / ceph / qa / workunits / fs / damage / test-first-damage.sh
index 5cbae5f37fa125ace04de3e43ad7f4b97720d9c4..57447b957d789a357b8d79eb06172e09c96a2c0f 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'
@@ -19,6 +20,7 @@ function create {
   DIR_INODE=$(stat -c '%i' dir)
   touch dir/a
   touch dir/"a space"
+  touch -- $(printf 'dir/\xff')
   mkdir dir/.snap/1
   mkdir dir/.snap/2
   # two snaps
@@ -83,9 +85,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 +125,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 +150,10 @@ function main {
               FIRST_DAMAGE="$2"
               shift 2
               ;;
+          --python)
+              PYTHON="$2"
+              shift 2
+              ;;
           --)
               shift
               break