xfs/029: filter out "extended-header: cycle: 1" from output
[xfstests-dev.git] / tests / xfs / 301
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 301
6 #
7 # Verify multi-stream xfsdump/restore preserves extended attributes
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1        # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20     _cleanup_dump
21     cd /
22     rm -f $tmp.*
23 }
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/filter
28 . ./common/dump
29 . ./common/attr
30
31 # real QA test starts here
32
33 # Modify as appropriate.
34 _supported_fs xfs
35 _supported_os Linux
36 _require_scratch
37
38 # Extended attributes
39 attr_name=attrname
40 attr_value=1234
41
42 rm -f $seqres.full
43
44 _create_dumpdir_fill_ea
45
46 # Create and add wholly-sparse file to the dump directory
47 $XFS_IO_PROG -f -c "truncate 1t" $dump_dir/sparsefile >> $seqres.full 2>&1 \
48         || _fail "could not create \"$dump_dir\"/sparsefile"
49
50 # Set the xattr on sparsefile
51 $ATTR_PROG -s $attr_name -V $attr_value $dump_dir/sparsefile >> $seqres.full 2>&1 \
52         || _fail "could not set ATTR for \"$dump_dir\"/sparsefile"
53
54 _do_dump_multi_file --multi 4  >> $seqres.full 2>&1
55 _do_restore_multi_file --multi 4 >> $seqres.full 2>&1
56 _diff_compare_eas
57
58 status=0
59 exit