Whamcloud - gitweb
LU-3543 quota: minor fix in s-q test_7c
[fs/lustre-release.git] / lustre / tests / sanity-quota.sh
index af980c8..a0ec174 100644 (file)
@@ -50,8 +50,8 @@ 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-2872 LU-2836 LU-2836 LU-2059
+       ALWAYS_EXCEPT="$ALWAYS_EXCEPT 1       3       6       7d"
 # bug number:     LU-2887
        ZFS_SLOW="12a"
 fi
@@ -367,8 +367,14 @@ test_quota_performance() {
        delta=$((etime - stime))
        if [ $delta -gt 0 ]; then
            rate=$((size * 1024 / delta))
-           [ $rate -gt 1024 ] ||
-               error "SLOW IO for $TSTUSR (user): $rate KB/sec"
+           if [ $(facet_fstype $SINGLEMDS) = "zfs" ]; then
+               # LU-2872 - see LU-2887 for fix
+               [ $rate -gt 256 ] ||
+                       error "SLOW IO for $TSTUSR (user): $rate KB/sec"
+           else
+               [ $rate -gt 1024 ] ||
+                       error "SLOW IO for $TSTUSR (user): $rate KB/sec"
+           fi
        fi
        rm -f $TESTFILE
 }
@@ -854,6 +860,10 @@ run_test 5 "Chown & chgrp successfully even out of block/file quota"
 test_6() {
        local LIMIT=3 # 3M
 
+       # Clear dmesg so watchdog is not triggered by previous
+       # test output
+       do_facet ost1 dmesg -c > /dev/null
+
        setup_quota_test
        trap cleanup_quota_test EXIT
 
@@ -912,12 +922,8 @@ test_6() {
 
        # no watchdog is triggered
        do_facet ost1 dmesg > $TMP/lustre-log-${TESTNAME}.log
-       watchdog=$(awk '/sanity-quota test 6/ {start = 1;}
-                      /Service thread pid/ && /was inactive/ {
-                              if (start) {
-                                      print;
-                              }
-                      }' $TMP/lustre-log-${TESTNAME}.log)
+       watchdog=$(awk '/Service thread pid/ && /was inactive/ \
+                       { print; }' $TMP/lustre-log-${TESTNAME}.log)
        [ -z "$watchdog" ] || error "$watchdog"
 
        rm -f $TMP/lustre-log-${TESTNAME}.log
@@ -1110,7 +1116,8 @@ test_7c() {
        # trigger reintegration
        local procf="osd-$(facet_fstype ost1).$FSNAME-OST*."
        procf=${procf}quota_slave.force_reint
-       $LCTL set_param $procf=1 || "force reintegration failed"
+       do_facet ost1 $LCTL set_param $procf=1 ||
+               error "force reintegration failed"
 
        echo "Stop mds..."
        stop mds1
@@ -1242,7 +1249,7 @@ test_7e() {
                quota_error -u $TSTUSR "create failed, expect success"
 
        $RUNAS unlinkmany $TESTFILE $((ilimit + 1)) || "unlink failed"
-       $LFS rmdir $DIR/${tdir}-1 || "unlink remote dir failed"
+       rmdir $DIR/${tdir}-1 || "unlink remote dir failed"
 
        cleanup_quota_test
        resetquota -u $TSTUSR
@@ -1478,7 +1485,7 @@ test_12b() {
 
        $RUNAS unlinkmany $TESTFILE1 $((ilimit / 2)) ||
                error "unlink mdt1 files failed"
-       $LFS rmdir $DIR/${tdir}-1 || error "unlink remote dir failed"
+       rmdir $DIR/${tdir}-1 || error "unlink remote dir failed"
 
        cleanup_quota_test
        resetquota -u $TSTUSR
@@ -1691,7 +1698,7 @@ test_18_sub () {
 
        local testfile_size=$(stat -c %s $TESTFILE)
        if [ $testfile_size -ne $((BLK_SZ * 1024 * 100)) ] ; then
-               quota_error u $TSTUSR "expect $((BLK_SZ * 1024 * 100)),"
+               quota_error u $TSTUSR "expect $((BLK_SZ * 1024 * 100))," \
                        "got ${testfile_size}. Verifying file failed!"
        fi
        cleanup_quota_test
@@ -1701,17 +1708,17 @@ test_18_sub () {
 # test when mds does failover, the ost still could work well
 # this test shouldn't trigger watchdog b=14840
 test_18() {
+       # Clear dmesg so watchdog is not triggered by previous
+       # test output
+       do_facet ost1 dmesg -c > /dev/null
+
        test_18_sub normal
        test_18_sub directio
 
        # check if watchdog is triggered
        do_facet ost1 dmesg > $TMP/lustre-log-${TESTNAME}.log
-       local watchdog=$(awk '/sanity-quota test 18/ {start = 1;}
-                      /Service thread pid/ && /was inactive/ {
-                              if (start) {
-                                      print;
-                              }
-                      }' $TMP/lustre-log-${TESTNAME}.log)
+       local watchdog=$(awk '/Service thread pid/ && /was inactive/ \
+                       { print; }' $TMP/lustre-log-${TESTNAME}.log)
        [ -z "$watchdog" ] || error "$watchdog"
        rm -f $TMP/lustre-log-${TESTNAME}.log
 }