280: test freeze deadlock w/ quotas
[xfstests-dev.git] / 100
1 #! /bin/bash
2 # FS QA Test No. 100. Modified from UDF QA test 030.
3 #
4 # Test whether a tarred directory structure can be untarred onto
5 # a UDF file system.
6 #
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
9 #
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation.
13 #
14 # This program is distributed in the hope that it would be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write the Free Software Foundation,
21 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22 #
23 #-----------------------------------------------------------------------
24 #
25 # creator
26 owner=ajones@sgi.com
27
28 seq=`basename $0`
29 echo "QA output created by $seq"
30
31 here=`pwd`
32 tmp=/tmp/$$
33 status=1        # failure is the default!
34 trap "_cleanup; exit \$status" 0 1 2 3 15
35
36 # get standard environment, filters and checks
37 . ./common.rc
38 . ./common.filter
39
40 _cleanup()
41 {
42      rm -f $tmp.* $testfile
43 }
44  
45 # real QA test starts here
46 _supported_fs generic
47 _supported_os IRIX Linux
48
49 # Use _populate_fs() in common.rc to create a directory structure.
50 TEMP_DIR=/tmp
51 [ "$FSTYP" == "xfs" ] && TEMP_DIR=$TEST_DIR
52 TAR_FILE=temp.tar
53 NDIRS=3
54 NFILES=6
55 DEPTH=5
56 POPULATED_DIR=$TEMP_DIR/populate_root
57 SIZE=10
58
59 rm -f $seq.full
60
61 # Clean up if file exist from prevous run
62 rm -rf $POPULATED_DIR
63 rm -f $TEMP_DIR/$TAR_FILE
64
65 # Create the new directory structure
66 _populate_fs -n $NDIRS -f $NFILES -d $DEPTH -r $POPULATED_DIR -s $SIZE >>$here/$seq.full 2>&1
67
68 # Then tar up the directory structure
69 tar -cvf $TEMP_DIR/$TAR_FILE $POPULATED_DIR >>$here/$seq.full 2>&1
70
71 # create f/s
72 _require_scratch
73 _setup_testdir
74
75 # untar on f/s
76 cd $testdir
77 tar -xRvf $TEMP_DIR/$TAR_FILE >>$here/$seq.full 2>&1
78 cd $here
79
80
81 # use diff -qr to compare
82 ls -R -l ${testdir}${POPULATED_DIR} >>$here/$seq.full 2>&1
83 diff -qr $POPULATED_DIR ${testdir}${POPULATED_DIR}
84
85 cd /
86 _cleanup_testdir
87 _check_scratch_fs
88
89 status=0
90 exit