From: tianzy Date: Fri, 23 Jan 2009 06:21:21 +0000 (+0000) Subject: Branch HEAD X-Git-Tag: v1_9_150~25 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=1e52179816a4ec586b02611a0d2d8bd5f47651a6;p=fs%2Flustre-release.git Branch HEAD fix the test issue of test_12 in sanity-quota.sh b=18151 i=johann i=panda --- diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 8e8a9a4..5e56c85 100644 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -121,22 +121,24 @@ set_file_unitsz() { lustre_fail() { local fail_node=$1 local fail_loc=$2 - - case $fail_node in - "mds" ) - do_facet $SINGLEMDS "lctl set_param fail_loc=$fail_loc" ;; - "ost" ) - for num in `seq $OSTCOUNT`; do - do_facet ost$num "lctl set_param fail_loc=$fail_loc" - done ;; - "mds_ost" ) - do_facet $SINGLEMDS "lctl set_param fail_loc=$fail_loc" ; - for num in `seq $OSTCOUNT`; do - do_facet ost$num "lctl set_param fail_loc=$fail_loc" - done ;; - * ) echo "usage: lustre_fail fail_node fail_loc" ; - return 1 ;; - esac + local fail_val=${3:-0} + + if [ $fail_node == "mds" ] || [ $fail_node == "mds_ost" ]; then + if [ $((fail_loc & 0x10000000)) -ne 0 -a $fail_val -gt 0 ] || \ + [ $((fail_loc)) -eq 0 ]; then + do_facet $SINGLEMDS "lctl set_param fail_val=$fail_val" + fi + do_facet $SINGLEMDS "lctl set_param fail_loc=$fail_loc" + fi + if [ $fail_node == "ost" ] || [ $fail_node == "mds_ost" ]; then + for num in `seq $OSTCOUNT`; do + if [ $((fail_loc & 0x10000000)) -ne 0 -a $fail_val -gt 0 ] || \ + [ $((fail_loc)) -eq 0 ]; then + do_facet ost$num "lctl set_param fail_val=$fail_val" + fi + do_facet ost$num "lctl set_param fail_loc=$fail_loc" + done + fi } RUNAS="runas -u $TSTID -g $TSTID" @@ -968,11 +970,6 @@ test_12() { [ "$(grep $DIR2 /proc/mounts)" ] || mount_client $DIR2 || \ { skip "Need lustre mounted on $MOUNT2 " && retutn 0; } - if [ $OSTCOUNT -lt 2 ]; then - skip "$OSTCOUNT < 2, too few osts" - return 0; - fi - LIMIT=$(( $BUNIT_SZ * $(($OSTCOUNT + 1)) * 10)) # 10 bunits each sever TESTFILE="$DIR/$tdir/$tfile-0" TESTFILE2="$DIR2/$tdir/$tfile-1" @@ -984,11 +981,12 @@ test_12() { $LFS setstripe $TESTFILE -i 0 -c 1 chown $TSTUSR.$TSTUSR $TESTFILE - $LFS setstripe $TESTFILE2 -i 1 -c 1 + $LFS setstripe $TESTFILE2 -i 0 -c 1 chown $TSTUSR2.$TSTUSR2 $TESTFILE2 #define OBD_FAIL_OST_HOLD_WRITE_RPC 0x21f - lustre_fail ost 0x0000021f + #define OBD_FAIL_SOME 0x10000000 /* fail N times */ + lustre_fail ost $((0x0000021f | 0x10000000)) 1 echo " step1: write out of block quota ..." $RUNAS2 dd if=/dev/zero of=$TESTFILE2 bs=$BLK_SZ count=102400 &