fstests: move test group info to test files
[xfstests-dev.git] / tests / xfs / 539
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2020 Red Hat, Inc.. All Rights Reserved.
4 #
5 # FS QA Test 539
6 #
7 # https://bugzilla.kernel.org/show_bug.cgi?id=211605
8 # Verify that the warnings are not printed on remount if the mount option has
9 # the same value as during the mount
10 #
11 # Regression test for commit:
12 # xfs: Skip repetitive warnings about mount options
13
14 . ./common/preamble
15 _begin_fstest auto quick mount
16
17 # Import common functions.
18
19 _require_check_dmesg
20 _supported_fs xfs
21 _require_scratch
22
23 log_tag()
24 {
25         echo "fstests $seqnum [tag]" > /dev/kmsg
26 }
27
28 dmesg_since_test_tag()
29 {
30         dmesg | tac | sed -ne "0,\#fstests $seqnum \[tag\]#p" | \
31                 tac
32 }
33
34 check_dmesg_for_since_tag()
35 {
36         dmesg_since_test_tag | egrep -q "$1"
37 }
38
39 echo "Silence is golden."
40
41 # Skip old kernels that did not print the warning yet
42 log_tag
43 _scratch_mkfs > $seqres.full 2>&1
44 _scratch_mount -o attr2
45 _scratch_unmount
46 check_dmesg_for_since_tag "XFS: attr2 mount option is deprecated" || \
47         _notrun "Deprecation warning are not printed at all."
48
49 # Test mount with default options (attr2 and noikeep) and remount with
50 # 2 groups of options
51 # 1) the defaults (attr2, noikeep)
52 # 2) non defaults (noattr2, ikeep)
53 _scratch_mount
54 for VAR in {attr2,noikeep}; do
55         log_tag
56         _scratch_remount $VAR
57         check_dmesg_for_since_tag "XFS: $VAR mount option is deprecated." && \
58                 echo "Should not be able to find deprecation warning for $VAR"
59 done
60 for VAR in {noattr2,ikeep}; do
61         log_tag
62         _scratch_remount $VAR
63         check_dmesg_for_since_tag "XFS: $VAR mount option is deprecated" || \
64                 echo "Could not find deprecation warning for $VAR"
65 done
66 _scratch_unmount
67
68 # success, all done
69 status=0
70 exit