}
run_test 81 "sparse OST indexing"
+random_ost_indices() {
+ local num=$1
+ local LOV_V1_INSANE_STRIPE_COUNT=65532
+ local index
+ local skip
+ local i=0
+
+ while ((i < num)); do
+ skip=false
+
+ index=$(((RANDOM * 2) % LOV_V1_INSANE_STRIPE_COUNT))
+ for k in $ost_indices; do
+ ((index == k)) && skip=true
+ done
+ $skip && continue
+ ost_indices+=" $index"
+ i=$((i+1))
+ done
+ echo $ost_indices
+}
+
# Here we exercise the stripe placement functionality on a file system that
# has formatted the OST with a random index. With the file system the following
# functionality is tested:
# Format OSTs with random sparse indices.
local i
- local index
local ost_indices
- local LOV_V1_INSANE_STRIPE_COUNT=65532
- for i in $(seq $OSTCOUNT); do
- index=$(((RANDOM * 2) % LOV_V1_INSANE_STRIPE_COUNT))
- ost_indices+=" $index"
- done
- ost_indices=$(comma_list $ost_indices)
+
+ ost_indices=$(comma_list $(random_ost_indices 3))
stack_trap "restore_ostindex" EXIT
echo -e "\nFormat $OSTCOUNT OSTs with sparse indices $ost_indices"
# Format OSTs with random sparse indices.
local i
- local index
local ost_indices
- local LOV_V1_INSANE_STRIPE_COUNT=65532
- for i in $(seq $OSTCOUNT); do
- index=$(((RANDOM * 2) % LOV_V1_INSANE_STRIPE_COUNT))
- ost_indices+=" $index"
- done
- ost_indices=$(comma_list $ost_indices)
+
+ ost_indices=$(comma_list $(random_ost_indices 4))
stack_trap "restore_ostindex" EXIT
echo -e "\nFormat $OSTCOUNT OSTs with sparse indices $ost_indices"