diff options
author | Lars Wirzenius <liw@liw.fi> | 2012-03-03 13:03:18 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2012-03-03 13:03:18 +0000 |
commit | 1d5e63ae6efdf76eea8fb1b18b9918ad6fd7f602 (patch) | |
tree | 9aca957f1722194d8a8414096f6bdbd88bbc1652 /test-many-generations | |
parent | 58e5559b67d707377a845cda1cdd8f95be5f1bb7 (diff) | |
download | obnam-1d5e63ae6efdf76eea8fb1b18b9918ad6fd7f602.tar.gz |
During lock testing, handle obnam restore failures gracefully
Because of how Obnam deals with locking (it only locks for writes),
read-only operations such as restore can fail because a backup is
happening concurrently. We deal with this by re-trying the restore
until it succeeds (i.e., obnam does not crash). There's a chance
of infinite looping if the crash happens for another reason, but
that's for the human watching the test to deal with.
Diffstat (limited to 'test-many-generations')
-rwxr-xr-x | test-many-generations | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test-many-generations b/test-many-generations index d50f31d5..5be48d48 100755 --- a/test-many-generations +++ b/test-many-generations @@ -17,6 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +set -ex + die() { echo "$@" 1>&2 @@ -36,6 +38,7 @@ cat <<EOF > "$conf" [config] client-name = $client quiet = yes +log = $client.log EOF seq "$N" | @@ -45,7 +48,20 @@ do find "$root" -exec touch --date="1970-01-01 00:00:$gen" '{}' ';' ./verification-test backup "$repo" "$root" "$conf" done -./verification-test verify "$repo" "$root" "$conf" + +while true +do + ./verification-test verify "$repo" "$root" "$conf" + ret="$?" + if [ "$ret" = 0 ] + then + break + elif [ "$ret" != 42 ] + then + echo "$client failed verification" 1>&2 + exit 1 + fi +done rm -rf "$conf" "$root" |