50a84181a45c3f51a6c9177241212dfabb29f78d
[xfstests-dev.git] / 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 # creator
28 owner=tes@sgi.com
29
30 seq=`basename $0`
31 echo "QA output created by $seq"
32
33 here=`pwd`
34 tmp=/tmp/$$
35 status=0        # success is the default!
36 trap "_cleanup; exit \$status" 0 1 2 3 15
37
38 _cleanup()
39 {
40     cd /
41     rm -f $tmp.*
42     rm -rf $testdir/$seq
43     _cleanup_testdir
44 }
45
46 # get standard environment, filters and checks
47 . ./common.rc
48 . ./common.filter
49
50 # real QA test starts here
51 _supported_fs generic
52 _supported_os IRIX Linux
53
54 _setup_testdir
55
56 status=1 # default failure 
57 sourcefile=$tmp.nametest
58 seed=1
59 iterations=100000
60 num_filenames=100
61
62 # need to create an input file with a list of
63 # filenames on each line 
64 i=1
65 while [ $i -le $num_filenames ]; do
66   echo "nametest.$i" >>$sourcefile
67   let i=$i+1
68 done
69
70 mkdir $testdir/$seq
71 cd $testdir/$seq
72 $here/src/nametest -l $sourcefile -s $seed -i $iterations -z
73
74 # success, all done
75 status=0
76 exit