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 /verification-test | |
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 'verification-test')
-rwxr-xr-x | verification-test | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/verification-test b/verification-test index 4bfef11b..79499f0a 100755 --- a/verification-test +++ b/verification-test @@ -49,6 +49,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 @@ -87,8 +89,10 @@ verify() ./obnam --no-default-configs --config="$conf" -r "$repo" genids | while read gen do + rm -rf "$tempdir/$gen" ./obnam --no-default-configs --config="$conf" -r "$repo" \ - restore --to="$tempdir/$gen" --generation="$gen" + restore --to="$tempdir/$gen" --generation="$gen" || \ + exit 42 summain "$tempdir/$gen/$dir" -r --output="$tempdir/summain.$gen" if ! diff -u "$repo/$client.$gen.summain" "$tempdir/summain.$gen" then |