All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Reichl <preichl@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH v2] xfs: Add test for printing deprec. mount options
Date: Wed, 24 Feb 2021 22:43:21 +0100	[thread overview]
Message-ID: <20210224214323.394286-2-preichl@redhat.com> (raw)
In-Reply-To: <20210224214323.394286-1-preichl@redhat.com>

Verify that warnings about deprecated mount options are properly
printed.

Verify that no excessive warnings are printed during remounts.

Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
 tests/xfs/528     | 86 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/528.out |  2 ++
 tests/xfs/group   |  1 +
 3 files changed, 89 insertions(+)
 create mode 100755 tests/xfs/528
 create mode 100644 tests/xfs/528.out

diff --git a/tests/xfs/528 b/tests/xfs/528
new file mode 100755
index 00000000..111a3770
--- /dev/null
+++ b/tests/xfs/528
@@ -0,0 +1,86 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2020 Red Hat, Inc.. All Rights Reserved.
+#
+# FS QA Test 528
+#
+# Verify that warnings about deprecated mount options are properly printed.
+#
+# Verify that no excessive warnings are printed during remounts.
+#
+
+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
+umount $SCRATCH_MNT
+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
+umount $SCRATCH_MNT
+
+# success, all done
+status=0
+exit
+
diff --git a/tests/xfs/528.out b/tests/xfs/528.out
new file mode 100644
index 00000000..762dccc0
--- /dev/null
+++ b/tests/xfs/528.out
@@ -0,0 +1,2 @@
+QA output created by 528
+Silence is golden.
diff --git a/tests/xfs/group b/tests/xfs/group
index e861cec9..ad3bd223 100644
--- a/tests/xfs/group
+++ b/tests/xfs/group
@@ -525,3 +525,4 @@
 525 auto quick mkfs
 526 auto quick mkfs
 527 auto quick quota
+528 auto quick mount
-- 
2.29.2


  reply	other threads:[~2021-02-24 21:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24 21:43 [PATCH v2 0/2] xfs: Skip repetitive warnings about mount options Pavel Reichl
2021-02-24 21:43 ` Pavel Reichl [this message]
2021-02-24 21:43 ` [PATCH v2 1/2] xfs: rename variable mp to parsing_mp Pavel Reichl
2021-02-25  2:40   ` Darrick J. Wong
2021-03-09 11:42   ` Carlos Maiolino
2021-02-24 21:43 ` [PATCH v2 2/2] xfs: Skip repetitive warnings about mount options Pavel Reichl
2021-02-25  2:41   ` Darrick J. Wong
2021-03-09 11:44   ` Carlos Maiolino
2021-03-19 22:20 [PATCH v2] xfs/529: Add test for printing deprec. " Pavel Reichl
2021-03-28 14:18 ` [PATCH v2] xfs: " Eryu Guan

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=20210224214323.394286-2-preichl@redhat.com \
    --to=preichl@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    /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.