summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtests/no-roots-from-old-gens.script37
-rw-r--r--yarns/0030-basics.yarn15
-rw-r--r--yarns/9000-implements.yarn10
3 files changed, 25 insertions, 37 deletions
diff --git a/tests/no-roots-from-old-gens.script b/tests/no-roots-from-old-gens.script
deleted file mode 100755
index 987d8b0e..00000000
--- a/tests/no-roots-from-old-gens.script
+++ /dev/null
@@ -1,37 +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/>.
-
-# Do not include roots from previous generations in a new generation,
-# when the user stops specifying them.
-
-set -e
-
-mkdir "$DATADIR/data/root1"
-echo foo > "$DATADIR/data/root1/foo"
-
-mkdir "$DATADIR/data/root2"
-echo bar > "$DATADIR/data/root2/bar"
-
-rooturl=$(cat $DATADIR/rooturl)
-
-# Run the first backup with root1.
-$SRCDIR/tests/obnam backup "$rooturl/root1"
-
-# Run the second backup with root2.
-$SRCDIR/tests/obnam backup "$rooturl/root2"
-
-# Verify the latest generation has nothing from root1.
-$SRCDIR/tests/obnam ls | grep root1 || true
diff --git a/yarns/0030-basics.yarn b/yarns/0030-basics.yarn
index 5d563f0b..92304a50 100644
--- a/yarns/0030-basics.yarn
+++ b/yarns/0030-basics.yarn
@@ -136,3 +136,18 @@ directory `L`.
WHEN user U backs up directory L to repository R
AND user U restores their latest generation in repository R into X
THEN L, restored to X, matches manifest M
+
+Changing backup roots
+---------------------
+
+When we change the backup roots, i.e., the directories we want backed
+up, we do not want the any dropped backup roots to be included in the
+new backup.
+
+ SCENARIO replace backup root with new one
+ GIVEN 1k of new data in directory L1
+ AND 1k of new data in directory L2
+ WHEN user U backs up directory L1 to repository R
+ AND user U backs up directory L2 to repository R
+ AND user U lists latest generation in repository R into F
+ THEN nothing in F matches L1
diff --git a/yarns/9000-implements.yarn b/yarns/9000-implements.yarn
index f70ccd07..aeb253d1 100644
--- a/yarns/9000-implements.yarn
+++ b/yarns/9000-implements.yarn
@@ -352,6 +352,16 @@ Do all lines match?
IMPLEMENTS THEN all lines in (\S+) match (\S+)
! grep -E -v -e "$MATCH_2" -- "$DATADIR/$MATCH_1"
+Does no line match?
+
+ IMPLEMENTS THEN nothing in (\S+) matches (\S+)
+ if grep -E -e "$MATCH_2" -- "$DATADIR/$MATCH_1" | grep '.*'
+ then
+ echo "At least one line matches, when none may!" 1>&2
+ exit 1
+ fi
+
+
Check on user group membership
------------------------------