public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Bill Kendall <wkendall@sgi.com>
To: xfs@oss.sgi.com
Subject: [PATCH 1/4] xfstests: refactor cumulative restore tests
Date: Tue,  1 Nov 2011 14:53:04 -0500	[thread overview]
Message-ID: <1320177187-18871-2-git-send-email-wkendall@sgi.com> (raw)
In-Reply-To: <1320177187-18871-1-git-send-email-wkendall@sgi.com>

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>
---
 064         |    3 ++-
 065         |    3 ++-
 264         |    5 +++--
 common.dump |    6 ++----
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/064 b/064
index 16960c9..bf8a7bc 100755
--- a/064
+++ b/064
@@ -97,12 +97,13 @@ while [ $i -le 9 ]; do
 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
diff --git a/065 b/065
index f21a87f..2ebe1cc 100755
--- a/065
+++ b/065
@@ -174,12 +174,13 @@ while [ $i -le $num_dumps ]; do
 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
diff --git a/264 b/264
index 9544a58..1caa15f 100755
--- a/264
+++ b/264
@@ -63,10 +63,11 @@ _do_dump_file
 _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
 
diff --git a/common.dump b/common.dump
index 3942e83..56b348a 100644
--- a/common.dump
+++ b/common.dump
@@ -1065,14 +1065,12 @@ _do_restore_file()
 
 #
 # 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"
-- 
1.7.0.4

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2011-11-01 19:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01 19:53 [PATCH 0/4] xfstests: refactor arg processing in common.dump Bill Kendall
2011-11-01 19:53 ` Bill Kendall [this message]
2011-11-01 19:53 ` [PATCH 2/4] xfstests: refactor xfsdump quota checking Bill Kendall
2011-11-01 19:53 ` [PATCH 3/4] xfstests: allow dump file name to be passed as arg Bill Kendall
2011-11-01 19:53 ` [PATCH 4/4] xfstests: refactor dump test argument parsing Bill Kendall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1320177187-18871-2-git-send-email-wkendall@sgi.com \
    --to=wkendall@sgi.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox