Whamcloud - gitweb
LU-10740 tests: disable tests for replay-dne-zfs-part-4
[fs/lustre-release.git] / lustre / tests / racer / file_create.sh
index c07c813..3b37858 100755 (executable)
@@ -1,25 +1,22 @@
 #!/bin/bash
 trap 'kill $(jobs -p)' EXIT
+RACER_ENABLE_PFL=${RACER_ENABLE_PFL:-true}
 RACER_ENABLE_DOM=${RACER_ENABLE_DOM:-false}
+RACER_ENABLE_FLR=${RACER_ENABLE_FLR:-true}
 DIR=$1
 MAX=$2
 MAX_MB=${RACER_MAX_MB:-8}
 
-. $LUSTRE/tests/test-framework.sh
-
-OSTCOUNT=${OSTCOUNT:-$($LFS df $DIR 2> /dev/null | grep -c OST)}
-
 layout=(raid0 raid0)
 
 # check if it supports PFL layout
-[[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.10.0) ]] &&
-       layout+=(pfl pfl pfl)
+$RACER_ENABLE_PFL && layout+=(pfl pfl pfl)
 
 # check if it supports DoM
-if $RACER_ENABLE_DOM ; then
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.10.53) ]] &&
-               layout+=(dom dom dom)
-fi
+$RACER_ENABLE_DOM && layout+=(dom dom dom)
+
+# check if it supports FLR
+$RACER_ENABLE_FLR && layout+=(flr flr flr)
 
 echo "layout: ${layout[*]}"
 
@@ -34,12 +31,13 @@ while /bin/true; do
                pattern=${layout[$RANDOM % ${#layout[*]}]}
 
                case $pattern in
-               dom) opt="-E $stripesize -L mdt -E eof -c $stripecount -S 1M" ;;
-               pfl) opt="-E 1M -S $stripesize -E eof -c $stripecount -S 2M" ;;
-               raid0) opt="-S $stripesize -c $stripecount" ;;
+               dom) opt="setstripe -E $stripesize -L mdt -E eof -c $stripecount -S 1M" ;;
+               pfl) opt="setstripe -E 1M -S $stripesize -E eof -c $stripecount -S 2M" ;;
+               flr) opt="mirror create -N2 -E 1M -S $stripesize -E eof -c $stripecount -S 2M" ;;
+               raid0) opt="setstripe -S $stripesize -c $stripecount" ;;
                esac
 
-               $LFS setstripe $opt $DIR/$file 2> /dev/null || true
+               $LFS $opt $DIR/$file 2> /dev/null || true
        }
 
        # offset between 0 and 16MB (256 64k chunks), with 1/2 at offset 0