LUSTRE=${LUSTRE:-$(dirname $0)/..}
. $LUSTRE/tests/test-framework.sh
-init_test_env $@
+init_test_env "$@"
init_logging
ALWAYS_EXCEPT="$SANITY_FLR_EXCEPT "
echo "Verifying mirror read .."
local sum
- for i in ${mirror_array[@]}; do
+ for i in "${mirror_array[@]}"; do
$LCTL set_param ldlm.namespaces.*.lru_size=clear > /dev/null
sum=$($LFS mirror read -N $i $tf | md5sum)
[ "$sum" = "${checksums[$i]}" ] ||
# verify copying is successful by checking checksums
remount_client $MOUNT
- for i in ${mirror_array[@]}; do
+ for i in "${mirror_array[@]}"; do
sum=$($LFS mirror read -N $i $tf | md5sum)
[ "$sum" = "${checksums[1]}" ] ||
error "$i: mismatch checksum after copy \'$sum\'"
[ "$file_cksum" = "$ref_cksum" ] || error "write failed, cksum mismatch"
get_mirror_ids $tf
- echo "mirror IDs: ${mirror_array[@]}"
+ echo "mirror IDs: ${mirror_array[*]}"
local valid_mirror stale_mirror id mirror_cksum
for id in "${mirror_array[@]}"; do
if [[ $rc -eq 0 ]]; then
verify_flr_state $file "wp"
- elif [[ ! $prt =~ "unsupported" ]]; then
+ elif [[ ! $prt =~ unsupported ]]; then
error "punch hole in $file failed: $prt"
else
skip "Fallocate punch is not supported: $prt"
echo "mirror merge $tfile-2 to $tfile and test timestamps"
$LFS mirror extend -N -f $file-2 $file ||
error "cannot mirror merge $file-2 to $file"
- check_times_61 $file ${tim[@]}
+ check_times_61 $file "${tim[@]}"
echo "mirror extend $tfile and test timestamps"
$LFS mirror extend -N -c1 -i1 $file ||
error "cannot extend mirror $file"
- check_times_61 $file ${tim[@]}
+ check_times_61 $file "${tim[@]}"
echo "migrate $tfile and test timestamps"
$LFS migrate -n $file || error "cannot migrate $file"
- check_times_61 $file ${tim[@]}
+ check_times_61 $file "${tim[@]}"
echo "normal user migrate $tfile and test timestamps"
$RUNAS $LFS migrate -n $file || error "cannot migrate $file"
- check_times_61 $file ${tim[@]}
+ check_times_61 $file "${tim[@]}"
}
run_test 61a "mirror extend and migrate preserve timestamps"
echo "mirror extend $tfile and test timestamps"
$LFS mirror extend -N -c1 -i1 $file ||
error "cannot extend mirror $file"
- check_times_61 $file ${tim[@]}
+ check_times_61 $file "${tim[@]}"
echo "mirror split $tfile and test timestamps"
$LFS mirror split -d --mirror-id=1 $file ||
error "cannot split mirror 1 off $file"
- check_times_61 $file ${tim[@]}
+ check_times_61 $file "${tim[@]}"
echo "normal user mirror extend $tfile and test timestamps"
$RUNAS $LFS mirror extend -N -c1 -i1 $file ||
error "cannot extend mirror $file"
- check_times_61 $file ${tim[@]}
+ check_times_61 $file "${tim[@]}"
}
run_test 61b "mirror extend and split preserve timestamps"
tim=( $(get_times_61 $file) )
sleep $nap
$LFS mirror resync $file || error "cannot resync mirror $file"
- check_times_61 $file ${tim[@]}
+ check_times_61 $file "${tim[@]}"
echo XXXXXX > $file || error "write $tfile failed"
echo "normal user resync $tfile and test timestamps"
tim=( $(get_times_61 $file) )
$RUNAS $LFS mirror resync $file || error "cannot resync mirror $file"
- check_times_61 $file ${tim[@]}
+ check_times_61 $file "${tim[@]}"
}
run_test 61c "mirror resync preserves timestamps"
rm -f $ctrl_file
- echo "Waiting ${pids[@]}"
- wait ${pids[@]}
+ echo "Waiting ${pids[*]}"
+ wait "${pids[@]}"
umount_client $MOUNT2
umount_client $MOUNT3
$LFS mirror resync $tf || error "final resync failed"
get_mirror_ids $tf
- local csum=$($LFS mirror read -N ${mirror_array[0]} $tf | md5sum)
- for id in ${mirror_array[@]:1}; do
+ local csum=$($LFS mirror read -N "${mirror_array[0]}" $tf | md5sum)
+
+ for id in "${mirror_array[@]:1}"; do
[ "$($LFS mirror read -N $id $tf | md5sum)" = "$csum" ] ||
error "checksum error for mirror $id"
done
$LFS mirror create -N -S 4M -c 2 -N -S 1M -c -1 $file ||
error "create mirrored file $file failed"
get_mirror_ids $file
- echo "mirror IDs: ${mirror_array[@]}"
+ echo "mirror IDs: ${mirror_array[*]}"
dd if=$tmpfile of=$file bs=1M || error "can't copy"
get_mirror_ids $file
- echo "mirror IDs: ${mirror_array[@]}"
+ echo "mirror IDs: ${mirror_array[*]}"
drop_client_cache
cmp $tmpfile $file || error "files don't match"
get_mirror_ids $file
- echo "mirror IDs: ${mirror_array[@]}"
+ echo "mirror IDs: ${mirror_array[*]}"
# mirror creation should work fine
$LFS mirror extend -N -S 8M -c -1 $file ||
error "mirror extend $file failed"
get_mirror_ids $file
- echo "mirror IDs: ${mirror_array[@]}"
+ echo "mirror IDs: ${mirror_array[*]}"
drop_client_cache
$LFS mirror verify -v $file || error "verification failed"
osc.$FSNAME-OST000$ost-osc-[-0-9a-f]*.stats |
awk "/ost_$io/{print \$2}")
nr=${nr:-0}
- if [[ " $* " =~ " $ost " ]]; then
+ if [[ " $* " =~ $ost ]]; then
(( nr > 0 )) || error "expected reads on $ost"
else
(( nr == 0 )) || error "unexpected $nr reads on $ost"