generic: convert tests to SPDX license tags
[xfstests-dev.git] / tests / generic / 100
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 100. Modified from UDF QA test 030.
6 #
7 # Test whether a tarred directory structure can be untarred onto
8 # a UDF file system.
9 #
10 seq=`basename $0`
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
13
14 here=`pwd`
15 tmp=/tmp/$$
16 status=1        # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
18
19 # get standard environment, filters and checks
20 . ./common/rc
21 . ./common/filter
22
23 _cleanup()
24 {
25      rm -f $tmp.* $TEMP_DIR/$TAR_FILE
26 }
27  
28 # real QA test starts here
29 _supported_fs generic
30 _supported_os Linux
31 _require_test
32
33 # Use _populate_fs() in common/rc to create a directory structure.
34 TEMP_DIR=/tmp
35 [ "$FSTYP" == "xfs" ] && TEMP_DIR=$TEST_DIR
36 TAR_FILE=temp.tar
37 NDIRS=3
38 NFILES=6
39 DEPTH=5
40 POPULATED_DIR=$TEMP_DIR/populate_root
41 SIZE=10
42
43 rm -f $seqres.full
44
45 # Clean up if file exist from prevous run
46 rm -rf $POPULATED_DIR
47 rm -f $TEMP_DIR/$TAR_FILE
48
49 # Create the new directory structure
50 _populate_fs -n $NDIRS -f $NFILES -d $DEPTH -r $POPULATED_DIR -s $SIZE >>$seqres.full 2>&1
51
52 # Then tar up the directory structure
53 tar -cvf $TEMP_DIR/$TAR_FILE $POPULATED_DIR >>$seqres.full 2>&1
54
55 # create f/s
56 _require_scratch
57
58 # untar on f/s
59 cd $TEST_DIR
60 tar -xvf $TEMP_DIR/$TAR_FILE >>$seqres.full 2>&1
61 cd $here
62
63 # use diff -qr to compare
64 ls -R -l ${TEST_DIR}${POPULATED_DIR} >>$seqres.full 2>&1
65 diff -qr $POPULATED_DIR ${TEST_DIR}${POPULATED_DIR}
66
67 cd /
68
69 status=0
70 exit