DIR=${DIR:-$MOUNT}
DIR2=${DIR2:-$MOUNT2}
+if [ ! -z "$(mounted_lustre_filesystems)" ]; then
+ log "set debug level as $PTLDEBUG"
+ do_nodes $(comma_list $(nodes_list)) "lctl set_param debug=$PTLDEBUG"
+fi
+
check_and_setup_lustre
if [ x"$(som_check)" = x"enabled" ]; then
build_test_filter
-eval ONLY_0=true
-eval ONLY_99=true
-
# set_blk_tunables(btune_sz)
set_blk_tunesz() {
local btune=$(($1 * BLK_SZ))
}
# set quota
-test_0() {
+quota_init() {
$LFS quotaoff -ug $DIR
$LFS quotacheck -ug $DIR
resetquota -u $TSTUSR
resetquota -g $TSTUSR
- lctl set_param debug="+quota"
- do_facet $SINGLEMDS "lctl set_param debug=+quota"
- for num in `seq $OSTCOUNT`; do
- do_facet ost$num "lctl set_param debug=+quota"
- done
+ do_nodes $(comma_list $(nodes_list)) "lctl set_param debug=+quota"
}
-run_test_with_stat 0 "Set quota ============================="
+quota_init
# test for specific quota limitation, qunit, qtune $1=block_quota_limit
test_1_sub() {
# reboot the lustre
sync; sleep 5; sync
cleanup_and_setup_lustre
- test_0
+ quota_init
mkdir -p $DIR/$tdir
run_test_with_stat 21 "run for fixing bug16053 ==========="
test_22() {
- quota_save_version "ug"
+ quota_save_version "ug3"
stopall
mount
echo "checking parameters"
- do_facet $SINGLEMDS "lctl get_param mdd.${FSNAME}-MDT*.quota_type" | grep "ug" || error "admin failure"
- do_facet ost1 "lctl get_param obdfilter.*.quota_type" | grep "ug" || error "op failure"
+ do_facet $SINGLEMDS "lctl get_param mdd.${FSNAME}-MDT*.quota_type" | grep "ug3" || error "admin failure"
+ do_facet ost1 "lctl get_param obdfilter.*.quota_type" | grep "ug3" || error "op failure"
- run_test 0 "reboot lustre"
+ quota_init
}
run_test_with_stat 22 "test if quota_type saved as permanent parameter ===="
}
run_test_with_stat 27 "lfs quota/setquota should handle wrong arguments (19612) ================="
+test_28() {
+ BLK_LIMIT=$((100 * 1024 * 1024)) # 100G
+ echo "Step 1: set enough high limit for user [$TSTUSR:$BLK_LIMIT]"
+ $LFS setquota -u $TSTUSR -b 0 -B $BLK_LIMIT -i 0 -I 0 $DIR
+ $SHOW_QUOTA_USER
+
+ echo "Step 2: reset system ..."
+ cleanup_and_setup_lustre
+ test_0
+
+ echo "Step 3: change qunit for user [$TSTUSR:512:1024]"
+ set_blk_tunesz 512
+ set_blk_unitsz 1024
+
+ wait_delete_completed
+
+ #define OBD_FAIL_QUOTA_RET_QDATA | OBD_FAIL_ONCE
+ lustre_fail ost 0x80000A02
+
+ TESTFILE="$DIR/$tdir/$tfile"
+ mkdir -p $DIR/$tdir
+
+ BLK_LIMIT=$((100 * 1024)) # 100M
+ echo "Step 4: set enough high limit for user [$TSTUSR:$BLK_LIMIT]"
+ $LFS setquota -u $TSTUSR -b 0 -B $BLK_LIMIT -i 0 -I 0 $DIR
+ $SHOW_QUOTA_USER
+
+ touch $TESTFILE
+ chown $TSTUSR.$TSTUSR $TESTFILE
+
+ echo "Step 5: write the test file1 [10M] ..."
+ $RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ count=$(( 10 * 1024 )) \
+ || quota_error a $TSTUSR "write 10M file failure"
+ $SHOW_QUOTA_USER
+
+ rm -f $TESTFILE
+ sync; sleep 3; sync;
+
+ # make qd_count 64 bit
+ lustre_fail ost 0
+
+ set_blk_unitsz $((128 * 1024))
+ set_blk_tunesz $((128 * 1024 / 2))
+
+ resetquota -u $TSTUSR
+}
+run_test_with_stat 28 "test for consistency for qunit when setquota (18574) ==========="
+
# turn off quota
-test_99()
+quota_fini()
{
$LFS quotaoff $DIR
- lctl set_param debug="-quota"
-
- return 0
+ do_nodes $(comma_list $(nodes_list)) "lctl set_param debug=+quota"
}
-run_test_with_stat 99 "Quota off ==============================="
-
+quota_fini
log "cleanup: ======================================================"
cd $ORIG_PWD