generic: test deadlock on O_DIRECT|O_DSYNC
[xfstests-dev.git] / tests / generic / 007
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 007
6 #
7 # drive the src/nametest program
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 seq=`basename $0`
13 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=0        # success is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
20
21 _cleanup()
22 {
23     cd /
24     rm -f $tmp.*
25     rm -rf $TEST_DIR/$seq
26 }
27
28 # get standard environment, filters and checks
29 . ./common/rc
30 . ./common/filter
31
32 # real QA test starts here
33 _supported_fs generic
34 _supported_os Linux
35 _require_test
36
37 status=1 # default failure 
38 sourcefile=$tmp.nametest
39 seed=1
40 iterations=100000
41 num_filenames=100
42
43 # need to create an input file with a list of
44 # filenames on each line 
45 i=1
46 while [ $i -le $num_filenames ]; do
47   echo "nametest.$i" >>$sourcefile
48   let i=$i+1
49 done
50
51 rm -rf $TEST_DIR/$seq
52 mkdir $TEST_DIR/$seq
53 cd $TEST_DIR/$seq
54 $here/src/nametest -l $sourcefile -s $seed -i $iterations -z
55
56 # success, all done
57 status=0
58 exit