2 trap 'kill $(jobs -p)' EXIT
3 RACER_ENABLE_DOM=${RACER_ENABLE_DOM:-false}
6 MAX_MB=${RACER_MAX_MB:-8}
8 . $LUSTRE/tests/test-framework.sh
10 OSTCOUNT=${OSTCOUNT:-$($LFS df $DIR 2> /dev/null | grep -c OST)}
14 # check if it supports PFL layout
15 [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.10.0) ]] &&
18 # check if it supports DoM
19 if $RACER_ENABLE_DOM ; then
20 [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.10.53) ]] &&
24 [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.10.55) ]] &&
27 echo "layout: ${layout[*]}"
30 file=$((RANDOM % MAX))
31 # $RANDOM is between 0 and 32767, and we want $blockcount in 64kB units
32 blockcount=$((RANDOM * MAX_MB / 32 / 64))
33 stripecount=$((RANDOM % (OSTCOUNT + 1)))
35 [ $stripecount -gt 0 ] && {
36 stripesize=$(((RANDOM % 16 + 1) * 64))K
37 pattern=${layout[$RANDOM % ${#layout[*]}]}
40 dom) opt="setstripe -E $stripesize -L mdt -E eof -c $stripecount -S 1M" ;;
41 pfl) opt="setstripe -E 1M -S $stripesize -E eof -c $stripecount -S 2M" ;;
42 flr) opt="mirror create -N2 -E 1M -S $stripesize -E eof -c $stripecount -S 2M" ;;
43 raid0) opt="setstripe -S $stripesize -c $stripecount" ;;
46 $LFS $opt $DIR/$file 2> /dev/null || true
49 # offset between 0 and 16MB (256 64k chunks), with 1/2 at offset 0
50 seek=$((RANDOM / 64)); [ $seek -gt 256 ] && seek=0
51 dd if=/dev/zero of=$DIR/$file bs=64k count=$blockcount \
52 seek=$seek 2> /dev/null || true