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}
FAIL_ON_ERROR=false
-check_runas_id_ret $TSTUSR $TSTUSR $RUNAS ||
- error "Please create user $TSTUSR($TSTID) and group $TSTUSR($TSTID)"
-check_runas_id_ret $TSTUSR2 $TSTUSR2 $RUNAS2 ||
- error "Please create user $TSTUSR2($TSTID2) and group $TSTUSR2($TSTID2)"
-
# clear quota limits for a user or a group
# usage: resetquota -u username
# resetquota -g groupname
}
enable_project_quota
+reset_quota_settings() {
+ resetquota -u $TSTUSR
+ resetquota -g $TSTUSR
+ resetquota -u $TSTUSR2
+ resetquota -g $TSTUSR2
+ resetquota -p $TSTPRJID
+}
+
# enable quota debug
quota_init() {
do_nodes $(comma_list $(nodes_list)) "lctl set_param debug=+quota"
}
quota_init
+reset_quota_settings
-resetquota -u $TSTUSR
-resetquota -g $TSTUSR
-resetquota -u $TSTUSR2
-resetquota -g $TSTUSR2
-resetquota -p $TSTPRJID
+check_runas_id_ret $TSTUSR $TSTUSR $RUNAS ||
+ error "Please create user $TSTUSR($TSTID) and group $TSTUSR($TSTID)"
+check_runas_id_ret $TSTUSR2 $TSTUSR2 $RUNAS2 ||
+ error "Please create user $TSTUSR2($TSTID2) and group $TSTUSR2($TSTID2)"
test_quota_performance() {
local TESTFILE="$DIR/$tdir/$tfile-0"
$LFS quota -v -g $TSTUSR2 $DIR
+ resetquota -g $TSTUSR2
cleanup_quota_test
}
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"
}
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"
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 &&
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)) ||
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)) &&
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)) ||
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)) &&
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)) ||
do_nodes $(comma_list $(nodes_list)) "lctl set_param debug=-quota"
disable_project_quota
}
+reset_quota_settings
quota_fini
cd $ORIG_PWD