common/rc: add _scratch_{u}mount_idmapped() helpers
[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 seq=`basename $0`
17 seqres=$RESULT_DIR/$seq
18 echo "QA output created by $seq"
19
20 here=`pwd`
21 tmp=/tmp/$$
22 status=0        # success is the default!
23 trap "_cleanup; exit \$status" 0 1 2 3 15
24
25 _cleanup()
26 {
27     cd /
28     rm -f $tmp.*
29     rm -rf $SCRATCH_MNT/$seq
30 }
31
32 # get standard environment, filters and checks
33 . ./common/rc
34 . ./common/filter
35
36 # real QA test starts here
37 _supported_fs xfs
38 _require_scratch
39 _require_xfs_mkfs_ciname
40 rm -f $seqres.full
41
42 _scratch_mkfs -n version=ci >/dev/null 2>&1
43 _scratch_mount
44
45 status=1 # default failure
46 sourcefile=$tmp.ci_nametest
47 seed=1
48
49 # need to create an input file with a list of filenames on each line
50 # do number of files for testing to try each directory format
51
52 # start with small number of files and increase by 4x for each run
53 max_files=6144
54 num_files=6
55
56 mkdir $SCRATCH_MNT/$seq
57 while [ $num_files -le $max_files ]; do
58   iterations=`expr $num_files \* 10`
59   $here/src/genhashnames $SCRATCH_MNT/$seq/$num_files $num_files $seed >>$sourcefile
60   mkdir $SCRATCH_MNT/$seq/$num_files
61   $here/src/nametest -l $sourcefile -s $seed -i $iterations -z -c
62   num_files=`expr $num_files \* 4`
63 done
64
65 # success, all done
66 status=0
67 exit