generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / xfs / 188
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2008 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 188
6 #
7 # drive the src/nametest program for CI mode
8 # which does a heap of open(create)/unlink/stat
9 # and checks that error codes make sense with its
10 # memory of the files created.
11 #
12 # All filenames generated map to the same hash
13 # value in XFS stressing leaf block traversal in
14 # node form directories as well.
15 #
16 . ./common/preamble
17 _begin_fstest ci dir auto
18
19 status=0        # success is the default!
20
21 # Override the default cleanup function.
22 _cleanup()
23 {
24     cd /
25     rm -f $tmp.*
26     rm -rf $SCRATCH_MNT/$seq
27 }
28
29 # Import common functions.
30 . ./common/filter
31
32 # real QA test starts here
33 _supported_fs xfs
34 _require_scratch
35 _require_xfs_mkfs_ciname
36
37 _scratch_mkfs -n version=ci >/dev/null 2>&1
38 _scratch_mount
39
40 sourcefile=$tmp.ci_nametest
41 seed=1
42
43 # need to create an input file with a list of filenames on each line
44 # do number of files for testing to try each directory format
45
46 # start with small number of files and increase by 4x for each run
47 max_files=6144
48 num_files=6
49
50 mkdir $SCRATCH_MNT/$seq
51 while [ $num_files -le $max_files ]; do
52   iterations=`expr $num_files \* 10`
53   $here/src/genhashnames $SCRATCH_MNT/$seq/$num_files $num_files $seed >>$sourcefile
54   mkdir $SCRATCH_MNT/$seq/$num_files
55   $here/src/nametest -l $sourcefile -s $seed -i $iterations -z -c
56   num_files=`expr $num_files \* 4`
57 done
58
59 # success, all done
60 status=0
61 exit