* [PATCH 0/3] fstests: random stuff @ 2020-03-04 2:46 Darrick J. Wong 2020-03-04 2:46 ` [PATCH 1/3] generic/402: skip test if xfs_io can't parse the date value Darrick J. Wong ` (2 more replies) 0 siblings, 3 replies; 8+ messages in thread From: Darrick J. Wong @ 2020-03-04 2:46 UTC (permalink / raw) To: guaneryu, darrick.wong; +Cc: linux-xfs, fstests Hi all, Here's an odd assortment of things. The first patch fixes generic/402 to abort if userspace can't handle a (nonzero) time value. The second patch refactors calls to xfs_admin into a helper so that it works correctly on scratch devices with external log devices. The third patch adds a test to ensure that xfs_db and xfs_quota commands are documented in the manual pages. If you're going to start using this mess, you probably ought to just pull from my git trees, which are linked below. This is an extraordinary way to destroy everything. Enjoy! Comments and questions are, as always, welcome. --D xfsprogs git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=random-fixes fstests git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=random-fixes ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/3] generic/402: skip test if xfs_io can't parse the date value 2020-03-04 2:46 [PATCH 0/3] fstests: random stuff Darrick J. Wong @ 2020-03-04 2:46 ` Darrick J. Wong 2020-03-06 9:33 ` Zorro Lang 2020-03-04 2:46 ` [PATCH 2/3] xfs: refactor calls to xfs_admin Darrick J. Wong 2020-03-04 2:46 ` [PATCH 3/3] xfs: make sure xfs_db/xfs_quota commands are documented Darrick J. Wong 2 siblings, 1 reply; 8+ messages in thread From: Darrick J. Wong @ 2020-03-04 2:46 UTC (permalink / raw) To: guaneryu, darrick.wong; +Cc: linux-xfs, Amir Goldstein, fstests From: Darrick J. Wong <darrick.wong@oracle.com> If xfs_io's utimes command cannot interpret the arguments that are given to it, it will print out "Bad value for [am]time". Detect when this happens and drop the file out of the test entirely. This is particularly noticeable on 32-bit platforms and the largest timestamp seconds supported by the filesystem is INT_MAX. In this case, the maximum value we can cram into tv_sec is INT_MAX, and there is no way to actually test setting a timestamp of INT_MAX + 1 to test the clamping. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Amir Goldstein <amir73il@gmail.com> --- tests/generic/402 | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/generic/402 b/tests/generic/402 index 2a34d127..2481a5d2 100755 --- a/tests/generic/402 +++ b/tests/generic/402 @@ -63,10 +63,26 @@ run_test_individual() # check if the time needs update if [ $update_time -eq 1 ]; then echo "Updating file: $file to timestamp $timestamp" >> $seqres.full - $XFS_IO_PROG -f -c "utimes $timestamp 0 $timestamp 0" $file - if [ $? -ne 0 ]; then + rm -f $tmp.utimes + $XFS_IO_PROG -f -c "utimes $timestamp 0 $timestamp 0" $file > $tmp.utimes 2>&1 + local res=$? + + cat $tmp.utimes >> $seqres.full + if [ "$timestamp" -ne 0 ] && grep -q "Bad value" "$tmp.utimes"; then + echo "xfs_io could not interpret time value \"$timestamp\", skipping \"$file\" test." >> $seqres.full + rm -f $file $tmp.utimes + return + fi + cat $tmp.utimes + rm -f $tmp.utimes + if [ $res -ne 0 ]; then echo "Failed to update times on $file" | tee -a $seqres.full fi + else + if [ ! -f "$file" ]; then + echo "xfs_io did not create file for time value \"$timestamp\", skipping test." >> $seqres.full + return + fi fi tsclamp=$((timestamp<tsmin?tsmin:timestamp>tsmax?tsmax:timestamp)) ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] generic/402: skip test if xfs_io can't parse the date value 2020-03-04 2:46 ` [PATCH 1/3] generic/402: skip test if xfs_io can't parse the date value Darrick J. Wong @ 2020-03-06 9:33 ` Zorro Lang 0 siblings, 0 replies; 8+ messages in thread From: Zorro Lang @ 2020-03-06 9:33 UTC (permalink / raw) To: fstests; +Cc: linux-xfs On Tue, Mar 03, 2020 at 06:46:34PM -0800, Darrick J. Wong wrote: > From: Darrick J. Wong <darrick.wong@oracle.com> > > If xfs_io's utimes command cannot interpret the arguments that are given > to it, it will print out "Bad value for [am]time". Detect when this > happens and drop the file out of the test entirely. > > This is particularly noticeable on 32-bit platforms and the largest > timestamp seconds supported by the filesystem is INT_MAX. In this case, > the maximum value we can cram into tv_sec is INT_MAX, and there is no > way to actually test setting a timestamp of INT_MAX + 1 to test the > clamping. > > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> > Reviewed-by: Amir Goldstein <amir73il@gmail.com> > --- Looks good to me. > tests/generic/402 | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) > > > diff --git a/tests/generic/402 b/tests/generic/402 > index 2a34d127..2481a5d2 100755 > --- a/tests/generic/402 > +++ b/tests/generic/402 > @@ -63,10 +63,26 @@ run_test_individual() > # check if the time needs update > if [ $update_time -eq 1 ]; then > echo "Updating file: $file to timestamp $timestamp" >> $seqres.full > - $XFS_IO_PROG -f -c "utimes $timestamp 0 $timestamp 0" $file > - if [ $? -ne 0 ]; then > + rm -f $tmp.utimes > + $XFS_IO_PROG -f -c "utimes $timestamp 0 $timestamp 0" $file > $tmp.utimes 2>&1 > + local res=$? > + > + cat $tmp.utimes >> $seqres.full > + if [ "$timestamp" -ne 0 ] && grep -q "Bad value" "$tmp.utimes"; then > + echo "xfs_io could not interpret time value \"$timestamp\", skipping \"$file\" test." >> $seqres.full > + rm -f $file $tmp.utimes > + return > + fi > + cat $tmp.utimes > + rm -f $tmp.utimes > + if [ $res -ne 0 ]; then > echo "Failed to update times on $file" | tee -a $seqres.full > fi > + else > + if [ ! -f "$file" ]; then > + echo "xfs_io did not create file for time value \"$timestamp\", skipping test." >> $seqres.full > + return > + fi > fi > > tsclamp=$((timestamp<tsmin?tsmin:timestamp>tsmax?tsmax:timestamp)) > ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/3] xfs: refactor calls to xfs_admin 2020-03-04 2:46 [PATCH 0/3] fstests: random stuff Darrick J. Wong 2020-03-04 2:46 ` [PATCH 1/3] generic/402: skip test if xfs_io can't parse the date value Darrick J. Wong @ 2020-03-04 2:46 ` Darrick J. Wong 2020-03-06 9:53 ` Zorro Lang 2020-03-04 2:46 ` [PATCH 3/3] xfs: make sure xfs_db/xfs_quota commands are documented Darrick J. Wong 2 siblings, 1 reply; 8+ messages in thread From: Darrick J. Wong @ 2020-03-04 2:46 UTC (permalink / raw) To: guaneryu, darrick.wong; +Cc: linux-xfs, fstests From: Darrick J. Wong <darrick.wong@oracle.com> Create a helper to run xfs_admin on the scratch device, then refactor all tests to use it. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> --- common/config | 1 + common/xfs | 8 ++++++++ tests/xfs/287 | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/common/config b/common/config index 9a9c7760..1116cb99 100644 --- a/common/config +++ b/common/config @@ -154,6 +154,7 @@ MKSWAP_PROG="$MKSWAP_PROG -f" export XFS_LOGPRINT_PROG="$(type -P xfs_logprint)" export XFS_REPAIR_PROG="$(type -P xfs_repair)" export XFS_DB_PROG="$(type -P xfs_db)" +export XFS_ADMIN_PROG="$(type -P xfs_admin)" export XFS_GROWFS_PROG=$(type -P xfs_growfs) export XFS_SPACEMAN_PROG="$(type -P xfs_spaceman)" export XFS_SCRUB_PROG="$(type -P xfs_scrub)" diff --git a/common/xfs b/common/xfs index 706ddf85..d9a9784f 100644 --- a/common/xfs +++ b/common/xfs @@ -218,6 +218,14 @@ _scratch_xfs_db() $XFS_DB_PROG "$@" $(_scratch_xfs_db_options) } +_scratch_xfs_admin() +{ + local options=("$SCRATCH_DEV") + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ + options+=("$SCRATCH_LOGDEV") + $XFS_ADMIN_PROG "$@" "${options[@]}" +} + _scratch_xfs_logprint() { SCRATCH_OPTIONS="" diff --git a/tests/xfs/287 b/tests/xfs/287 index 8dc754a5..f77ed2f1 100755 --- a/tests/xfs/287 +++ b/tests/xfs/287 @@ -70,7 +70,7 @@ $XFS_IO_PROG -r -c "lsproj" $dir/32bit _scratch_unmount # Now, enable projid32bit support by xfs_admin -xfs_admin -p $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_admin failed" +_scratch_xfs_admin -p >> $seqres.full 2>&1 || _fail "xfs_admin failed" # Now mount the fs, 32bit project quotas shall be supported, now _qmount_option "pquota" ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] xfs: refactor calls to xfs_admin 2020-03-04 2:46 ` [PATCH 2/3] xfs: refactor calls to xfs_admin Darrick J. Wong @ 2020-03-06 9:53 ` Zorro Lang 0 siblings, 0 replies; 8+ messages in thread From: Zorro Lang @ 2020-03-06 9:53 UTC (permalink / raw) To: fstests; +Cc: linux-xfs On Tue, Mar 03, 2020 at 06:46:40PM -0800, Darrick J. Wong wrote: > From: Darrick J. Wong <darrick.wong@oracle.com> > > Create a helper to run xfs_admin on the scratch device, then refactor > all tests to use it. > > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> > --- > common/config | 1 + > common/xfs | 8 ++++++++ > tests/xfs/287 | 2 +- > 3 files changed, 10 insertions(+), 1 deletion(-) > > > diff --git a/common/config b/common/config > index 9a9c7760..1116cb99 100644 > --- a/common/config > +++ b/common/config > @@ -154,6 +154,7 @@ MKSWAP_PROG="$MKSWAP_PROG -f" > export XFS_LOGPRINT_PROG="$(type -P xfs_logprint)" > export XFS_REPAIR_PROG="$(type -P xfs_repair)" > export XFS_DB_PROG="$(type -P xfs_db)" > +export XFS_ADMIN_PROG="$(type -P xfs_admin)" > export XFS_GROWFS_PROG=$(type -P xfs_growfs) > export XFS_SPACEMAN_PROG="$(type -P xfs_spaceman)" > export XFS_SCRUB_PROG="$(type -P xfs_scrub)" > diff --git a/common/xfs b/common/xfs > index 706ddf85..d9a9784f 100644 > --- a/common/xfs > +++ b/common/xfs > @@ -218,6 +218,14 @@ _scratch_xfs_db() > $XFS_DB_PROG "$@" $(_scratch_xfs_db_options) > } > > +_scratch_xfs_admin() > +{ > + local options=("$SCRATCH_DEV") > + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ > + options+=("$SCRATCH_LOGDEV") > + $XFS_ADMIN_PROG "$@" "${options[@]}" > +} > + Looks good to me. Althought on old xfs_admin doesn't external log device, this test fails if we use SCRATCH_LOGDEV and USE_EXTERNAL=yes, it's fine for me. Reviewd-by: Zorro Lang <zlang@redhat.com> > _scratch_xfs_logprint() > { > SCRATCH_OPTIONS="" > diff --git a/tests/xfs/287 b/tests/xfs/287 > index 8dc754a5..f77ed2f1 100755 > --- a/tests/xfs/287 > +++ b/tests/xfs/287 > @@ -70,7 +70,7 @@ $XFS_IO_PROG -r -c "lsproj" $dir/32bit > _scratch_unmount > > # Now, enable projid32bit support by xfs_admin > -xfs_admin -p $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_admin failed" > +_scratch_xfs_admin -p >> $seqres.full 2>&1 || _fail "xfs_admin failed" > > # Now mount the fs, 32bit project quotas shall be supported, now > _qmount_option "pquota" > ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/3] xfs: make sure xfs_db/xfs_quota commands are documented 2020-03-04 2:46 [PATCH 0/3] fstests: random stuff Darrick J. Wong 2020-03-04 2:46 ` [PATCH 1/3] generic/402: skip test if xfs_io can't parse the date value Darrick J. Wong 2020-03-04 2:46 ` [PATCH 2/3] xfs: refactor calls to xfs_admin Darrick J. Wong @ 2020-03-04 2:46 ` Darrick J. Wong 2020-03-06 10:06 ` Zorro Lang 2 siblings, 1 reply; 8+ messages in thread From: Darrick J. Wong @ 2020-03-04 2:46 UTC (permalink / raw) To: guaneryu, darrick.wong; +Cc: linux-xfs, fstests From: Darrick J. Wong <darrick.wong@oracle.com> Make sure all the xfs_db/xfs_quota commands are documented. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> --- tests/xfs/754 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/754.out | 2 ++ tests/xfs/755 | 53 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/755.out | 2 ++ tests/xfs/group | 2 ++ 5 files changed, 116 insertions(+) create mode 100755 tests/xfs/754 create mode 100644 tests/xfs/754.out create mode 100755 tests/xfs/755 create mode 100644 tests/xfs/755.out diff --git a/tests/xfs/754 b/tests/xfs/754 new file mode 100755 index 00000000..ba0885be --- /dev/null +++ b/tests/xfs/754 @@ -0,0 +1,57 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0-or-newer +# Copyright (c) 2020, Oracle and/or its affiliates. All Rights Reserved. +# +# FS QA Test No. 754 +# +# Ensure all xfs_db commands are documented. + +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.* $file +} + +# get standard environment, filters and checks +. ./common/rc + +# real QA test starts here +_supported_fs xfs +_supported_os Linux +_require_command "$XFS_DB_PROG" "xfs_db" +_require_command "$MAN_PROG" man +_require_test + +echo "Silence is golden" + +MANPAGE=$($MAN_PROG --path xfs_db) + +case "$MANPAGE" in +*.gz|*.z\|*.Z) CAT=zcat;; +*.bz2) CAT=bzcat;; +*.xz) CAT=xzcat;; +*) CAT=cat;; +esac +_require_command `which $CAT` $CAT + +file=$TEST_DIR/xx.$seq +truncate -s 128m $file +$MKFS_XFS_PROG $file >> /dev/null + +for COMMAND in `$XFS_DB_PROG -x -c help $file | awk '{print $1}' | grep -v "^Use"`; do + $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \ + echo "$COMMAND not documented in the xfs_db manpage" +done + +# success, all done +status=0 +exit diff --git a/tests/xfs/754.out b/tests/xfs/754.out new file mode 100644 index 00000000..9e7cda82 --- /dev/null +++ b/tests/xfs/754.out @@ -0,0 +1,2 @@ +QA output created by 754 +Silence is golden diff --git a/tests/xfs/755 b/tests/xfs/755 new file mode 100755 index 00000000..0e5d85ab --- /dev/null +++ b/tests/xfs/755 @@ -0,0 +1,53 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0-or-newer +# Copyright (c) 2020, Oracle and/or its affiliates. All Rights Reserved. +# +# FS QA Test No. 755 +# +# Ensure all xfs_quota commands are documented. + +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.* $file +} + +# get standard environment, filters and checks +. ./common/rc + +# real QA test starts here +_supported_fs xfs +_supported_os Linux +_require_command "$XFS_QUOTA_PROG" "xfs_quota" +_require_command "$MAN_PROG" man +_require_test + +echo "Silence is golden" + +MANPAGE=$($MAN_PROG --path xfs_quota) + +case "$MANPAGE" in +*.gz|*.z\|*.Z) CAT=zcat;; +*.bz2) CAT=bzcat;; +*.xz) CAT=xzcat;; +*) CAT=cat;; +esac +_require_command `which $CAT` $CAT + +for COMMAND in `$XFS_QUOTA_PROG -x -c help $file | awk '{print $1}' | grep -v "^Use"`; do + $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \ + echo "$COMMAND not documented in the xfs_quota manpage" +done + +# success, all done +status=0 +exit diff --git a/tests/xfs/755.out b/tests/xfs/755.out new file mode 100644 index 00000000..7c9ea51c --- /dev/null +++ b/tests/xfs/755.out @@ -0,0 +1,2 @@ +QA output created by 755 +Silence is golden diff --git a/tests/xfs/group b/tests/xfs/group index 522d4bc4..aadbb971 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -511,3 +511,5 @@ 511 auto quick quota 512 auto quick acl attr 513 auto mount +754 auto quick db +755 auto quick quota ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] xfs: make sure xfs_db/xfs_quota commands are documented 2020-03-04 2:46 ` [PATCH 3/3] xfs: make sure xfs_db/xfs_quota commands are documented Darrick J. Wong @ 2020-03-06 10:06 ` Zorro Lang 2020-03-06 15:41 ` Darrick J. Wong 0 siblings, 1 reply; 8+ messages in thread From: Zorro Lang @ 2020-03-06 10:06 UTC (permalink / raw) To: fstests; +Cc: linux-xfs On Tue, Mar 03, 2020 at 06:46:47PM -0800, Darrick J. Wong wrote: > From: Darrick J. Wong <darrick.wong@oracle.com> > > Make sure all the xfs_db/xfs_quota commands are documented. > > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> > --- The test cases make sense, and looks good to me, although it fails on most of xfsprogs versions currently. I think someone is fixing these missed docs, right :) One thing I noticed that: $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" The "^\.B.*$COMMAND" can match ".B report", but can't match something likes: " .B limit " If we don't recommend this format, we'd be better to change and avoid it in manual pages. Reviewd-by: Zorro Lang <zlang@redhat.com> Thanks, Zorro > tests/xfs/754 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/754.out | 2 ++ > tests/xfs/755 | 53 +++++++++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/755.out | 2 ++ > tests/xfs/group | 2 ++ > 5 files changed, 116 insertions(+) > create mode 100755 tests/xfs/754 > create mode 100644 tests/xfs/754.out > create mode 100755 tests/xfs/755 > create mode 100644 tests/xfs/755.out > > > diff --git a/tests/xfs/754 b/tests/xfs/754 > new file mode 100755 > index 00000000..ba0885be > --- /dev/null > +++ b/tests/xfs/754 > @@ -0,0 +1,57 @@ > +#! /bin/bash > +# SPDX-License-Identifier: GPL-2.0-or-newer > +# Copyright (c) 2020, Oracle and/or its affiliates. All Rights Reserved. > +# > +# FS QA Test No. 754 > +# > +# Ensure all xfs_db commands are documented. > + > +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.* $file > +} > + > +# get standard environment, filters and checks > +. ./common/rc > + > +# real QA test starts here > +_supported_fs xfs > +_supported_os Linux > +_require_command "$XFS_DB_PROG" "xfs_db" > +_require_command "$MAN_PROG" man > +_require_test > + > +echo "Silence is golden" > + > +MANPAGE=$($MAN_PROG --path xfs_db) > + > +case "$MANPAGE" in > +*.gz|*.z\|*.Z) CAT=zcat;; > +*.bz2) CAT=bzcat;; > +*.xz) CAT=xzcat;; > +*) CAT=cat;; > +esac > +_require_command `which $CAT` $CAT > + > +file=$TEST_DIR/xx.$seq > +truncate -s 128m $file > +$MKFS_XFS_PROG $file >> /dev/null > + > +for COMMAND in `$XFS_DB_PROG -x -c help $file | awk '{print $1}' | grep -v "^Use"`; do > + $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \ > + echo "$COMMAND not documented in the xfs_db manpage" > +done > + > +# success, all done > +status=0 > +exit > diff --git a/tests/xfs/754.out b/tests/xfs/754.out > new file mode 100644 > index 00000000..9e7cda82 > --- /dev/null > +++ b/tests/xfs/754.out > @@ -0,0 +1,2 @@ > +QA output created by 754 > +Silence is golden > diff --git a/tests/xfs/755 b/tests/xfs/755 > new file mode 100755 > index 00000000..0e5d85ab > --- /dev/null > +++ b/tests/xfs/755 > @@ -0,0 +1,53 @@ > +#! /bin/bash > +# SPDX-License-Identifier: GPL-2.0-or-newer > +# Copyright (c) 2020, Oracle and/or its affiliates. All Rights Reserved. > +# > +# FS QA Test No. 755 > +# > +# Ensure all xfs_quota commands are documented. > + > +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.* $file > +} > + > +# get standard environment, filters and checks > +. ./common/rc > + > +# real QA test starts here > +_supported_fs xfs > +_supported_os Linux > +_require_command "$XFS_QUOTA_PROG" "xfs_quota" > +_require_command "$MAN_PROG" man > +_require_test > + > +echo "Silence is golden" > + > +MANPAGE=$($MAN_PROG --path xfs_quota) > + > +case "$MANPAGE" in > +*.gz|*.z\|*.Z) CAT=zcat;; > +*.bz2) CAT=bzcat;; > +*.xz) CAT=xzcat;; > +*) CAT=cat;; > +esac > +_require_command `which $CAT` $CAT > + > +for COMMAND in `$XFS_QUOTA_PROG -x -c help $file | awk '{print $1}' | grep -v "^Use"`; do > + $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \ > + echo "$COMMAND not documented in the xfs_quota manpage" > +done > + > +# success, all done > +status=0 > +exit > diff --git a/tests/xfs/755.out b/tests/xfs/755.out > new file mode 100644 > index 00000000..7c9ea51c > --- /dev/null > +++ b/tests/xfs/755.out > @@ -0,0 +1,2 @@ > +QA output created by 755 > +Silence is golden > diff --git a/tests/xfs/group b/tests/xfs/group > index 522d4bc4..aadbb971 100644 > --- a/tests/xfs/group > +++ b/tests/xfs/group > @@ -511,3 +511,5 @@ > 511 auto quick quota > 512 auto quick acl attr > 513 auto mount > +754 auto quick db > +755 auto quick quota > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] xfs: make sure xfs_db/xfs_quota commands are documented 2020-03-06 10:06 ` Zorro Lang @ 2020-03-06 15:41 ` Darrick J. Wong 0 siblings, 0 replies; 8+ messages in thread From: Darrick J. Wong @ 2020-03-06 15:41 UTC (permalink / raw) To: fstests, linux-xfs On Fri, Mar 06, 2020 at 06:06:55PM +0800, Zorro Lang wrote: > On Tue, Mar 03, 2020 at 06:46:47PM -0800, Darrick J. Wong wrote: > > From: Darrick J. Wong <darrick.wong@oracle.com> > > > > Make sure all the xfs_db/xfs_quota commands are documented. > > > > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> > > --- > > The test cases make sense, and looks good to me, although it fails > on most of xfsprogs versions currently. I think someone is fixing > these missed docs, right :) Yes, the missing command documentation should be in 5.5. > One thing I noticed that: > $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" > > The "^\.B.*$COMMAND" can match ".B report", but can't match something > likes: > " > .B > limit > " > > If we don't recommend this format, we'd be better to change and avoid it in > manual pages. I also fixed that. > Reviewd-by: Zorro Lang <zlang@redhat.com> ^ need an 'e' here... --D > > Thanks, > Zorro > > > tests/xfs/754 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ > > tests/xfs/754.out | 2 ++ > > tests/xfs/755 | 53 +++++++++++++++++++++++++++++++++++++++++++++++++ > > tests/xfs/755.out | 2 ++ > > tests/xfs/group | 2 ++ > > 5 files changed, 116 insertions(+) > > create mode 100755 tests/xfs/754 > > create mode 100644 tests/xfs/754.out > > create mode 100755 tests/xfs/755 > > create mode 100644 tests/xfs/755.out > > > > > > diff --git a/tests/xfs/754 b/tests/xfs/754 > > new file mode 100755 > > index 00000000..ba0885be > > --- /dev/null > > +++ b/tests/xfs/754 > > @@ -0,0 +1,57 @@ > > +#! /bin/bash > > +# SPDX-License-Identifier: GPL-2.0-or-newer > > +# Copyright (c) 2020, Oracle and/or its affiliates. All Rights Reserved. > > +# > > +# FS QA Test No. 754 > > +# > > +# Ensure all xfs_db commands are documented. > > + > > +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.* $file > > +} > > + > > +# get standard environment, filters and checks > > +. ./common/rc > > + > > +# real QA test starts here > > +_supported_fs xfs > > +_supported_os Linux > > +_require_command "$XFS_DB_PROG" "xfs_db" > > +_require_command "$MAN_PROG" man > > +_require_test > > + > > +echo "Silence is golden" > > + > > +MANPAGE=$($MAN_PROG --path xfs_db) > > + > > +case "$MANPAGE" in > > +*.gz|*.z\|*.Z) CAT=zcat;; > > +*.bz2) CAT=bzcat;; > > +*.xz) CAT=xzcat;; > > +*) CAT=cat;; > > +esac > > +_require_command `which $CAT` $CAT > > + > > +file=$TEST_DIR/xx.$seq > > +truncate -s 128m $file > > +$MKFS_XFS_PROG $file >> /dev/null > > + > > +for COMMAND in `$XFS_DB_PROG -x -c help $file | awk '{print $1}' | grep -v "^Use"`; do > > + $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \ > > + echo "$COMMAND not documented in the xfs_db manpage" > > +done > > + > > +# success, all done > > +status=0 > > +exit > > diff --git a/tests/xfs/754.out b/tests/xfs/754.out > > new file mode 100644 > > index 00000000..9e7cda82 > > --- /dev/null > > +++ b/tests/xfs/754.out > > @@ -0,0 +1,2 @@ > > +QA output created by 754 > > +Silence is golden > > diff --git a/tests/xfs/755 b/tests/xfs/755 > > new file mode 100755 > > index 00000000..0e5d85ab > > --- /dev/null > > +++ b/tests/xfs/755 > > @@ -0,0 +1,53 @@ > > +#! /bin/bash > > +# SPDX-License-Identifier: GPL-2.0-or-newer > > +# Copyright (c) 2020, Oracle and/or its affiliates. All Rights Reserved. > > +# > > +# FS QA Test No. 755 > > +# > > +# Ensure all xfs_quota commands are documented. > > + > > +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.* $file > > +} > > + > > +# get standard environment, filters and checks > > +. ./common/rc > > + > > +# real QA test starts here > > +_supported_fs xfs > > +_supported_os Linux > > +_require_command "$XFS_QUOTA_PROG" "xfs_quota" > > +_require_command "$MAN_PROG" man > > +_require_test > > + > > +echo "Silence is golden" > > + > > +MANPAGE=$($MAN_PROG --path xfs_quota) > > + > > +case "$MANPAGE" in > > +*.gz|*.z\|*.Z) CAT=zcat;; > > +*.bz2) CAT=bzcat;; > > +*.xz) CAT=xzcat;; > > +*) CAT=cat;; > > +esac > > +_require_command `which $CAT` $CAT > > + > > +for COMMAND in `$XFS_QUOTA_PROG -x -c help $file | awk '{print $1}' | grep -v "^Use"`; do > > + $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \ > > + echo "$COMMAND not documented in the xfs_quota manpage" > > +done > > + > > +# success, all done > > +status=0 > > +exit > > diff --git a/tests/xfs/755.out b/tests/xfs/755.out > > new file mode 100644 > > index 00000000..7c9ea51c > > --- /dev/null > > +++ b/tests/xfs/755.out > > @@ -0,0 +1,2 @@ > > +QA output created by 755 > > +Silence is golden > > diff --git a/tests/xfs/group b/tests/xfs/group > > index 522d4bc4..aadbb971 100644 > > --- a/tests/xfs/group > > +++ b/tests/xfs/group > > @@ -511,3 +511,5 @@ > > 511 auto quick quota > > 512 auto quick acl attr > > 513 auto mount > > +754 auto quick db > > +755 auto quick quota > > > ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-03-06 15:41 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-03-04 2:46 [PATCH 0/3] fstests: random stuff Darrick J. Wong 2020-03-04 2:46 ` [PATCH 1/3] generic/402: skip test if xfs_io can't parse the date value Darrick J. Wong 2020-03-06 9:33 ` Zorro Lang 2020-03-04 2:46 ` [PATCH 2/3] xfs: refactor calls to xfs_admin Darrick J. Wong 2020-03-06 9:53 ` Zorro Lang 2020-03-04 2:46 ` [PATCH 3/3] xfs: make sure xfs_db/xfs_quota commands are documented Darrick J. Wong 2020-03-06 10:06 ` Zorro Lang 2020-03-06 15:41 ` Darrick J. Wong
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).