Skip to contentSkip to conversation

xfs: quota state command should report upg grace times separately

PATCH In review Zorro Lang 3 participants 5 messages Aug 6, 2021 – Aug 8, 2021

lore
Share & tools
lore

Zorro Lang

author
#0 lore raw

PATCH 1/1 xfs: quota state command should report upg grace times separately

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.

---
 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
tests/xfs/175 new file +33 -0
new file mode 100755
index 00000000..0b7d81ec
@@ -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
+
+# 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
+
+$XFS_QUOTA_PROG -x -c 'timer -u 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
tests/xfs/175.out new file +21 -0
new file mode 100644
index 00000000..83247e21
@@ -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: [--------]
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 19 lines · Zorro Lang

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.

---
 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
tests/xfs/175 new file +0 -0
new file mode 100755
index 00000000..0b7d81ec

tests/xfs/175 line 7

Quoted 7 lines
tests/xfs/175 new file +7 -0
@@ -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

Might be worth saying explicitly that this is an xfsprogs commit.

Quoted 12 lines
tests/xfs/175 new file +12 -0
+# 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
+
+# real QA test starts here
+_supported_fs xfs
+_require_scratch
+_require_quota
+
+# Format filesystem and set up quota limits

tests/xfs/175 line 29

Quoted 10 lines
tests/xfs/175 new file +10 -0
+_scratch_mkfs > $seqres.full
+_qmount_option "grpquota"
+_scratch_mount >> $seqres.full
+
+$XFS_QUOTA_PROG -x -c 'timer -u 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'

Logic looks fine to me.

With the comment fixed,

--D

Quoted 34 lines
tests/xfs/175 new file +4 -0
+
+# success, all done
+status=0
+exit
tests/xfs/175.out new file +21 -0
new file mode 100644
index 00000000..83247e21
@@ -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: [--------]
Signature · 1 line
2.31.1
#2 lore raw
Quoted 14 lines · Darrick J. Wong
Quoted 13 lines · Zorro Lang

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.

---
 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
Quoted 15 lines

tests/xfs/175 line 7

Quoted 13 lines
tests/xfs/175 new file +7 -0
new file mode 100755
index 00000000..0b7d81ec
@@ -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

Might be worth saying explicitly that this is an xfsprogs commit.

I'll fix that on commit, Zorro, there's no need to resend.

Quoted 26 lines
Quoted 13 lines
tests/xfs/175 new file +12 -0
+# 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
+
+# real QA test starts here
+_supported_fs xfs
+_require_scratch
+_require_quota
+
+# Format filesystem and set up quota limits

tests/xfs/175 line 29

Quoted 10 lines
tests/xfs/175 new file +10 -0
+_scratch_mkfs > $seqres.full
+_qmount_option "grpquota"
+_scratch_mount >> $seqres.full
+
+$XFS_QUOTA_PROG -x -c 'timer -u 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'

Logic looks fine to me.

Quoted 2 lines

With the comment fixed,

Thanks for review!

Eryu

Quoted 37 lines

--D

Quoted 34 lines
tests/xfs/175 new file +4 -0
+
+# success, all done
+status=0
+exit
tests/xfs/175.out new file +21 -0
new file mode 100644
index 00000000..83247e21
@@ -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: [--------]
Signature · 1 line
2.31.1
#3 lore raw
In reply to Zorro Lang
Quoted 21 lines · Zorro Lang

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.

---
 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
tests/xfs/175 new file +2 -0
new file mode 100755
index 00000000..0b7d81ec
@@ -0,0 +1,33 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0

tests/xfs/175 line 12

Quoted 10 lines
tests/xfs/175 new file +10 -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

tests/xfs/175 line 22

Quoted 10 lines
tests/xfs/175 new file +10 -0
+
+# 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/

tests/xfs/175 line 24

Quoted 2 lines
tests/xfs/175 new file +2 -0
+
+$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

Quoted 38 lines
tests/xfs/175 new file +9 -0
+# 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
tests/xfs/175.out new file +21 -0
new file mode 100644
index 00000000..83247e21
@@ -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: [--------]
Signature · 1 line
2.31.1
author
#4 lore raw
Quoted 48 lines · Eryu Guan
Quoted 21 lines · Zorro Lang

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.

---
 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
tests/xfs/175 new file +2 -0
new file mode 100755
index 00000000..0b7d81ec
@@ -0,0 +1,33 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0

tests/xfs/175 line 12

Quoted 10 lines
tests/xfs/175 new file +10 -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

tests/xfs/175 line 22

Quoted 10 lines
tests/xfs/175 new file +10 -0
+
+# 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/

Quoted 8 lines

tests/xfs/175 line 24

Quoted 2 lines
tests/xfs/175 new file +2 -0
+
+$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.

Sorry, I forgot to commit below changes[1] in my local git repo, before sending this patch ... It's still staged ... Sorry about that, if you haven't merged this patch, I can send a V2.

Thanks,
Zorro

[1]
[zorro@zlang-laptop xfstests-dev]$ git diff

tests/xfs/175 +3 -1
index 0b7d81ec..2cd38842 100755
@@ -11,6 +11,8 @@
 . ./common/preamble
 _begin_fstest auto quick quota
 
+. ./common/quota
+
 # real QA test starts here
 _supported_fs xfs
 _require_scratch
@@ -21,7 +23,7 @@ _scratch_mkfs > $seqres.full
 _qmount_option "grpquota"
 _scratch_mount >> $seqres.full
 
-$XFS_QUOTA_PROG -x -c 'timer -u 5d' $SCRATCH_MNT
+$XFS_QUOTA_PROG -x -c 'timer -g 5d' $SCRATCH_MNT
 
 
Quoted 43 lines

Thanks,
Eryu

Quoted 38 lines
tests/xfs/175 new file +9 -0
+# 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
tests/xfs/175.out new file +21 -0
new file mode 100644
index 00000000..83247e21
@@ -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: [--------]
Signature · 1 line
2.31.1