summaryrefslogtreecommitdiff
path: root/yarns/0040-generations.yarn
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2014-03-19 19:01:59 +0000
committerLars Wirzenius <liw@liw.fi>2014-03-19 19:01:59 +0000
commit8e50f17903c2c173c3b812022c8e3e5633a9ada9 (patch)
treecd8c23851710b747cc9898080eec746eaa6dea0a /yarns/0040-generations.yarn
parenta08e9b1b2a892ebafdc627d099766d859c0b8ae2 (diff)
downloadobnam-8e50f17903c2c173c3b812022c8e3e5633a9ada9.tar.gz
Add scenario for testing --keep=4h style schedule
Diffstat (limited to 'yarns/0040-generations.yarn')
-rw-r--r--yarns/0040-generations.yarn66
1 files changed, 66 insertions, 0 deletions
diff --git a/yarns/0040-generations.yarn b/yarns/0040-generations.yarn
index 69bc4a03..871adcb7 100644
--- a/yarns/0040-generations.yarn
+++ b/yarns/0040-generations.yarn
@@ -158,6 +158,72 @@ The normal way of forgetting generations is with the `obnam forget
WHEN user U restores their latest generation in repository R into X
THEN L, restored to X, matches manifest M
+There has been reports that the "keep N hourly backups" type of
+`--keep` policy doesn't work. Test this by creating several
+generations, pretending the time is something specific, and then check
+that the right ones get kept. For each calendar hour, we make two
+generations, and we create them for every other calendar hour, for
+four such hours (covering a total of eight hours). We then keep two
+hourly backups. This should result in the later of each backup during
+a calendar hour to be kept, for the last two calendar hours.
+
+ SCENARIO keep N hourly generations
+
+The first generation of the first hour.
+
+ GIVEN user U sets configuration pretend-time to 2014-03-19 01:00:00
+ AND 1kB of new data in directory L
+ WHEN user U backs up directory L to repository R
+
+The second generation of the first hour.
+
+ GIVEN user U sets configuration pretend-time to 2014-03-19 01:30:00
+ AND 1kB of new data in directory L
+ WHEN user U backs up directory L to repository R
+
+The first generation of the second hour.
+
+ GIVEN user U sets configuration pretend-time to 2014-03-19 02:00:00
+ AND 1kB of new data in directory L
+ WHEN user U backs up directory L to repository R
+
+The second generation of the second hour.
+
+ GIVEN user U sets configuration pretend-time to 2014-03-19 02:30:00
+ AND 1kB of new data in directory L
+ WHEN user U backs up directory L to repository R
+
+The first generation of the third hour.
+
+ GIVEN user U sets configuration pretend-time to 2014-03-19 03:00:00
+ AND 1kB of new data in directory L
+ WHEN user U backs up directory L to repository R
+
+The second generation of the third hour.
+
+ GIVEN user U sets configuration pretend-time to 2014-03-19 03:30:00
+ AND 1kB of new data in directory L
+ WHEN user U backs up directory L to repository R
+
+The first generation of the fourth hour.
+
+ GIVEN user U sets configuration pretend-time to 2014-03-19 04:00:00
+ AND 1kB of new data in directory L
+ WHEN user U backs up directory L to repository R
+
+The second generation of the fourth hour.
+
+ GIVEN user U sets configuration pretend-time to 2014-03-19 04:30:00
+ AND 1kB of new data in directory L
+ WHEN user U backs up directory L to repository R
+
+Now run the forget and verify.
+
+ WHEN user U forgets according to schedule 2h in repository R
+ THEN user U sees 2 generations in repository R
+ AND user U has 1st generation timestamp 2014-03-19 03:30:00 in repository R
+ AND user U has 2nd generation timestamp 2014-03-19 04:30:00 in repository R
+
Dnn't really forget anything if pretending
------------------------------------------