5 # Testing incremental dumps and cumulative restores with
6 # "adding, deleting, renaming, linking, and unlinking files and
8 # Do different operations for each level.
10 #-----------------------------------------------------------------------
11 # Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
13 # This program is free software; you can redistribute it and/or modify it
14 # under the terms of version 2 of the GNU General Public License as
15 # published by the Free Software Foundation.
17 # This program is distributed in the hope that it would be useful, but
18 # WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 # Further, this software is distributed without any warranty that it is
22 # free of the rightful claim of any third person regarding infringement
23 # or the like. Any license provided herein, whether implied or
24 # otherwise, applies only to this software file. Patent licenses, if
25 # any, provided herein do not apply to combinations of this program with
26 # other software, or any other product whatsoever.
28 # You should have received a copy of the GNU General Public License along
29 # with this program; if not, write the Free Software Foundation, Inc., 59
30 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
32 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
33 # Mountain View, CA 94043, or:
37 # For further information regarding this notice, see:
39 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
40 #-----------------------------------------------------------------------
43 owner=tes@sagan.melbourne.sgi.com
46 echo "QA output created by $seq"
50 status=1 # failure is the default!
51 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
53 # get standard environment, filters and checks
62 # Print size ($5) and fname ($9).
63 # The size is significant since we add to the file as part
64 # of a file change for the incremental.
66 # Filter out the housekeeping files of xfsrestore
67 # Filter out toplevel "dumpdir/$" report.
69 $AWK_PROG 'NF == 9 { print $5, $9; next }
71 sed -e 's/.*dumpdir/dumpdir/' |\
72 egrep -v 'housekeeping|dirattr|dirextattr|namreg|state|tree|dumpdir/$' |\
73 egrep -v "$restore_dir:"
76 # real QA test starts here
79 # too much hassle to get output matching with quotas turned on
82 mount -t xfs $SCRATCH_DEV $SCRATCH_MNT
83 $here/src/feature -U $SCRATCH_DEV && _notrun "do not run with user quotas"
84 $here/src/feature -G $SCRATCH_DEV && _notrun "do not run with group quotas"
88 # adding - touch/echo, mkdir
89 # deleting - rm, rmdir
93 # files and directories
97 mkdir -p $dump_dir ||\
98 _error "cannot mkdir \"$dump_dir\""
101 echo "Do the incremental dumps"
103 num_dumps=8 # do some extra to ensure nothing changes
104 while [ $i -le $num_dumps ]; do
109 echo 'add0' >addedfile0
110 echo 'add1' >addedfile1
111 echo 'add2' >addedfile2
112 echo 'add3' >addedfile3
117 echo 'add4' >addeddir3/addedfile4
118 echo 'add5' >addeddir4/addedfile5
128 mv addedfile1 addedfile2 # rename to previous existing file
129 mv addeddir4/addedfile5 addeddir4/addedfile4
130 mv addeddir4 addeddir6
131 mv addeddir1 addeddir2 # rename to previous existing dir
135 ln addedfile0 linkfile0
136 ln addedfile0 linkfile0_1 # have a 2nd link to file
137 ln addedfile2 linkfile2
138 ln addeddir6/addedfile4 linkfile64
142 rm linkfile0 # remove a link
143 rm addedfile2 # remove original link
144 rm linkfile64 # remove link
145 rm addeddir6/addedfile4 # remove last link
147 5) # link first - then onto 6)
149 echo 'add6' >addedfile6
150 ln addedfile6 linkfile6_1
151 ln addedfile6 linkfile6_2
152 ln addedfile6 linkfile6_3
154 6) # then move the inode that the links point to
155 mv addedfile6 addedfile6_mv
159 ln addedfile6_mv linkfile6_mv_1
160 ln addedfile6_mv linkfile6_mv_2
161 ln addedfile6_mv linkfile6_mv_3
168 echo "Listing of what files we have at level $i:"
169 ls -lRF $dump_dir | _my_ls_filter | tee $tmp.ls.$i
171 dump_file=$tmp.df.level$i
176 echo "Look at what files are contained in the inc. dump"
178 while [ $i -le $num_dumps ]; do
180 echo "restoring from df.level$i"
181 dump_file=$tmp.df.level$i
186 echo "Do the cumulative restores"
188 while [ $i -le $num_dumps ]; do
189 dump_file=$tmp.df.level$i
191 echo "restoring from df.level$i"
192 _do_restore_file_cum -l $i
193 echo "ls -lRF restore_dir"
194 ls -lRF $restore_dir | _my_ls_filter |\
195 _check_quota_file | tee $tmp.restorals.$i
200 echo "Do the ls comparison"
202 while [ $i -le $num_dumps ]; do
203 echo "Comparing ls of FS with restored FS at level $i"
204 diff -s $tmp.ls.$i $tmp.restorals.$i | sed "s#$tmp#TMP#g"