fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@redhat.com>
To: fstests@vger.kernel.org
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 1/2] generic: per-type quota timers set/get test
Date: Mon, 17 Feb 2020 02:16:30 +0800	[thread overview]
Message-ID: <20200216181631.22560-1-zlang@redhat.com> (raw)

Set different grace time, make sure each of quota (user, group and
project) timers can be set (by setquota) and get (by repquota)
correctly.

Signed-off-by: Zorro Lang <zlang@redhat.com>
---

Hi,

This case test passed on ext4, but on XFS (xfs-linux for-next branch with
Eric's patchset: [PATCH 0/4] xfs: enable per-type quota timers and warn limits)
I got below different output:

# diff -u tests/generic/593.out results/generic/593.out.bad
--- tests/generic/593.out       2020-02-15 12:08:49.012651926 -0500
+++ results//generic/593.out.bad        2020-02-16 13:00:58.811815870 -0500
@@ -5,28 +5,28 @@
 *** Report for group quotas on device SCRATCH_DEV
 Block grace time: 7days; Inode grace time: 7days
 *** Report for project quotas on device SCRATCH_DEV
-Block grace time: 00:10; Inode grace time: 00:20
+Block grace time: 7days; Inode grace time: 7days
 
 2. set group quota timer
 *** Report for user quotas on device SCRATCH_DEV
 Block grace time: 7days; Inode grace time: 7days
 *** Report for group quotas on device SCRATCH_DEV
-Block grace time: 00:30; Inode grace time: 00:40
+Block grace time: 7days; Inode grace time: 7days
 *** Report for project quotas on device SCRATCH_DEV
-Block grace time: 00:10; Inode grace time: 00:20
+Block grace time: 7days; Inode grace time: 7days
 
 3. set user quota timer
 *** Report for user quotas on device SCRATCH_DEV
 Block grace time: 00:50; Inode grace time: 01:00
 *** Report for group quotas on device SCRATCH_DEV
-Block grace time: 00:30; Inode grace time: 00:40
+Block grace time: 00:50; Inode grace time: 01:00
 *** Report for project quotas on device SCRATCH_DEV
-Block grace time: 00:10; Inode grace time: 00:20
+Block grace time: 00:50; Inode grace time: 01:00
 
 4. cycle mount
 *** Report for user quotas on device SCRATCH_DEV
 Block grace time: 00:50; Inode grace time: 01:00
 *** Report for group quotas on device SCRATCH_DEV
-Block grace time: 00:30; Inode grace time: 00:40
+Block grace time: 00:50; Inode grace time: 01:00
 *** Report for project quotas on device SCRATCH_DEV
-Block grace time: 00:10; Inode grace time: 00:20
+Block grace time: 00:50; Inode grace time: 01:00

This looks like totally wrong, can anyone help to take a look at it?

Thanks,
Zorro

 tests/generic/593     | 69 +++++++++++++++++++++++++++++++++++++++++++
 tests/generic/593.out | 32 ++++++++++++++++++++
 tests/generic/group   |  1 +
 3 files changed, 102 insertions(+)
 create mode 100755 tests/generic/593
 create mode 100644 tests/generic/593.out

diff --git a/tests/generic/593 b/tests/generic/593
new file mode 100755
index 00000000..fd695329
--- /dev/null
+++ b/tests/generic/593
@@ -0,0 +1,69 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2020 Red Hat, Inc.  All Rights Reserved.
+#
+# FS QA Test 593
+#
+# Test per-type(user, group and project) filesystem quota timers, make sure
+# each of grace time can be set/get properly.
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/quota
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+_require_quota
+
+_scratch_mkfs >$seqres.full 2>&1
+_scratch_enable_pquota
+_qmount_option "usrquota,grpquota,prjquota"
+_qmount
+_require_prjquota $SCRATCH_DEV
+
+MIN=60
+
+echo "1. set project quota timer"
+setquota -t -P $((10 * MIN)) $((20 * MIN)) $SCRATCH_MNT
+repquota -ugP $SCRATCH_MNT | grep "Report\|^Block" | _filter_scratch
+echo
+
+echo "2. set group quota timer"
+setquota -t -g $((30 * MIN)) $((40 * MIN)) $SCRATCH_MNT
+repquota -ugP $SCRATCH_MNT | grep "Report\|^Block" | _filter_scratch
+echo
+
+echo "3. set user quota timer"
+setquota -t -u $((50 * MIN)) $((60 * MIN)) $SCRATCH_MNT
+repquota -ugP $SCRATCH_MNT | grep "Report\|^Block" | _filter_scratch
+echo
+
+# cycle mount, make sure the quota timers are still right
+echo "4. cycle mount"
+_qmount
+repquota -ugP $SCRATCH_MNT | grep "Report\|^Block" | _filter_scratch
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/593.out b/tests/generic/593.out
new file mode 100644
index 00000000..71dfa224
--- /dev/null
+++ b/tests/generic/593.out
@@ -0,0 +1,32 @@
+QA output created by 593
+1. set project quota timer
+*** Report for user quotas on device SCRATCH_DEV
+Block grace time: 7days; Inode grace time: 7days
+*** Report for group quotas on device SCRATCH_DEV
+Block grace time: 7days; Inode grace time: 7days
+*** Report for project quotas on device SCRATCH_DEV
+Block grace time: 00:10; Inode grace time: 00:20
+
+2. set group quota timer
+*** Report for user quotas on device SCRATCH_DEV
+Block grace time: 7days; Inode grace time: 7days
+*** Report for group quotas on device SCRATCH_DEV
+Block grace time: 00:30; Inode grace time: 00:40
+*** Report for project quotas on device SCRATCH_DEV
+Block grace time: 00:10; Inode grace time: 00:20
+
+3. set user quota timer
+*** Report for user quotas on device SCRATCH_DEV
+Block grace time: 00:50; Inode grace time: 01:00
+*** Report for group quotas on device SCRATCH_DEV
+Block grace time: 00:30; Inode grace time: 00:40
+*** Report for project quotas on device SCRATCH_DEV
+Block grace time: 00:10; Inode grace time: 00:20
+
+4. cycle mount
+*** Report for user quotas on device SCRATCH_DEV
+Block grace time: 00:50; Inode grace time: 01:00
+*** Report for group quotas on device SCRATCH_DEV
+Block grace time: 00:30; Inode grace time: 00:40
+*** Report for project quotas on device SCRATCH_DEV
+Block grace time: 00:10; Inode grace time: 00:20
diff --git a/tests/generic/group b/tests/generic/group
index 6fe62505..637ae325 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -595,3 +595,4 @@
 590 auto prealloc preallocrw
 591 auto quick rw pipe splice
 592 auto quick encrypt
+593 auto quick quota
-- 
2.20.1


             reply	other threads:[~2020-02-16 18:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-16 18:16 Zorro Lang [this message]
2020-02-16 18:16 ` [PATCH 2/2] generic: test per-type quota softlimit enforcement timeout Zorro Lang
2020-02-18 21:09 ` [PATCH 1/2] generic: per-type quota timers set/get test Eric Sandeen
2020-02-18 21:41 ` Eric Sandeen
2020-02-18 21:44   ` Eric Sandeen
2020-02-18 22:02     ` Eric Sandeen
2020-02-20  2:57 ` Eric Sandeen
2020-02-20  4:15   ` Zorro Lang
     [not found]     ` <605d6c45-9f52-ec84-df01-d5b7665d16dc@sandeen.net>
2020-02-20  5:05       ` Zorro Lang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200216181631.22560-1-zlang@redhat.com \
    --to=zlang@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).