i=Adilger
t-f wait_delete_complete() function; force test_79 to wait;
quiet test_65l output.
test_65l() { # bug 12836
mkdir -p $DIR/$tdir
$LFS setstripe $DIR/$tdir 65536 -1 -1
- $LFS find -mtime -1 $DIR
+ $LFS find -mtime -1 $DIR >/dev/null
}
run_test 65l "lfs find on -1 stripe dir ========================"
test_79() { # bug 12743
[ $(grep -c obdfilter $LPROC/devices) -eq 0 ] &&
skip "skipping test for remote OST" && return
+
+ wait_delete_completed
+
BKTOTAL=`awk 'BEGIN{total=0}; {total+=$1}; END{print total}' \
$LPROC/obdfilter/*/kbytestotal`
BKFREE=`awk 'BEGIN{free=0}; {free+=$1}; END{print free}' \
return 0
}
+wait_delete_completed () {
+ local TOTALPREV=`awk 'BEGIN{total=0}; {total+=$1}; END{print total}' \
+ $LPROC/osc/*/kbytesavail`
+
+ local WAIT=0
+ local MAX_WAIT=20
+ while [ "$WAIT" -ne "$MAX_WAIT" ]; do
+ sleep 1
+ TOTAL=`awk 'BEGIN{total=0}; {total+=$1}; END{print total}' \
+ $LPROC/osc/*/kbytesavail`
+ [ "$TOTAL" -eq "$TOTALPREV" ] && break
+ echo "Waiting delete completed ... prev: $TOTALPREV current: $TOTAL "
+ TOTALPREV=$TOTAL
+ WAIT=$(( WAIT + 1))
+ done
+ echo "Delete completed."
+}
+
wait_for_host() {
HOST=$1
check_network "$HOST" 900