declare ha_test_dir_mdt_index=${TDMDTINDEX:-"0"}
declare ha_test_dir_mdt_index_random=${TDMDTINDEXRAND:-false}
declare ha_dir_stripe_count=${DSTRIPECOUNT:-"1"}
+declare ha_dir_stripe_count_random=${DSTRIPECOUNTRAND:-false}
declare ha_mdt_index=${MDTINDEX:-"0"}
declare ha_mdt_index_random=${MDTINDEXRAND:-false}
declare -a ha_clients
[iozone]="iozone -a -e -+d -s $iozone_SIZE {}/f.iozone"
[racer]="$ha_racer_params $racer {}"
)
+declare ha_check_attrs="find {} -type f -ls 2>&1 | grep -e '?'"
ha_usage()
{
local dir=$test_dir/$client-$tag
local log=$ha_tmp_dir/$client-$tag
local rc=0
+ local rccheck=0
local nr_loops=0
local avg_loop_time=0
local start_time=$(date +%s)
+ local check_attrs=${ha_check_attrs//"{}"/$dir}
cmd=${cmd//"{}"/$dir}
cmd=${cmd//"{params}"/$parameter}
ha_info "Starting $tag"
machines="-machinefile $machines"
- while [ ! -e "$ha_stop_file" ] && ((rc == 0)); do
+ while [ ! -e "$ha_stop_file" ] && ((rc == 0)) && ((rccheck == 0)); do
ha_info "$client Starts: $mpiuser: $cmd" 2>&1 | tee -a $log
{
local mdt_index
if $ha_mdt_index_random && [ $ha_mdt_index -ne 0 ]; then
- mdt_index=$(ha_rand $ha_mdt_index)
+ mdt_index=$(ha_rand $((ha_mdt_index + 1)) )
else
mdt_index=$ha_mdt_index
fi
+ local dir_stripe_count
+ if $ha_dir_stripe_count_random &&
+ [ $ha_dir_stripe_count -ne 1 ]; then
+ dir_stripe_count=$(($(ha_rand $ha_dir_stripe_count) + 1))
+ else
+ dir_stripe_count=$ha_dir_stripe_count
+ fi
[[ -n "$ha_precmd" ]] && ha_info "$ha_precmd" &&
ha_on $client "$ha_precmd" >>"$log" 2>&1
- ha_on $client $LFS mkdir -i$mdt_index -c$ha_dir_stripe_count "$dir" &&
+ ha_info "$client Creates $dir with -i$mdt_index -c$dir_stripe_count "
+ ha_on $client $LFS mkdir -i$mdt_index -c$dir_stripe_count "$dir" &&
ha_on $client $LFS getdirstripe "$dir" &&
ha_on $client $LFS setstripe $stripeparams $dir &&
ha_on $client $LFS getstripe $dir &&
ha_on $client chmod a+xwr $dir &&
- ha_on $client "su $mpiuser sh -c \" $mpirun $mpirunoptions \
+ ha_on $client "su $mpiuser bash -c \" $mpirun $mpirunoptions \
-np $((${#ha_clients[@]} * mpi_threads_per_client / ha_nclientsset)) \
$machines $cmd \" " || rc=$?
+ ha_on ${ha_clients[0]} "$check_attrs && \
+ $LFS df $dir && \
+ $check_attrs " && rccheck=1
[[ -n "$ha_postcmd" ]] && ha_info "$ha_postcmd" &&
ha_on $client "$ha_postcmd" >>"$log" 2>&1
- (( ((rc == 0)) && (( mustpass != 0 )) )) ||
- (( ((rc != 0)) && (( mustpass == 0 )) )) &&
- ha_on $client rm -rf "$dir";
- } >>"$log" 2>&1 || rc=$?
+ (( ((rc == 0)) && ((rccheck == 0)) && (( mustpass != 0 )) )) ||
+ (( ((rc != 0)) && ((rccheck == 0)) && (( mustpass == 0 )) )) &&
+ ha_on $client rm -rf "$dir";
+ } >>"$log" 2>&1
- ha_info $client: rc=$rc mustpass=$mustpass
+ ha_info $client: rc=$rc rccheck=$rccheck mustpass=$mustpass
# mustpass=0 means that failure is expected
- if (( rc !=0 )); then
+ if (( rccheck != 0 )); then
+ ha_touch stop,fail $client,$tag
+ ha_dump_logs "${ha_clients[*]} ${ha_servers[*]}"
+ elif (( rc !=0 )); then
if (( mustpass != 0 )); then
ha_touch stop,fail $client,$tag
ha_dump_logs "${ha_clients[*]} ${ha_servers[*]}"
ha_touch stop,fail $client,$tag
ha_dump_logs "${ha_clients[*]} ${ha_servers[*]}"
fi
- echo rc=$rc mustpass=$mustpass >"$status"
+ echo rc=$rc rccheck=$rccheck mustpass=$mustpass >"$status"
nr_loops=$((nr_loops + 1))
done
local dir=$test_dir/$client-$tag
local log=$ha_tmp_dir/$client-$tag
local rc=0
+
+ local rccheck=0
local nr_loops=0
local avg_loop_time=0
local start_time=$(date +%s)
+ local check_attrs=${ha_check_attrs//"{}"/$dir}
cmd=${cmd//"{}"/$dir}
while [ ! -e "$ha_stop_file" ] && ((rc == 0)); do
ha_info "$client Starts: $cmd" 2>&1 | tee -a $log
ha_on $client "mkdir -p $dir && \
- $cmd && \
- rm -rf $dir" >>"$log" 2>&1 || rc=$?
+ $cmd" >>"$log" 2>&1 || rc=$?
+
+ ha_on $client "$check_attrs && \
+ $LFS df $dir && \
+ $check_attrs " >>"$log" 2>&1 && rccheck=1 ||
+ ha_on $client "rm -rf $dir" >>"$log" 2>&1
+
+ ha_info rc=$rc rccheck=$rccheck
- if ((rc != 0)); then
+ if (( (rc + rccheck) != 0 )); then
ha_dump_logs "${ha_clients[*]} ${ha_servers[*]}"
ha_touch stop,fail $client,$tag
fi
local mdt_index
if $ha_test_dir_mdt_index_random &&
[ $ha_test_dir_mdt_index -ne 0 ]; then
- mdt_index=$(ha_rand $ha_test_dir_mdt_index)
+ mdt_index=$(ha_rand $((ha_test_dir_mdt_index + 1)) )
else
mdt_index=$ha_test_dir_mdt_index
fi