xfs/529: Add test for printing deprec. mount options
PATCH v2 1/1 xfs/529: Add test for printing deprec. mount options
Verify that warnings about deprecated mount options are properly printed.
Verify that no excessive warnings are printed during remounts.
Signed-off-by Pavel Reichl <[email protected]>
--- tests/xfs/529 | 87 +++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/529.out | 2 ++ tests/xfs/group | 1 + 3 files changed, 90 insertions(+) create mode 100755 tests/xfs/529 create mode 100644 tests/xfs/529.out
tests/xfs/529 new file +87 -0
@@ -0,0 +1,87 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2020 Red Hat, Inc.. All Rights Reserved. +# +# FS QA Test 529 +# +# https://bugzilla.kernel.org/show_bug.cgi?id=211605 +# Verify that the warnings are not printed on remount if the mount option has +# the same value as during the mount +# +# Regression test for commit: +# xfs: Skip repetitive warnings about mount options + +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.* +} + +# get standard environment, filters and checks +. ./common/rc + +# remove previous $seqres.full before test +rm -f $seqres.full + +_require_check_dmesg +_supported_fs xfs +_require_scratch + +log_tag() +{ + echo "fstests $seqnum [tag]" > /dev/kmsg +} + +dmesg_since_test_tag() +{ + dmesg | tac | sed -ne "0,\#fstests $seqnum \[tag\]#p" | \ + tac +} + +check_dmesg_for_since_tag() +{ + dmesg_since_test_tag | egrep -q "$1" +} + +echo "Silence is golden." + + +# Skip old kernels that did not print the warning yet +log_tag +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount -o attr2 +_scratch_unmount +check_dmesg_for_since_tag "XFS: attr2 mount option is deprecated" || \ + _notrun "Deprecation warning are not printed at all." + +# Test mount with default options (attr2 and noikeep) and remount with +# 2 groups of options +# 1) the defaults (attr2, noikeep) +# 2) non defaults (noattr2, ikeep) +_scratch_mount +for VAR in {attr2,noikeep}; do + log_tag + mount -o $VAR,remount $SCRATCH_MNT + check_dmesg_for_since_tag "XFS: $VAR mount option is deprecated." && \ + echo "Should not be able to find deprecation warning for $VAR" +done +for VAR in {noattr2,ikeep}; do + log_tag + mount -o $VAR,remount $SCRATCH_MNT + check_dmesg_for_since_tag "XFS: $VAR mount option is deprecated" || \ + echo "Could not find deprecation warning for $VAR" +done +_scratch_unmount + +# success, all done +status=0 +exit
tests/xfs/529.out new file +2 -0
@@ -0,0 +1,2 @@ +QA output created by 529 +Silence is golden.
tests/xfs/group +1 -0
@@ -505,3 +505,4 @@ 526 auto quick mkfs 527 auto quick quota 528 auto quick rw realtime +529 auto quick mount
Signature · 1 line
2.30.2
Re: [PATCH v2] xfs: Add test for printing deprec. mount options
Quoted 83 lines · Pavel Reichl
Verify that warnings about deprecated mount options are properly printed.
Verify that no excessive warnings are printed during remounts.
Signed-off-by Pavel Reichl <[email protected]>--- tests/xfs/539 | 87 +++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/539.out | 2 ++ tests/xfs/group | 1 + 3 files changed, 90 insertions(+) create mode 100755 tests/xfs/539 create mode 100644 tests/xfs/539.outtests/xfs/539 new file +63
-0@@ -0,0 +1,87 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2020 Red Hat, Inc.. All Rights Reserved. +# +# FS QA Test 539 +# +# https://bugzilla.kernel.org/show_bug.cgi?id=211605 +# Verify that the warnings are not printed on remount if the mount option has +# the same value as during the mount +# +# Regression test for commit: +# xfs: Skip repetitive warnings about mount options + +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.* +} + +# get standard environment, filters and checks +. ./common/rc + +# remove previous $seqres.full before test +rm -f $seqres.full + +_require_check_dmesg +_supported_fs xfs +_require_scratch + +log_tag() +{ + echo "fstests $seqnum [tag]" > /dev/kmsg +} + +dmesg_since_test_tag() +{ + dmesg | tac | sed -ne "0,\#fstests $seqnum \[tag\]#p" | \ + tac +} + +check_dmesg_for_since_tag() +{ + dmesg_since_test_tag | egrep -q "$1" +} + +echo "Silence is golden." + + +# Skip old kernels that did not print the warning yet +log_tag +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount -o attr2 +_scratch_unmount +check_dmesg_for_since_tag "XFS: attr2 mount option is deprecated" || \
tests/xfs/539 line 73
Quoted 10 lines
tests/xfs/539 new file +10
-0+ _notrun "Deprecation warning are not printed at all." + +# Test mount with default options (attr2 and noikeep) and remount with +# 2 groups of options +# 1) the defaults (attr2, noikeep) +# 2) non defaults (noattr2, ikeep) +_scratch_mount +for VAR in {attr2,noikeep}; do + log_tag + mount -o $VAR,remount $SCRATCH_MNT
I changed this to _scratch_remount $VAR
tests/xfs/539 line 79
Quoted 6 lines
tests/xfs/539 new file +6
-0+ check_dmesg_for_since_tag "XFS: $VAR mount option is deprecated." && \ + echo "Should not be able to find deprecation warning for $VAR" +done +for VAR in {noattr2,ikeep}; do + log_tag + mount -o $VAR,remount $SCRATCH_MNT
Same here.
Otherwise patch looks fine to me, thanks!
Eryu
Quoted 18 lines
tests/xfs/539 new file +8
-0+ check_dmesg_for_since_tag "XFS: $VAR mount option is deprecated" || \ + echo "Could not find deprecation warning for $VAR" +done +_scratch_unmount + +# success, all done +status=0 +exittests/xfs/539.out new file +2
-0@@ -0,0 +1,2 @@ +QA output created by 539 +Silence is golden.Signature · 1 line
2.30.2