Whamcloud - gitweb
LU-10986 lfs: make lfs project tolerant errors
[fs/lustre-release.git] / lustre / tests / sanity-quota.sh
index ede0594..073a5af 100755 (executable)
@@ -3030,7 +3030,7 @@ test_55() {
 }
 run_test 55 "Chgrp should be affected by group quota"
 
 }
 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"
        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"
 
 }
 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"
 test_59() {
        if [ $(facet_fstype $SINGLEMDS) != ldiskfs ]; then
                skip "ldiskfs only test"