From 4968e8b7d64a3081d4ba35187b86b781199f5ef9 Mon Sep 17 00:00:00 2001 From: grev Date: Fri, 27 Feb 2009 00:36:30 +0000 Subject: [PATCH] b=17524 i=Adilger exhaust_precreations, reset_enospc, test_27n, test_27s fixes --- lustre/tests/sanity.sh | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index fadbbf8..244e407 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -796,6 +796,7 @@ run_test 26f "rm -r of a directory which has recursive symlink =" test_27a() { echo '== stripe sanity ==============================================' mkdir -p $DIR/d27 || error "mkdir failed" + $GETSTRIPE $DIR/d27 $SETSTRIPE $DIR/d27/f0 -c 1 || error "lstripe failed" $CHECKSTAT -t file $DIR/d27/f0 || error "checkstat failed" pass @@ -910,21 +911,28 @@ run_test 27m "create file while OST0 was full ==================" # osc's keep a NOSPC stick flag that gets unset with rmdir reset_enospc() { - [ "$1" ] && FAIL_LOC=$1 || FAIL_LOC=0 + local FAIL_LOC=${1:-0} + local OSTIDX=${2:-""} + mkdir -p $DIR/d27/nospc rmdir $DIR/d27/nospc - do_nodes $(comma_list $(osts_nodes)) lctl set_param fail_loc=$FAIL_LOC + local list=$(comma_list $(osts_nodes)) + [ "$OSTIDX" ] && \ + { var=ost$((OSTIDX + 1))_HOST && list=${!var}; } + + do_nodes $list lctl set_param fail_loc=$FAIL_LOC } exhaust_precreations() { - OSTIDX=$1 + local OSTIDX=$1 + + local OST=$(lfs osts | grep ${OSTIDX}": " | \ + awk '{print $2}' | sed -e 's/_UUID$//') - OST=$(lfs osts | grep ${OSTIDX}": " | \ - awk '{print $2}' | sed -e 's/_UUID$//') # on the mdt's osc local mdtosc=$(get_mdtosc_proc_path $OST) - last_id=$(do_facet mds lctl get_param -n osc.$mdtosc.prealloc_last_id) - next_id=$(do_facet mds lctl get_param -n osc.$mdtosc.prealloc_next_id) + local last_id=$(do_facet mds lctl get_param -n osc.$mdtosc.prealloc_last_id) + local next_id=$(do_facet mds lctl get_param -n osc.$mdtosc.prealloc_next_id) mkdir -p $DIR/d27/${OST} $SETSTRIPE $DIR/d27/${OST} -i $OSTIDX -c 1 @@ -933,7 +941,7 @@ exhaust_precreations() { 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 "lctl get_param -n osc.$mdtosc.prealloc*" | grep '[0-9]' - reset_enospc $2 + reset_enospc $2 $OSTIDX } exhaust_all_precreations() { @@ -951,6 +959,7 @@ test_27n() { reset_enospc rm -f $DIR/d27/f27n + $SETSTRIPE $DIR/d27 -c 1 -i -1 exhaust_precreations 0 0x80000215 touch $DIR/d27/f27n || error @@ -1033,7 +1042,10 @@ run_test 27r "stripe file with some full OSTs (shouldn't LBUG) =" test_27s() { # bug 10725 mkdir -p $DIR/$tdir - $SETSTRIPE $DIR/$tdir $((4096 * 1024 * 1024)) -1 2 && \ + local stripe_size=$((4096 * 1024 * 1024)) # 2^32 + local stripe_count=0 + [ $OSTCOUNT -eq 1 ] || stripe_count=2 + $SETSTRIPE $DIR/$tdir -s $stripe_size -c $stripe_count && \ error "stripe width >= 2^32 succeeded" || true } run_test 27s "lsm_xfersize overflow (should error) (bug 10725)" @@ -1080,15 +1092,17 @@ test_27v() { # bug 4900 touch $DIR/$tdir/$tfile #define OBD_FAIL_TGT_DELAY_PRECREATE 0x705 - lctl set_param fail_loc=0x705 - START=`date +%s` - for F in `seq 1 32`; do - touch $DIR/$tdir/$tfile.$F + # all except ost1 + for (( i=0; i < OSTCOUNT; i++ )) ; do + do_facet ost$i lctl set_param fail_loc=0x705 done - lctl set_param fail_loc=0 + local START=`date +%s` + createmany -o $DIR/$tdir/$tfile 32 + + reset_enospc - FINISH=`date +%s` - TIMEOUT=`lctl get_param -n timeout` + local FINISH=`date +%s` + local TIMEOUT=`lctl get_param -n timeout` [ $((FINISH - START)) -ge $((TIMEOUT / 2)) ] && \ error "$FINISH - $START >= $TIMEOUT / 2" -- 1.8.3.1