summaryrefslogtreecommitdiff
path: root/verification-test
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2012-03-03 14:46:44 +0000
committerLars Wirzenius <liw@liw.fi>2012-03-03 14:46:44 +0000
commit6b54b97e40b426eb7ea51d4a5bbd5bd34a84f7d4 (patch)
tree6075c495e56b02d70452002242e7e052c1a6b301 /verification-test
parentcc0b63b86968812335c8a6d6f9aa11f8f34c6649 (diff)
downloadobnam-6b54b97e40b426eb7ea51d4a5bbd5bd34a84f7d4.tar.gz
Handle obnam read-only errors sanely
Read-only errors need to be handled by re-trying. Now we do that.
Diffstat (limited to 'verification-test')
-rwxr-xr-xverification-test21
1 files changed, 16 insertions, 5 deletions
diff --git a/verification-test b/verification-test
index 79499f0a..208de90a 100755
--- a/verification-test
+++ b/verification-test
@@ -63,10 +63,20 @@ backup()
local dir="$2"
local conf="$3"
local client=$(awk '/client-name/ { print $3 }' "$conf")
+ local genids=$(mktemp)
./obnam --no-default-configs --config="$conf" -r "$repo" backup "$dir"
- local gen=$(./obnam --no-default-configs --config="$conf" -r "$repo" \
- genids | tail -n1)
+
+ while ! ./obnam --no-default-configs --config="$conf" -r "$repo" genids \
+ > "$genids"
+ do
+ :
+ done
+ local gen=$(tail -n1 "$genids")
+ if [ "x$gen" = "x" ]
+ then
+ die "gen is empty"
+ fi
summain "$dir" -r --output="$repo/$client.$gen.summain"
}
@@ -86,7 +96,8 @@ verify()
local tempdir="$(mktemp -d)"
local client=$(awk '/client-name/ { print $3 }' "$conf")
- ./obnam --no-default-configs --config="$conf" -r "$repo" genids |
+ ./obnam --no-default-configs --config="$conf" -r "$repo" genids \
+ > "$tempdir"/gens || exit 42
while read gen
do
rm -rf "$tempdir/$gen"
@@ -99,8 +110,8 @@ verify()
die "generation $gen failed to restore properly, see $tempdir"
fi
rm -rf "$tempdir/$gen" "$tempdir/summain.$gen"
- done || exit 1
- rmdir "$tempdir"
+ done < "$tempdir/gens"
+ rm -rf "$tempdir"
}
[ "$#" = 3 ] || [ "$#" = 4 ] || die "Bad usage, read source!"