declare -a ost_idx
local index
+ local found
local i
local j
ost_idx=($($GETSTRIPE $tfile$i |
tail -n $((OSTCOUNT + 1)) | awk '{print $1}'))
echo ${ost_idx[@]}
+
# check the layout
- for j in $(seq 0 $((OSTCOUNT - 1))); do
- index=$(((i + j) % OSTCOUNT))
- [ ${ost_idx[$j]} -eq $index ] ||
- error "$j:${ost_idx[$j]} != $index"
+ [ ${#ost_idx[@]} -eq $OSTCOUNT ] ||
+ error "${#ost_idx[@]} != $OSTCOUNT"
+
+ for index in $(seq 0 $((OSTCOUNT - 1))); do
+ found=0
+ for j in $(echo ${ost_idx[@]}); do
+ if [ $index -eq $j ]; then
+ found=1
+ break
+ fi
+ done
+ [ $found = 1 ] ||
+ error "Can not find $index in ${ost_idx[@]}"
done
done
}
for ostnum in $(seq $OSTCOUNT); do
# test-framework's OST numbering is one-based, while Lustre's
# is zero-based
- ostname=$(printf "$FSNAME-OST%.4d" $((ostnum - 1)))
+ ostname=$(printf "$FSNAME-OST%.4x" $((ostnum - 1)))
# Parsing llobdstat's output sucks; we could grep the /proc
# path, but that's likely to not be as portable as using the
# llobdstat utility. So we parse lctl output instead.
# Total up write_bytes after writing. We'd better find non-zeros.
for ostnum in $(seq $OSTCOUNT); do
- ostname=$(printf "$FSNAME-OST%.4d" $((ostnum - 1)))
+ ostname=$(printf "$FSNAME-OST%.4x" $((ostnum - 1)))
write_bytes=$(do_facet ost$ostnum lctl get_param -n \
obdfilter/$ostname/stats |
awk '/^write_bytes/ {print $7}' )
if $all_zeros
then
for ostnum in $(seq $OSTCOUNT); do
- ostname=$(printf "$FSNAME-OST%.4d" $((ostnum - 1)))
+ ostname=$(printf "$FSNAME-OST%.4x" $((ostnum - 1)))
echo "Check that write_bytes is present in obdfilter/*/stats:"
do_facet ost$ostnum lctl get_param -n \
obdfilter/$ostname/stats