fsx/fsstress: round blocksize properly
[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 seq=`basename $0`
15 seqres=$RESULT_DIR/$seq
16 echo "QA output created by $seq"
17
18 here=`pwd`
19 tmp=/tmp/$$
20 status=1        # failure is the default!
21 trap "_cleanup; exit \$status" 0 1 2 3 15
22
23 _cleanup()
24 {
25         cd /
26         rm -f $tmp.*
27 }
28
29 # get standard environment, filters and checks
30 . ./common/rc
31
32 # remove previous $seqres.full before test
33 rm -f $seqres.full
34
35 _require_check_dmesg
36 _supported_fs xfs
37 _require_scratch
38
39 log_tag()
40 {
41         echo "fstests $seqnum [tag]" > /dev/kmsg
42 }
43
44 dmesg_since_test_tag()
45 {
46         dmesg | tac | sed -ne "0,\#fstests $seqnum \[tag\]#p" | \
47                 tac
48 }
49
50 check_dmesg_for_since_tag()
51 {
52         dmesg_since_test_tag | egrep -q "$1"
53 }
54
55 echo "Silence is golden."
56
57
58 # Skip old kernels that did not print the warning yet
59 log_tag
60 _scratch_mkfs > $seqres.full 2>&1
61 _scratch_mount -o attr2
62 _scratch_unmount
63 check_dmesg_for_since_tag "XFS: attr2 mount option is deprecated" || \
64         _notrun "Deprecation warning are not printed at all."
65
66 # Test mount with default options (attr2 and noikeep) and remount with
67 # 2 groups of options
68 # 1) the defaults (attr2, noikeep)
69 # 2) non defaults (noattr2, ikeep)
70 _scratch_mount
71 for VAR in {attr2,noikeep}; do
72         log_tag
73         _scratch_remount $VAR
74         check_dmesg_for_since_tag "XFS: $VAR mount option is deprecated." && \
75                 echo "Should not be able to find deprecation warning for $VAR"
76 done
77 for VAR in {noattr2,ikeep}; do
78         log_tag
79         _scratch_remount $VAR
80         check_dmesg_for_since_tag "XFS: $VAR mount option is deprecated" || \
81                 echo "Could not find deprecation warning for $VAR"
82 done
83 _scratch_unmount
84
85 # success, all done
86 status=0
87 exit