From cc5910720e0f6889febc8dcaf1749a53fed97f1e Mon Sep 17 00:00:00 2001 From: fanyong Date: Thu, 29 Oct 2009 02:00:48 +0000 Subject: [PATCH] Branch HEAD b=20984 i=robert.read i=tom.wang 1) increase sleep interval for "sleep_maxage()". 2) use "O_LOV_DELAY_CREATE" mode when create in "get_mds_dir()" to detect MDT index,to avoid unnecessary "enospc" error. 3) only obtain the first line if the output contain many OSTs result. 4) other fixes from b1_8. --- lustre/tests/sanity.sh | 20 ++++++++++---------- lustre/tests/test-framework.sh | 3 ++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 3565ad2..e934910 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -984,7 +984,7 @@ test_27m() { run_test 27m "create file while OST0 was full ==================" sleep_maxage() { - local DELAY=$(do_facet mds lctl get_param -n lov.*.qos_maxage | awk '{print $1 + 2}') + local DELAY=$(do_facet mds lctl get_param -n lov.*.qos_maxage | head -n 1 | awk '{print $1 + 5}') sleep $DELAY } @@ -1015,16 +1015,15 @@ exhaust_precreations() { local last_id=$(do_facet mds${MDSIDX} lctl get_param -n osc.*${OST}-osc-${MDT_INDEX}.prealloc_last_id) local next_id=$(do_facet mds${MDSIDX} lctl get_param -n osc.*${OST}-osc-${MDT_INDEX}.prealloc_next_id) - echo ${OST}-osc-${MDT_INDEX}.prealloc_last_id=$last_id - echo ${OST}-osc-${MDT_INDEX}.prealloc_next_id=$next_id + do_facet mds${MDSIDX} lctl get_param osc.*OST*-osc-${MDT_INDEX}.prealloc* - mkdir -p $DIR/d27 - $SETSTRIPE $DIR/d27 -i $OSTIDX -c 1 + mkdir -p $DIR/d27/${OST} + $SETSTRIPE $DIR/d27/${OST} -i $OSTIDX -c 1 #define OBD_FAIL_OST_ENOSPC 0x215 do_facet ost$((OSTIDX + 1)) lctl set_param fail_loc=0x215 echo "Creating to objid $last_id on ost $OST..." - createmany -o $DIR/d27/${OST}-f $next_id $((last_id - next_id + 2)) - do_facet mds${MDSIDX} lctl get_param osc.*${OST}-osc-${MDT_INDEX}.prealloc* | grep '[0-9]' + createmany -o $DIR/d27/${OST}/f $next_id $((last_id - next_id + 2)) + do_facet mds${MDSIDX} lctl get_param osc.*OST*-osc-${MDT_INDEX}.prealloc* reset_enospc $2 $OSTIDX } @@ -1083,6 +1082,7 @@ test_27p() { exhaust_precreations 0 0x80000215 echo foo >> $DIR/d27/f27p || error "append failed" $CHECKSTAT -s 80000004 $DIR/d27/f27p || error "checkstat failed" + $LFS getstripe $DIR/d27/f27p reset_enospc } @@ -1195,15 +1195,15 @@ run_test 27v "skip object creation on slow OST =================" test_27w() { # bug 10997 mkdir -p $DIR/d27w || error "mkdir failed" $LSTRIPE $DIR/d27w/f0 -s 65536 || error "lstripe failed" - size=`$GETSTRIPE $DIR/d27w/f0 -qs` + size=`$GETSTRIPE $DIR/d27w/f0 -qs | head -n 1` [ $size -ne 65536 ] && error "stripe size $size != 65536" || true [ "$OSTCOUNT" -lt "2" ] && skip_env "skipping multiple stripe count/offset test" && return for i in `seq 1 $OSTCOUNT`; do offset=$(($i-1)) $LSTRIPE $DIR/d27w/f$i -c $i -i $offset || error "lstripe -c $i -i $offset failed" - count=`$GETSTRIPE -qc $DIR/d27w/f$i` - index=`$GETSTRIPE -qo $DIR/d27w/f$i` + count=`$GETSTRIPE -qc $DIR/d27w/f$i | head -n 1` + index=`$GETSTRIPE -qo $DIR/d27w/f$i | head -n 1` [ $count -ne $i ] && error "stripe count $count != $i" || true [ $index -ne $offset ] && error "stripe offset $index != $offset" || true done diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index aa76cc4..c86fab9 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -2936,12 +2936,13 @@ get_mds_dir () { local dir=$1 local file=$dir/f0.get_mds_dir_tmpfile + mkdir -p $dir rm -f $file sleep 1 local iused=$(lfs df -i $dir | grep MDT | awk '{print $3}') local -a oldused=($iused) - touch $file + openfile -f O_CREAT:O_LOV_DELAY_CREATE -m 0644 $file > /dev/null sleep 1 iused=$(lfs df -i $dir | grep MDT | awk '{print $3}') local -a newused=($iused) -- 1.8.3.1