SRCDIR=`dirname $0`
export PATH=$PWD/$SRCDIR:$SRCDIR:$PWD/$SRCDIR/../utils:$PATH:/sbin
-# only accounting tests are supported for the time being
-ONLY="33 34 35"
-
ONLY=${ONLY:-"$*"}
ALWAYS_EXCEPT="$SANITY_QUOTA_EXCEPT"
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
build_test_filter
-# Use OFD for all quota testing
-cleanupall
-USE_OFD_OLD="$USE_OFD"
-LOAD_MODULES_REMOTE_OLD="$LOAD_MODULES_REMOTE"
-export USE_OFD="yes"
-export LOAD_MODULES_REMOTE="true"
-setupall
-
lustre_fail() {
local fail_node=$1
local fail_loc=$2
rm -rf $DIR/$tdir
echo "Wait for unlink objects finished..."
wait_delete_completed
- sync_all_data
+ sync_all_data || true
}
quota_show_check() {
fi
}
-# enalbe quota debug
+# enable quota debug
quota_init() {
do_nodes $(comma_list $(nodes_list)) "lctl set_param debug=+quota"
}
rm -f $TESTFILE
wait_delete_completed
- sync_all_data
+ sync_all_data || true
USED=$(getquota -u $TSTUSR global curspace)
[ $USED -ne 0 ] && quota_error u $TSTUSR \
"user quota isn't released after deletion"
echo "Unlink file to stop timer"
rm -f $TESTFILE
wait_delete_completed
- sync_all_data
+ sync_all_data || true
$SHOW_QUOTA_USER
$SHOW_QUOTA_GROUP
$RUNAS2 $DD of=$TESTFILE2 count=1 ||
error "write $TESTFILE2 failure, expect success"
sync; sync
- sync_all_data
-
- # set a small timeout value, to make the quota RPC timedout before
- # the watchdog triggered.
- local timeout
- if at_is_enabled; then
- timeout=$(at_max_get ost)
- at_max_set 20 ost
- else
- timeout=$(do_facet ost1 $LCTL get_param -n timeout)
- do_facet ost1 $LCTL set_param timeout=20
- fi
+ sync_all_data || true
#define QUOTA_DQACQ 601
#define OBD_FAIL_PTLRPC_DROP_REQ_OPC 0x513
$RUNAS $DD of=$TESTFILE count=2 seek=1 oflag=sync conv=notrunc &
DDPID=$!
- echo "Sleep for $timeout"
- sleep $timeout
+ echo "Sleep for $TIMEOUT"
+ sleep $TIMEOUT
# write should be blocked and never finished
if ! ps -p $DDPID > /dev/null 2>&1; then
error "write finished incorrectly!"
fi
- if at_is_enabled; then
- at_max_set $timeout ost
- else
- do_facet ost1 $LCTL set_param timeout=$timeout
- fi
-
lustre_fail mds 0 0
# no watchdog is triggered
echo "Free space from ost0..."
rm -f $TESTFILE0
wait_delete_completed
- sync_all_data
+ sync_all_data || true
echo "Write to ost1 after space freed from ost0..."
$RUNAS $DD of=$TESTFILE1 count=$blk_cnt oflag=sync ||
local LIMIT=$((24 * 1024 * 1024 * 1024 * 1024)) # 24 TB
wait_delete_completed
- sync_all_data
+ sync_all_data || true
# test for user
$LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $DIR
sleep 1
done
- sync; sync_all_data
+ sync; sync_all_data || true
USED=$(getquota -u $TSTUSR global curspace)
[ $USED -ge $(($BLKS * 1024)) ] || quota_error u $TSTUSR \
runas -u 0 -g 0 $DD of=$TESTFILE count=$((blimit + 1)) ||
error "write failure, expect success"
cancel_lru_locks osc
- sync_all_data
+ sync_all_data || true
$SHOW_QUOTA_USER | grep '*' || error "no matching *"
echo "Iteration $i/$INODES completed"
done
cancel_lru_locks osc
- sync; sync_all_data
+ sync; sync_all_data || true
echo "Verify disk usage after write"
USED=$(getquota -u $TSTID global curspace)
$DD of=$DIR/$tdir/$tfile count=$BLK_CNT 2>/dev/null ||
error "write failed"
cancel_lru_locks osc
- sync; sync_all_data
+ sync; sync_all_data || true
echo "chown the file to user $TSTID"
chown $TSTID $DIR/$tdir/$tfile || error "chown failed"
$RUNAS $DD of=$DIR/$tdir/$tfile count=$BLK_CNT 2>/dev/null ||
error "write failed"
cancel_lru_locks osc
- sync; sync_all_data
+ sync; sync_all_data || true
echo "Save disk usage before restart"
local ORIG_USR_SPACE=$(getquota -u $TSTID global curspace)
$RUNAS $DD of=$DIR/$tdir/$tfile count=$BLK_CNT seek=1 2>/dev/null ||
error "write failed"
cancel_lru_locks osc
- sync; sync_all_data
+ sync; sync_all_data || true
echo "Verify space usage is increased"
USED=$(getquota -u $TSTID global curspace)
echo "Copy admin quota files into MDT0..."
local mntpt=$(facet_mntpt $SINGLEMDS)
local mdt0_fstype=$(facet_fstype $SINGLEMDS)
- echo "$mdt0_node, $mdt0_dev, $mntpt"
- do_node $mdt0_node mount -t $mdt0_fstype $MDS_MOUNT_OPTS $mdt0_dev $mntpt
+ local opt
+ if ! do_node $mdt0_node test -b $mdt0_fstype; then
+ opt="-o loop"
+ fi
+ echo "$mdt0_node, $mdt0_dev, $mntpt, $opt"
+ do_node $mdt0_node mount -t $mdt0_fstype $opt $mdt0_dev $mntpt
do_node $mdt0_node mkdir $mntpt/OBJECTS
do_node $mdt0_node cp $LUSTRE/tests/admin_quotafile_v2.usr $mntpt/OBJECTS
do_node $mdt0_node cp $LUSTRE/tests/admin_quotafile_v2.grp $mntpt/OBJECTS
local proc="qmt.*.md-0x0.glb-usr"
id_cnt=$(do_node $mdt0_node $LCTL get_param -n $proc | wc -l)
- [ $id_cnt -eq 201 ] || error "Migrate inode user limit failed"
+ [ $id_cnt -eq 401 ] || error "Migrate inode user limit failed: $id_cnt"
limit=$(getquota -u 1 global isoftlimit)
[ $limit -eq 1024 ] || error "User inode softlimit: $limit"
limit=$(getquota -u 1 global ihardlimit)
proc="qmt.*.md-0x0.glb-grp"
id_cnt=$(do_node $mdt0_node $LCTL get_param -n $proc | wc -l)
- [ $id_cnt -eq 201 ] || error "Migrate inode group limit failed"
+ [ $id_cnt -eq 401 ] || error "Migrate inode group limit failed: $id_cnt"
limit=$(getquota -g 1 global isoftlimit)
[ $limit -eq 1024 ] || error "Group inode softlimit: $limit"
limit=$(getquota -g 1 global ihardlimit)
proc=" qmt.*.dt-0x0.glb-usr"
id_cnt=$(do_node $mdt0_node $LCTL get_param -n $proc | wc -l)
- [ $id_cnt -eq 201 ] || error "Migrate block user limit failed"
+ [ $id_cnt -eq 401 ] || error "Migrate block user limit failed: $id_cnt"
limit=$(getquota -u 60001 global bsoftlimit)
[ $limit -eq 10485760 ] || error "User block softlimit: $limit"
limit=$(getquota -u 60001 global bhardlimit)
proc="qmt.*.dt-0x0.glb-grp"
id_cnt=$(do_node $mdt0_node $LCTL get_param -n $proc | wc -l)
- [ $id_cnt -eq 201 ] || error "Migrate block user limit failed"
+ [ $id_cnt -eq 401 ] || error "Migrate block user limit failed: $id_cnt"
limit=$(getquota -g 60001 global bsoftlimit)
[ $limit -eq 10485760 ] || error "Group block softlimit: $limit"
limit=$(getquota -g 60001 global bhardlimit)
cd $ORIG_PWD
complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-export USE_OFD="$USE_OFD_OLD"
-export LOAD_MODULES_REMOTE="$LOAD_MODULES_REMOTE_OLD"
export QUOTA_AUTO=$QUOTA_AUTO_OLD
exit_status