diff options
author | Lars Wirzenius <liw@liw.fi> | 2014-03-21 07:40:17 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2014-03-21 07:40:17 +0000 |
commit | 0628d55f2582af6ffb34ec12a20832e9fad73515 (patch) | |
tree | fa4892d45e8c7e238249eba2d2d5f36ec523c54b | |
parent | d5973757f5be3704823c36567dba31c04d12b733 (diff) | |
download | obnam-0628d55f2582af6ffb34ec12a20832e9fad73515.tar.gz |
Convert verifies-randomly from cmdtest to yarn
-rwxr-xr-x | tests/verifies-randomly.script | 25 | ||||
-rw-r--r-- | tests/verifies-randomly.stdout | 1 | ||||
-rw-r--r-- | yarns/0080-verify.yarn | 16 | ||||
-rw-r--r-- | yarns/9000-implements.yarn | 6 |
4 files changed, 21 insertions, 27 deletions
diff --git a/tests/verifies-randomly.script b/tests/verifies-randomly.script deleted file mode 100755 index 03106406..00000000 --- a/tests/verifies-randomly.script +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# Copyright 2011 Lars Wirzenius -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# 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 -e - -echo aaa > "$DATADIR/data/aaa" -echo ccc > "$DATADIR/data/ccc" - -$SRCDIR/tests/backup - -$SRCDIR/tests/obnam verify --root="$(cat $DATADIR/rooturl)" --verify-randomly=1 - diff --git a/tests/verifies-randomly.stdout b/tests/verifies-randomly.stdout deleted file mode 100644 index 90e6004a..00000000 --- a/tests/verifies-randomly.stdout +++ /dev/null @@ -1 +0,0 @@ -Verify did not find problems. diff --git a/yarns/0080-verify.yarn b/yarns/0080-verify.yarn index 68a508ba..8bc2c239 100644 --- a/yarns/0080-verify.yarn +++ b/yarns/0080-verify.yarn @@ -1,10 +1,13 @@ Verify backed up data ===================== +Verify notices modification time change +--------------------------------------- + The user may want to verify that all their live data is still intact. This is done with `obnam verify`. - SCENARIO verify live data + SCENARIO verify notices mtime change GIVEN 100kB of new data in directory L AND file L/foo has Unix timestamp 0 WHEN user U backs up directory L to repository R @@ -22,3 +25,14 @@ RDF30DX is the error code for metadata change, of which modification time is one. THEN the error message matches "RDF30DX.*st_mtime_sec" + +Verify one file randomly +------------------------ + +`obnam verify` can pick files to verify randomly, for spot checks. + + SCENARIO verify a random file + GIVEN 100kB of new data in directory L + WHEN user U backs up directory L to repository R + AND user U attempts to verify a random file in L against repository R + THEN the attempt succeeded diff --git a/yarns/9000-implements.yarn b/yarns/9000-implements.yarn index 25400662..ab0fe1c8 100644 --- a/yarns/9000-implements.yarn +++ b/yarns/9000-implements.yarn @@ -269,6 +269,12 @@ Run `obnam verify` and remember the output. attempt run_obnam "$MATCH_1" \ verify -r "$DATADIR/$MATCH_3" "$DATADIR/$MATCH_2" +Verify a random file in live data. + + IMPLEMENTS WHEN user (\S+) attempts to verify a random file in (\S+) against repository (\S+) + attempt run_obnam "$MATCH_1" \ + verify -r "$DATADIR/$MATCH_3" --verify-randomly=1 "$DATADIR/$MATCH_2" + Removing (forgetting) generations --------------------------------- |