From: Zorro Lang Date: Fri, 6 Aug 2021 05:10:12 +0000 (+0800) Subject: xfs: quota state command should report upg grace times separately X-Git-Tag: v2022.05.01~296 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c124d3a3116da44ed896d778c12eee34f5635f1c;p=xfstests-dev.git xfs: quota state command should report upg grace times separately 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 Reviewed-by: Darrick J. Wong Signed-off-by: Eryu Guan --- diff --git a/tests/xfs/175 b/tests/xfs/175 new file mode 100755 index 00000000..22c64802 --- /dev/null +++ b/tests/xfs/175 @@ -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 index 00000000..83247e21 --- /dev/null +++ b/tests/xfs/175.out @@ -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: [--------]