All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <guan@eryu.me>
To: Zorro Lang <zlang@redhat.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH] xfs: quota state command should report upg grace times separately
Date: Sun, 8 Aug 2021 22:35:53 +0800	[thread overview]
Message-ID: <YQ/ryebsyGy7vurG@desktop> (raw)
In-Reply-To: <20210806051012.1640342-1-zlang@redhat.com>

On Fri, Aug 06, 2021 at 01:10:12PM +0800, Zorro Lang wrote:
> Regression test for 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>
> ---
>  tests/xfs/175     | 33 +++++++++++++++++++++++++++++++++
>  tests/xfs/175.out | 21 +++++++++++++++++++++
>  2 files changed, 54 insertions(+)
>  create mode 100755 tests/xfs/175
>  create mode 100644 tests/xfs/175.out
> 
> diff --git a/tests/xfs/175 b/tests/xfs/175
> new file mode 100755
> index 00000000..0b7d81ec
> --- /dev/null
> +++ b/tests/xfs/175
> @@ -0,0 +1,33 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2021 Red Hat, Inc.  All Rights Reserved.
> +#
> +# FS QA Test 175
> +#
> +# Regression test for 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

Should source ./common/quota here

> +
> +# 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"
> +_scratch_mount >> $seqres.full

s/_scratch_mount/_qmount/

> +
> +$XFS_QUOTA_PROG -x -c 'timer -u 5d' $SCRATCH_MNT

Should set group quota timer, as we only enable grpquota above,
otherwise we hit "xfs_quota: cannot set timer: No such process" failre
here.

I fixed all on commit.

Thanks,
Eryu

> +# 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: [--------]
> -- 
> 2.31.1

  parent reply	other threads:[~2021-08-08 14:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06  5:10 [PATCH] xfs: quota state command should report upg grace times separately Zorro Lang
2021-08-06 18:59 ` Darrick J. Wong
2021-08-08 14:11   ` Eryu Guan
2021-08-08 14:35 ` Eryu Guan [this message]
2021-08-08 15:44   ` 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=YQ/ryebsyGy7vurG@desktop \
    --to=guan@eryu.me \
    --cc=fstests@vger.kernel.org \
    --cc=zlang@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.