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
test_216() { # bug 20317
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
- remote_ost_nodsh && skip "remote OST with nodsh" && return
- local node
- local p="$TMP/sanityN-$TESTNAME.parameters"
- save_lustre_params $HOSTNAME "osc.*.contention_seconds" > $p
- for node in $(osts_nodes); do
- save_lustre_params $node "ldlm.namespaces.filter-*.max_nolock_bytes" >> $p
- save_lustre_params $node "ldlm.namespaces.filter-*.contended_locks" >> $p
- save_lustre_params $node "ldlm.namespaces.filter-*.contention_seconds" >> $p
- done
- clear_osc_stats
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
+
+ local node
+ local facets=$(get_facets OST)
+ local p="$TMP/$TESTSUITE-$TESTNAME.parameters"
+
+ save_lustre_params client "osc.*.contention_seconds" > $p
+ save_lustre_params $facets \
+ "ldlm.namespaces.filter-*.max_nolock_bytes" >> $p
+ save_lustre_params $facets \
+ "ldlm.namespaces.filter-*.contended_locks" >> $p
+ save_lustre_params $facets \
+ "ldlm.namespaces.filter-*.contention_seconds" >> $p
+ clear_osc_stats
# agressive lockless i/o settings
for node in $(osts_nodes); do