generic/233,270: unlimit the max locked memory size for io_uring
[xfstests-dev.git] / tests / xfs / 503
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0+
3 # Copyright (c) 2019 Oracle, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 503
6 #
7 # Populate a XFS filesystem and ensure that metadump, mdrestore, and copy
8 # all work properly.
9 #
10 seq=`basename $0`
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
13
14 here=`pwd`
15 tmp=/tmp/$$
16 status=1        # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 7 15
18
19 _cleanup()
20 {
21         cd /
22         rm -rf $tmp.* $testdir
23 }
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/filter
28 . ./common/populate
29
30 testdir=$TEST_DIR/test-$seq
31
32 # real QA test starts here
33 _supported_fs xfs
34
35 _require_xfs_copy
36 _require_scratch_nocheck
37 _require_populate_commands
38
39 echo "Format and populate"
40 _scratch_populate_cached nofill > $seqres.full 2>&1
41
42 mkdir -p $testdir
43 metadump_file=$testdir/scratch.md
44 metadump_file_a=${metadump_file}.a
45 metadump_file_g=${metadump_file}.g
46 metadump_file_ag=${metadump_file}.ag
47 copy_file=$testdir/copy.img
48
49 echo metadump
50 _scratch_xfs_metadump $metadump_file >> $seqres.full
51
52 echo metadump a
53 _scratch_xfs_metadump $metadump_file_a -a >> $seqres.full
54
55 echo metadump g
56 _scratch_xfs_metadump $metadump_file_g -g >> $seqres.full
57
58 echo metadump ag
59 _scratch_xfs_metadump $metadump_file_ag -a -g >> $seqres.full
60
61 echo copy
62 $XFS_COPY_PROG $SCRATCH_DEV $copy_file >> $seqres.full
63 _check_scratch_fs $copy_file
64
65 echo recopy
66 $XFS_COPY_PROG $copy_file $SCRATCH_DEV >> $seqres.full
67 _scratch_mount
68 _check_scratch_fs
69 _scratch_unmount
70
71 echo mdrestore
72 xfs_mdrestore $metadump_file $SCRATCH_DEV
73 _scratch_mount
74 _check_scratch_fs
75 _scratch_unmount
76
77 echo mdrestore a
78 xfs_mdrestore $metadump_file_a $SCRATCH_DEV
79 _scratch_mount
80 _check_scratch_fs
81 _scratch_unmount
82
83 echo mdrestore g
84 xfs_mdrestore $metadump_file_g $SCRATCH_DEV
85 _scratch_mount
86 _check_scratch_fs
87 _scratch_unmount
88
89 echo mdrestore ag
90 xfs_mdrestore $metadump_file_ag $SCRATCH_DEV
91 _scratch_mount
92 _check_scratch_fs
93 _scratch_unmount
94
95 # success, all done
96 status=0
97 exit