d44533d6811469a915ac75790606bd4d3a0c8beb
[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 . ./common/preamble
10 _begin_fstest auto dump
11
12 # Override the default cleanup function.
13 _cleanup()
14 {
15     _cleanup_dump
16     cd /
17     rm -f $tmp.*
18 }
19
20 # Import common functions.
21 . ./common/filter
22 . ./common/dump
23 . ./common/attr
24
25 # real QA test starts here
26
27 # Modify as appropriate.
28 _supported_fs xfs
29 _require_scratch
30
31 # Extended attributes
32 attr_name=attrname
33 attr_value=1234
34
35 _create_dumpdir_fill_ea
36
37 # Create and add wholly-sparse file to the dump directory
38 $XFS_IO_PROG -f -c "truncate 1t" $dump_dir/sparsefile >> $seqres.full 2>&1 \
39         || _fail "could not create \"$dump_dir\"/sparsefile"
40
41 # Set the xattr on sparsefile
42 $ATTR_PROG -s $attr_name -V $attr_value $dump_dir/sparsefile >> $seqres.full 2>&1 \
43         || _fail "could not set ATTR for \"$dump_dir\"/sparsefile"
44
45 _do_dump_multi_file --multi 4  >> $seqres.full 2>&1
46 _do_restore_multi_file --multi 4 >> $seqres.full 2>&1
47 _diff_compare_eas
48
49 status=0
50 exit