Update 062, because permissions now enforced in VFS and symlink/dev attrs are disallowed.
[xfstests-dev.git] / 064
1 #! /bin/sh
2 # FS QA Test No. 064
3 #
4 # test multilevel dump and restores with hardlinks
5 #
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
8 #-----------------------------------------------------------------------
9 #
10 # creator
11 owner=tes@sgi.com
12
13 seq=`basename $0`
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1        # failure is the default!
19 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
20
21 # get standard environment, filters and checks
22 . ./common.rc
23 . ./common.filter
24 . ./common.dump
25
26
27 _ls_size_filter()
28 {
29     #
30     # Print size ($5) and fname ($9).
31     # The size is significant since we add to the file as part
32     # of a file change for the incremental.
33     #
34     # Filter out the housekeeping files of xfsrestore
35     #
36     $AWK_PROG 'NF == 9 { print $5, $9 }' |\
37     egrep -v 'dumpdir|housekeeping|dirattr|dirextattr|namreg|state|tree' 
38 }
39
40 # real QA test starts here
41 _supported_fs xfs
42 _supported_os IRIX Linux
43
44 _create_dumpdir_hardlinks 9
45
46 echo "Do the incremental dumps"
47 i=0
48 while [ $i -le 9 ]; do
49     if [ $i -gt 0 ]; then
50         sleep 2
51         _modify_level $i
52         _stable_fs
53     fi 
54     echo "********* level $i ***********" >>$seq.full
55     date >>$seq.full
56     find $SCRATCH_MNT -exec $here/src/lstat64 {} \; | sed 's/(00.*)//' >$tmp.dates.$i
57     if [ $i -gt 0 ]; then
58        level_1=`expr $i - 1`
59        diff -c $tmp.dates.$level_1 $tmp.dates.$i >>$seq.full
60     else
61        cat $tmp.dates.$i >>$seq.full
62     fi
63
64     dump_file=$tmp.df.level$i
65     _do_dump_file -l $i
66     i=`expr $i + 1`     
67 done
68
69 echo "Listing of what files we start with:"
70 ls -l $dump_dir | _ls_size_filter
71
72 echo "Look at what files are contained in the inc. dump"
73 i=0
74 while [ $i -le 9 ]; do
75     echo ""
76     echo "restoring from df.level$i"
77     dump_file=$tmp.df.level$i
78     _do_restore_toc
79     i=`expr $i + 1`     
80 done
81
82 echo "Do the cumulative restores"
83 i=0
84 while [ $i -le 9 ]; do
85     dump_file=$tmp.df.level$i
86     echo ""
87     echo "restoring from df.level$i"
88     _do_restore_file_cum -l $i
89     echo "ls -l restore_dir"
90     ls -lR $restore_dir | _ls_size_filter | _check_quota_file
91     i=`expr $i + 1`     
92 done
93
94 # success, all done
95 status=0
96 exit