fstests: move test group info to test files
[xfstests-dev.git] / tests / generic / 486
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2018 Oracle.  All Rights Reserved.
4 #
5 # FS QA Test No. 486
6 #
7 # Ensure that we can XATTR_REPLACE a tiny attr into a large attr.
8 # Kanda Motohiro <kanda.motohiro@gmail.com> reports that XATTR_REPLACE'ing
9 # a single-byte attr with a 2048-byte attr causes a fs shutdown because we
10 # remove the shortform attr, convert the attr fork to long format, and then
11 # try to re-add the attr having not cleared ATTR_REPLACE.
12 #
13 # Commit 7b38460dc8e4 ("xfs: don't fail when converting shortform attr to long
14 # form during ATTR_REPLACE") fixed the xfs bug.
15 #
16 . ./common/preamble
17 _begin_fstest auto quick attr
18
19 # Override the default cleanup function.
20 _cleanup()
21 {
22         cd /
23         rm -f $testfile
24 }
25
26 # Import common functions.
27 . ./common/filter
28 . ./common/attr
29
30 # real QA test starts here
31 _supported_fs generic
32 _require_test_program "attr_replace_test"
33 _require_attrs
34 _require_scratch
35
36 _scratch_mkfs >>$seqres.full 2>&1
37 _scratch_mount >>$seqres.full 2>&1
38
39 filter_attr_output() {
40         _filter_scratch | grep world | \
41                 sed -e 's/has a [0-9]* byte value/has a NNNN byte value/g'
42 }
43
44 $here/src/attr_replace_test $SCRATCH_MNT/hello
45 $ATTR_PROG -l $SCRATCH_MNT/hello >>$seqres.full 2>&1
46 $ATTR_PROG -l $SCRATCH_MNT/hello | filter_attr_output
47
48 status=0
49 exit