The cumulative restore tests call _do_restore_file_cum(),
which requires a dump level to be passed in the -l option
in order to determine whether the restore directory needs
to be prepared or not. -l is not a valid xfsrestore option,
so doing things this way prevents tests from passing options
to xfsrestore. It's more straightforward to have the test
call _prepare_restore_dir itself prior to starting a series
of cumulative restores.
Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
done
echo "Do the cumulative restores"
+_prepare_restore_dir
i=0
while [ $i -le 9 ]; do
dump_file=$tmp.df.level$i
echo ""
echo "restoring from df.level$i"
- _do_restore_file_cum -l $i
+ _do_restore_file_cum
echo "ls -l restore_dir"
ls -lR $restore_dir | _ls_size_filter | _check_quota_file
let i=$i+1
done
echo "Do the cumulative restores"
+_prepare_restore_dir
i=0
while [ $i -le $num_dumps ]; do
dump_file=$tmp.df.level$i
echo ""
echo "restoring from df.level$i"
- _do_restore_file_cum -l $i
+ _do_restore_file_cum
echo "list restore_dir"
_list_dir $restore_dir | _check_quota_file | tee $tmp.restorals.$i
let i=$i+1
_add_and_append_dumpdir_fill
dump_file=$tmp.df.1
_do_dump_file -l 1 -D
+_prepare_restore_dir
dump_file=$tmp.df.0
-_do_restore_file_cum -l 0
+_do_restore_file_cum
dump_file=$tmp.df.1
-_do_restore_file_cum -l 1
+_do_restore_file_cum
_ls_compare_sub
_diff_compare
#
# Cumulative restore from a file
-# Need to specify the dump level e.g. "-l 0"
+# Must call _prepare_restore_dir before the first
+# (and only the first) call to this function.
#
_do_restore_file_cum()
{
_parse_args $*
- if echo $dump_args | grep '\-l0' >/dev/null; then
- _prepare_restore_dir
- fi
echo "Restoring cumumlative from file..."
opts="$_restore_debug -f $dump_file -r $restore_dir"