generic/233,270: unlimit the max locked memory size for io_uring
[xfstests-dev.git] / tests / xfs / 266
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2011 SGI.  All Rights Reserved.
4 #
5 # FS QA Test No. 266
6 #
7 # Test incremental dumps with -D (skip unchanged dirs)
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=0        # success 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 #
26 # Add a new file and append a subset of the fill'ed files
27 # So we can see if just these get dumped on an incremental
28 #
29 _add_and_append_dumpdir_fill()
30 {
31     cd $dump_dir
32     echo 'New file' >> newfile
33     _append_dumpdir_fill
34 }
35
36 # Quota files are stored as special files in the dumpdir of the incremental
37 # backup.  This throws off the directory/file count reported because xfsrestore
38 # includes the dumpdir in the restore summary counts.
39 filter_cumulative_quota_updates() {
40     $here/src/feature -U $SCRATCH_DEV && quota=1
41     $here/src/feature -G $SCRATCH_DEV && quota=1
42     $here/src/feature -P $SCRATCH_DEV && quota=1
43
44     $AWK_PROG -v quota=$quota '
45         /entries processed/ {
46                 if (quota) {$2--; $5--;}
47         }
48         {print}'
49 }
50
51 # get standard environment, filters and checks
52 . ./common/rc
53 . ./common/dump
54
55 # real QA test starts here
56 _supported_fs xfs
57
58 $XFSDUMP_PROG -h 2>&1 | grep -q -e -D
59 if [ $? -ne 0 ]; then
60     _notrun "requires xfsdump -D"
61 fi
62
63 _create_dumpdir_fill
64 # ensure file/dir timestamps precede dump timestamp
65 sleep 2
66 _do_dump_file -f $tmp.df.0
67 _add_and_append_dumpdir_fill
68 _do_dump_file -f $tmp.df.1 -l 1 -D
69 _prepare_restore_dir
70 _do_restore_file_cum -f $tmp.df.0
71 _do_restore_file_cum -f $tmp.df.1 | filter_cumulative_quota_updates
72 _ls_compare_sub
73 _diff_compare
74
75 # success, all done
76 exit