From 0db2896f2a3fbd9a471caf8640335906e940aa92 Mon Sep 17 00:00:00 2001 From: grev Date: Mon, 22 Oct 2007 23:04:24 +0000 Subject: [PATCH] b=13572 i=Adilger t-f wait_delete_complete() function; force test_79 to wait; quiet test_65l output. --- lustre/tests/sanity.sh | 5 ++++- lustre/tests/test-framework.sh | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 1fc08a5..ec4518c 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -2777,7 +2777,7 @@ run_test 65k "validate manual striping works properly with deactivated OSCs" test_65l() { # bug 12836 mkdir -p $DIR/$tdir/test_dir $LFS setstripe $DIR/$tdir/test_dir 65536 -1 -1 - $LFS find -mtime -1 $DIR/$tdir + $LFS find -mtime -1 $DIR/$tdir >/dev/null } run_test 65l "lfs find on -1 stripe dir ========================" @@ -3274,6 +3274,9 @@ run_test 78 "handle large O_DIRECT writes correctly ============" 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}' \ diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 37f50e5..17c1435 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -477,6 +477,24 @@ cleanup_check() { 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 -- 1.8.3.1