xfstests: stop special casing nfs and udf
[xfstests-dev.git] / tests / generic / 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
26 seq=`basename $0`
27 seqres=$RESULT_DIR/$seq
28 echo "QA output created by $seq"
29
30 here=`pwd`
31 tmp=/tmp/$$
32 status=1        # failure is the default!
33 trap "_cleanup; exit \$status" 0 1 2 3 15
34
35 # get standard environment, filters and checks
36 . ./common/rc
37 . ./common/filter
38
39 _cleanup()
40 {
41      rm -f $tmp.* $testfile
42 }
43  
44 # real QA test starts here
45 _supported_fs generic
46 _supported_os IRIX Linux
47
48 # Use _populate_fs() in common/rc to create a directory structure.
49 TEMP_DIR=/tmp
50 [ "$FSTYP" == "xfs" ] && TEMP_DIR=$TEST_DIR
51 TAR_FILE=temp.tar
52 NDIRS=3
53 NFILES=6
54 DEPTH=5
55 POPULATED_DIR=$TEMP_DIR/populate_root
56 SIZE=10
57
58 rm -f $seqres.full
59
60 # Clean up if file exist from prevous run
61 rm -rf $POPULATED_DIR
62 rm -f $TEMP_DIR/$TAR_FILE
63
64 # Create the new directory structure
65 _populate_fs -n $NDIRS -f $NFILES -d $DEPTH -r $POPULATED_DIR -s $SIZE >>$seqres.full 2>&1
66
67 # Then tar up the directory structure
68 tar -cvf $TEMP_DIR/$TAR_FILE $POPULATED_DIR >>$seqres.full 2>&1
69
70 # create f/s
71 _require_scratch
72
73 # untar on f/s
74 cd $TEST_DIR
75 tar -xRvf $TEMP_DIR/$TAR_FILE >>$seqres.full 2>&1
76 cd $here
77
78 # use diff -qr to compare
79 ls -R -l ${TEST_DIR}${POPULATED_DIR} >>$seqres.full 2>&1
80 diff -qr $POPULATED_DIR ${TEST_DIR}${POPULATED_DIR}
81
82 cd /
83 _check_scratch_fs
84
85 status=0
86 exit