Skip to content

Commit

Permalink
Merge pull request openzfs#813 from delphix/dlpx/pr/vaibhav-delphix/f…
Browse files Browse the repository at this point in the history
…e6ff6c0-7ed5-4638-a3be-1ce12e50bab3

QA-40085  Reduce scope of zloop to include tests applicable to Delphix
  • Loading branch information
vaibhav-delphix authored Apr 20, 2023
2 parents 638ad4e + abb8f20 commit b5eea09
Showing 1 changed file with 4 additions and 45 deletions.
49 changes: 4 additions & 45 deletions scripts/zloop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -389,58 +389,17 @@ while (( timeout == 0 )) || (( curtime <= (starttime + timeout) )); do
zopt="$zopt -b $ZTS_BUCKET_NAME"
zopt="$zopt -L $ZTS_OBJECT_STORE"
else

# switch between three types of configs
# 1/3 basic, 1/3 raidz mix, and 1/3 draid mix
choice=$((RANDOM % 3))

# ashift range 9 - 15
# ashift range 9 - 15
align=$(((RANDOM % 2) * 3 + 9))

# randomly use special classes
class="special=random"
vdevs=$((1 + (RANDOM % 3)))

if [[ $choice -eq 0 ]]; then
# basic mirror only
parity=1
mirrors=2
draid_data=0
draid_spares=0
raid_children=0
vdevs=2
raid_type="raidz"
elif [[ $choice -eq 1 ]]; then
# fully randomized mirror/raidz (sans dRAID)
parity=$(((RANDOM % 3) + 1))
mirrors=$(((RANDOM % 3) * 1))
draid_data=0
draid_spares=0
raid_children=$((((RANDOM % 9) + parity + 1) * (RANDOM % 2)))
vdevs=$(((RANDOM % 3) + 3))
raid_type="raidz"
else
# fully randomized dRAID (sans mirror/raidz)
parity=$(((RANDOM % 3) + 1))
mirrors=0
draid_data=$(((RANDOM % 8) + 3))
draid_spares=$(((RANDOM % 2) + parity))
stripe=$((draid_data + parity))
extra=$((draid_spares + (RANDOM % 4)))
raid_children=$(((((RANDOM % 4) + 1) * stripe) + extra))
vdevs=$((RANDOM % 3))
raid_type="draid"
fi

zopt="$zopt -K $raid_type"
zopt="$zopt -m $mirrors"
zopt="$zopt -r $raid_children"
zopt="$zopt -D $draid_data"
zopt="$zopt -S $draid_spares"
zopt="$zopt -R $parity"
zopt="$zopt -v $vdevs"
zopt="$zopt -a $align"
zopt="$zopt -a $align"
zopt="$zopt -C $class"
zopt="$zopt -s $size"
zopt="$zopt -s $size"
fi
cmd="$ZTEST $zopt $*"
echo "$(date '+%m/%d %T') $cmd" | tee -a ztest.history ztest.out
Expand Down

0 comments on commit b5eea09

Please sign in to comment.