Whamcloud - gitweb
LU-11141 tests: put sanity-quota 61 on slow list
[fs/lustre-release.git] / lustre / tests / sanity-quota.sh
index ede0594..9bb04f9 100755 (executable)
@@ -47,17 +47,17 @@ if [ $(facet_fstype $SINGLEMDS) == ldiskfs ] &&
        skip_env "e2fsprogs doesn't support quota" && exit 0
 fi
 
+# Test duration:                   30 min
+[ "$SLOW" = "no" ] && EXCEPT_SLOW="61"
+
 if [ $(facet_fstype $SINGLEMDS) = "zfs" ]; then
-# bug number for skipped test:        LU-2836 LU-6836 LU-2836
-       ALWAYS_EXCEPT="$ALWAYS_EXCEPT 3       4a      6"
-# bug number for skipped test:        LU-5638
-       ALWAYS_EXCEPT="$ALWAYS_EXCEPT 11 33"
-# bug number:     LU-2887
-       #         21  9   (min)"
-       ZFS_SLOW="12a 9"
-fi
+       # bug number for skipped test: LU-2836 LU-6836 LU-2836
+       ALWAYS_EXCEPT="$ALWAYS_EXCEPT  3       4a      6"
 
-[ "$SLOW" = "no" ] && EXCEPT_SLOW="$ZFS_SLOW"
+       # bug number:                        LU-2887
+       # Test duration:                     21      9 min"
+       [ "$SLOW" = "no" ] && EXCEPT_SLOW+=" 12a     9"
+fi
 
 QUOTALOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
 
@@ -3030,7 +3030,7 @@ test_55() {
 }
 run_test 55 "Chgrp should be affected by group quota"
 
-test_56 () {
+test_56() {
        setup_quota_test || error "setup quota failed with $?"
 
        set_ost_qtype $QTYPE || error "enable ost quota failed"
@@ -3049,6 +3049,27 @@ test_56 () {
 }
 run_test 56 "lfs quota -t should work well"
 
+test_57() {
+       setup_quota_test || error "setup quota failed with $?"
+
+       local dir="$DIR/$tdir/dir"
+       mkdir -p $dir
+       mkfifo $dir/pipe
+       #try to change pipe file should not hang and return failure
+       wait_update_facet client "$LFS project -sp 1 $dir/pipe 2>&1 |
+               awk -F ':' '{ print \\\$2 }'" \
+                       " failed to get xattr for '$dir/pipe'" || return 1
+       #command can process further if it hit some errors
+       touch $dir/aaa $dir/bbb
+       #create one invalid link file
+       ln -s $dir/not_exist_file $dir/ccc
+       local cnt=$(lfs project -r $dir 2>/dev/null | wc -l)
+       [ $cnt -eq 2 ] || error "expected 2 got $cnt"
+
+       cleanup_quota_test
+}
+run_test 57 "lfs project could tolerate errors"
+
 test_59() {
        if [ $(facet_fstype $SINGLEMDS) != ldiskfs ]; then
                skip "ldiskfs only test"
@@ -3107,7 +3128,7 @@ test_default_quota() {
        local qdtype="-U"
        local qs="-b"
        local qh="-B"
-       local LIMIT=102400 #100M disk space
+       local LIMIT=20480 #20M disk space
        local TESTFILE="$DIR/$tdir/$tfile-0"
 
        [ $qtype == "-p" ] && ! is_project_quota_supported &&
@@ -3169,7 +3190,7 @@ test_default_quota() {
 
        log "Test not out of quota"
        if [ $qpool == "data" ]; then
-               $RUNAS $DD of=$TESTFILE count=$((LIMIT/2 >> 10)) ||
+               $RUNAS $DD of=$TESTFILE count=$((LIMIT/2 >> 10)) oflag=sync ||
                        quota_error $qtype $qid "write failed, expect succeed"
        else
                $RUNAS createmany -m $TESTFILE $((LIMIT/2)) ||
@@ -3184,7 +3205,7 @@ test_default_quota() {
        cancel_lru_locks mdc
        sync; sync_all_data || true
        if [ $qpool == "data" ]; then
-               $RUNAS $DD of=$TESTFILE count=$((LIMIT*2 >> 10)) &&
+               $RUNAS $DD of=$TESTFILE count=$((LIMIT*2 >> 10)) oflag=sync &&
                        quota_error $qtype $qid "write succeed, expect EDQUOT"
        else
                $RUNAS createmany -m $TESTFILE $((LIMIT*2)) &&
@@ -3202,7 +3223,7 @@ test_default_quota() {
        cancel_lru_locks mdc
        sync; sync_all_data || true
        if [ $qpool == "data" ]; then
-               $RUNAS $DD of=$TESTFILE count=$((LIMIT*2 >> 10)) ||
+               $RUNAS $DD of=$TESTFILE count=$((LIMIT*2 >> 10)) oflag=sync ||
                        quota_error $qtype $qid "write failed, expect succeed"
        else
                $RUNAS createmany -m $TESTFILE $((LIMIT*2)) ||
@@ -3219,7 +3240,7 @@ test_default_quota() {
        cancel_lru_locks mdc
        sync; sync_all_data || true
        if [ $qpool == "data" ]; then
-               $RUNAS $DD of=$TESTFILE count=$((LIMIT*2 >> 10)) &&
+               $RUNAS $DD of=$TESTFILE count=$((LIMIT*2 >> 10)) oflag=sync &&
                        quota_error $qtype $qid "write succeed, expect EQUOT"
        else
                $RUNAS createmany -m $TESTFILE $((LIMIT*2)) &&
@@ -3236,7 +3257,7 @@ test_default_quota() {
        cancel_lru_locks mdc
        sync; sync_all_data || true
        if [ $qpool == "data" ]; then
-               $RUNAS $DD of=$TESTFILE count=$((LIMIT*2 >> 10)) ||
+               $RUNAS $DD of=$TESTFILE count=$((LIMIT*2 >> 10)) oflag=sync ||
                        quota_error $qtype $qid "write failed, expect succeed"
        else
                $RUNAS createmany -m $TESTFILE $((LIMIT*2)) ||