summaryrefslogtreecommitdiff
path: root/yarns/0080-verify.yarn
blob: 1d33cf15f1bf7a020fdcb90c1ef20887da09409c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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 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
    AND user U attempts to verify L against repository R
    THEN the attempt succeeded

However, if there have been any changes, such as for a timestamp, then
the verification should find a problem.

    GIVEN file L/foo has Unix timestamp 1
    WHEN user U attempts to verify L against repository R
    THEN the attempt failed with exit code 1

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


Verify notices when live data file has been appended to
-------------------------------------------------------

In March, 2015, Thomas Waldemann noticed that `obnam verify` would
fail to notice if the live data file had been appended to. This
regression test catches the problem.

    SCENARIO verify file that has been appended to
    GIVEN 0B of data in file L/foo
    AND file L/foo has Unix timestamp 0
    WHEN user U backs up directory L to repository R
    GIVEN 1B of data in file L/foo
    AND file L/foo has Unix timestamp 0
    WHEN user U attempts to verify L against repository R
    THEN the attempt failed with exit code 1