Whamcloud - gitweb
LU-6155 osd-zfs: dbuf_hold_impl() called without the lock
[fs/lustre-release.git] / lustre / tests / sanity-quota.sh
index 2b16a2b..f8d7413 100644 (file)
@@ -51,8 +51,10 @@ if [ $(facet_fstype $SINGLEMDS) == ldiskfs ] &&
 fi
 
 if [ $(facet_fstype $SINGLEMDS) = "zfs" ]; then
-# bug number for skipped test:        LU-2836 LU-2836 LU-2059
-       ALWAYS_EXCEPT="$ALWAYS_EXCEPT 3       6       7d"
+# bug number for skipped test:        LU-2836 LU-6836 LU-2836 LU-2059
+       ALWAYS_EXCEPT="$ALWAYS_EXCEPT 3       4a      6       7d"
+# bug number for skipped test:        LU-5638
+       ALWAYS_EXCEPT="$ALWAYS_EXCEPT 11 33 34 35"
 # bug number:     LU-2887
        ZFS_SLOW="12a"
 fi
@@ -678,7 +680,8 @@ run_test 3 "Block soft limit (start timer, timer goes off, stop timer)"
 test_file_soft() {
        local TESTFILE=$1
        local LIMIT=$2
-       local TIMER=$(($3 * 3 / 2))
+       local grace=$3
+       local TIMER=$(($grace * 3 / 2))
 
        setup_quota_test
        trap cleanup_quota_test EXIT
@@ -686,13 +689,19 @@ test_file_soft() {
        echo "Create files to exceed soft limit"
        $RUNAS createmany -m ${TESTFILE}_ $((LIMIT + 1)) ||
                quota_error a $TSTUSR "create failure, but expect success"
-       sync; sleep 1; sync
+       local trigger_time=$(date +%s)
+
+       sync_all_data || true
+
+       local cur_time=$(date +%s)
+       [ $(($cur_time - $trigger_time)) -ge $grace ] &&
+               error "Passed grace time $grace, $trigger_time, $cur_time"
 
        echo "Create file before timer goes off"
        $RUNAS touch ${TESTFILE}_before ||
                quota_error a $TSTUSR "failed create before timer expired," \
-                       "but expect success"
-       sync; sleep 1; sync
+                       "but expect success. $trigger_time, $cur_time"
+       sync_all_data || true
 
        echo "Sleep $TIMER seconds ..."
        sleep $TIMER
@@ -707,11 +716,11 @@ test_file_soft() {
        # hasn't been decreased from the pending write, if we acquire quota
        # in this window, we'll acquire more than we needed.
        $RUNAS touch ${TESTFILE}_after_1 ${TESTFILE}_after_2 || true
-       sync; sleep 1; sync
+       sync_all_data || true
        $RUNAS touch ${TESTFILE}_after_3 &&
                quota_error a $TSTUSR "create after timer expired," \
                        "but expect EDQUOT"
-       sync; sleep 1; sync
+       sync_all_data || true
 
        $SHOW_QUOTA_USER
        $SHOW_QUOTA_GROUP
@@ -726,7 +735,7 @@ test_file_soft() {
        $RUNAS touch ${TESTFILE}_xxx ||
                quota_error a $TSTUSR "touch after timer stop failure," \
                        "but expect success"
-       sync; sleep 1; sync
+       sync_all_data || true
 
        # cleanup
        cleanup_quota_test
@@ -1943,6 +1952,10 @@ test_23_sub() {
 }
 
 test_23() {
+       [ $(facet_fstype ost1) == "zfs" ] &&
+               skip "Overwrite in place is not guaranteed to be " \
+               "space neutral on ZFS" && return
+
        local OST0_MIN=$((6 * 1024)) # 6MB, extra space for meta blocks.
        check_whether_skip && return 0
        log "run for 4MB test file"
@@ -2277,78 +2290,6 @@ test_35() {
 }
 run_test 35 "Usage is still accessible across reboot"
 
-# test migrating old amdin quota files (in Linux quota file format v2) into new
-# quota global index (in IAM format)
-test_36() {
-       [ $(facet_fstype $SINGLEMDS) != ldiskfs ] && \
-               skip "skipping migration test" && return
-
-       # get the mdt0 device name
-       local mdt0_node=$(facet_active_host $SINGLEMDS)
-       local mdt0_dev=$(mdsdevname ${SINGLEMDS//mds/})
-
-       echo "Reformat..."
-       formatall
-
-       echo "Copy admin quota files into MDT0..."
-       local mntpt=$(facet_mntpt $SINGLEMDS)
-       local mdt0_fstype=$(facet_fstype $SINGLEMDS)
-       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
-       do_node $mdt0_node umount -d -f $mntpt
-
-       echo "Setup all..."
-       setupall
-
-       echo "Verify global limits..."
-       local id_cnt
-       local limit
-
-       local proc="qmt.*.md-0x0.glb-usr"
-       id_cnt=$(do_node $mdt0_node $LCTL get_param -n $proc | wc -l)
-       [ $id_cnt -eq 403 ] || 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)
-       [ $limit -eq 2048 ] || error "User inode hardlimit: $limit"
-
-       proc="qmt.*.md-0x0.glb-grp"
-       id_cnt=$(do_node $mdt0_node $LCTL get_param -n $proc | wc -l)
-       [ $id_cnt -eq 403 ] || 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)
-       [ $limit -eq 2048 ] || error "Group inode hardlimit: $limit"
-
-       proc=" qmt.*.dt-0x0.glb-usr"
-       id_cnt=$(do_node $mdt0_node $LCTL get_param -n $proc | wc -l)
-       [ $id_cnt -eq 403 ] || 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)
-       [ $limit -eq 20971520 ] || error "User block hardlimit: $limit"
-
-       proc="qmt.*.dt-0x0.glb-grp"
-       id_cnt=$(do_node $mdt0_node $LCTL get_param -n $proc | wc -l)
-       [ $id_cnt -eq 403 ] || 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)
-       [ $limit -eq 20971520 ] || error "Group block hardlimit: $limit"
-
-       echo "Cleanup..."
-       formatall
-       setupall
-}
-run_test 36 "Migrate old admin files into new global indexes"
-
 # chown/chgrp to the file created with MDS_OPEN_DELAY_CREATE
 # LU-5006
 test_37() {