]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs: quota state command should report upg grace times separately
authorZorro Lang <zlang@redhat.com>
Fri, 6 Aug 2021 05:10:12 +0000 (13:10 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 8 Aug 2021 14:33:43 +0000 (22:33 +0800)
Regression test for xfsprogs d8a94546 ("xfs_quota: state command
should report ugp grace times"). When give "-ugp" or "-a" options to
xfs_quota state command, it should report grace times for all three
types separately.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/xfs/175 [new file with mode: 0755]
tests/xfs/175.out [new file with mode: 0644]

diff --git a/tests/xfs/175 b/tests/xfs/175
new file mode 100755 (executable)
index 0000000..22c6480
--- /dev/null
@@ -0,0 +1,37 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2021 Red Hat, Inc.  All Rights Reserved.
+#
+# FS QA Test 175
+#
+# Regression test for xfsprogs commit d8a94546 ("xfs_quota: state command
+# should report ugp grace times"). When give "-ugp" or "-a" options to
+# xfs_quota state command, it should report grace times for all three types
+# separately.
+#
+. ./common/preamble
+_begin_fstest auto quick quota
+
+# Import common functions
+. ./common/quota
+
+# real QA test starts here
+_supported_fs xfs
+_require_scratch
+_require_quota
+
+# Format filesystem and set up quota limits
+_scratch_mkfs > $seqres.full
+_qmount_option "grpquota"
+_qmount >> $seqres.full
+
+$XFS_QUOTA_PROG -x -c 'timer -g 5d' $SCRATCH_MNT
+# xfs_quota state -ugp or -a should report times for all three types separately.
+echo "* state -ugp:"
+$XFS_QUOTA_PROG -x -c 'state -ugp' $SCRATCH_MNT | grep 'grace time'
+echo "* state -a:"
+$XFS_QUOTA_PROG -x -c 'state -a' $SCRATCH_MNT | grep 'grace time'
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/175.out b/tests/xfs/175.out
new file mode 100644 (file)
index 0000000..83247e2
--- /dev/null
@@ -0,0 +1,21 @@
+QA output created by 175
+* state -ugp:
+Blocks grace time: [--------]
+Inodes grace time: [--------]
+Realtime Blocks grace time: [--------]
+Blocks grace time: [5 days]
+Inodes grace time: [5 days]
+Realtime Blocks grace time: [5 days]
+Blocks grace time: [--------]
+Inodes grace time: [--------]
+Realtime Blocks grace time: [--------]
+* state -a:
+Blocks grace time: [--------]
+Inodes grace time: [--------]
+Realtime Blocks grace time: [--------]
+Blocks grace time: [5 days]
+Inodes grace time: [5 days]
+Realtime Blocks grace time: [5 days]
+Blocks grace time: [--------]
+Inodes grace time: [--------]
+Realtime Blocks grace time: [--------]