327bbe9cf6f5a2bde3fe3f0429df1067bd5641c7
[xfstests-dev.git] / tests / generic / 007
1 #! /bin/bash
2 # FS QA Test No. 007
3 #
4 # drive the src/nametest program
5 # which does a heap of open(create)/unlink/stat
6 # and checks that error codes make sense with its
7 # memory of the files created.
8 #
9 #-----------------------------------------------------------------------
10 # Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
11 #
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License as
14 # published by the Free Software Foundation.
15 #
16 # This program is distributed in the hope that it would be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write the Free Software Foundation,
23 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
24 #
25 #-----------------------------------------------------------------------
26 #
27
28 seq=`basename $0`
29 seqres=$RESULT_DIR/$seq
30 echo "QA output created by $seq"
31
32 here=`pwd`
33 tmp=/tmp/$$
34 status=0        # success is the default!
35 trap "_cleanup; exit \$status" 0 1 2 3 15
36
37 _cleanup()
38 {
39     cd /
40     rm -f $tmp.*
41     rm -rf $TEST_DIR/$seq
42 }
43
44 # get standard environment, filters and checks
45 . ./common/rc
46 . ./common/filter
47
48 # real QA test starts here
49 _supported_fs generic
50 _supported_os Linux
51 _require_test
52
53 status=1 # default failure 
54 sourcefile=$tmp.nametest
55 seed=1
56 iterations=100000
57 num_filenames=100
58
59 # need to create an input file with a list of
60 # filenames on each line 
61 i=1
62 while [ $i -le $num_filenames ]; do
63   echo "nametest.$i" >>$sourcefile
64   let i=$i+1
65 done
66
67 rm -rf $TEST_DIR/$seq
68 mkdir $TEST_DIR/$seq
69 cd $TEST_DIR/$seq
70 $here/src/nametest -l $sourcefile -s $seed -i $iterations -z
71
72 # success, all done
73 status=0
74 exit