Make the -l option default for check.
[xfstests-dev.git] / 089
1 #! /bin/sh
2 # FS QA Test No. 089
3 #
4 # Emulate the way Linux mount manipulates /etc/mtab to attempt to
5 # reproduce a possible bug in rename (see src/t_mtab.c).
6 #
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
9 #-----------------------------------------------------------------------
10 #
11 # creator
12 owner=nathans@sgi.com
13
14 seq=`basename $0`
15 echo "QA output created by $seq"
16
17 here=`pwd`
18 tmp=/tmp/$$
19 status=1        # failure is the default!
20 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
21
22 # get standard environment, filters and checks
23 . ./common.rc
24 . ./common.filter
25
26 addentries()
27 {
28         count=$1
29         pattern="%0$2d"
30
31         while [ $count -gt 0 ]; do
32                 touch `printf $pattern $count`
33                 count=`expr $count - 1`
34         done
35 }
36
37 # real QA test starts here
38 _supported_fs xfs
39 _supported_os Linux
40
41 rm -f $seq.full
42 [ "X$TEST_DIR" = "X" ] && exit 1
43 cd $TEST_DIR
44 rm -fr test
45 mkdir test || exit 1
46 cd $TEST_DIR/test
47 mount > t_mtab
48
49 mtab()
50 {
51         $here/src/t_mtab 50 &
52         $here/src/t_mtab 50 &
53         $here/src/t_mtab 50 &
54         wait
55
56         $here/src/t_mtab 10000
57
58         echo directory entries:
59         ls | grep mtab
60         echo directory entries >> $here/$seq.full
61         ls -li >> $here/$seq.full
62 }
63
64 # directory with only a few entries
65 mtab
66
67 # directory with a hundred more entries, each 4chars wide
68 addentries 100 4
69 mtab
70
71 # directory with a thousand more entries, each 8chars wide
72 addentries 1000 8
73 mtab
74
75 status=0
76 exit