From c09778fe5c1fbca31b7dd4cb1a4533fb95e95e06 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 11 Apr 2014 18:56:16 +0100 Subject: Don't allow backup root to be a symbolic link --- yarns/0030-basics.yarn | 20 ++++++++++++++++++++ yarns/9000-implements.yarn | 5 +++++ 2 files changed, 25 insertions(+) (limited to 'yarns') diff --git a/yarns/0030-basics.yarn b/yarns/0030-basics.yarn index 4bc8439b..c753a10c 100644 --- a/yarns/0030-basics.yarn +++ b/yarns/0030-basics.yarn @@ -157,6 +157,26 @@ instead of a file. THEN the attempt succeeded +Backup root is not a directory +------------------------------ + +Obnam does not, currently, support backing up individual files. The +backup root must be a directory. This scenario verifies that Obnam +gives the right error if the root is not a directory. The error code +is R79ED6X, for "Backup root does not exist or is not a directory". + + SCENARIO backup root is not a directory + + GIVEN a symlink L pointing at /dev/null + WHEN user U attempts to back up directory L to repository R + THEN the attempt failed with exit code 1 + THEN the error message matches "R79ED6X" + + GIVEN a file F in ., with data + WHEN user U attempts to back up directory F to repository R + THEN the attempt failed with exit code 1 + THEN the error message matches "R79ED6X" + Backup to roots at once ----------------------- diff --git a/yarns/9000-implements.yarn b/yarns/9000-implements.yarn index 4fb0fc00..b348a34f 100644 --- a/yarns/9000-implements.yarn +++ b/yarns/9000-implements.yarn @@ -104,6 +104,11 @@ We need to manipulate extended attributes. mkdir -p $(dirname "$DATADIR/$MATCH_1") setfattr --name="$MATCH_2" --value "$MATCH_3" "$DATADIR/$MATCH_1" +Create a symlink. + + IMPLEMENTS GIVEN a symlink (\S+) pointing at (\S+) + ln -s "$MATCH_2" "$DATADIR/$MATCH_1" + Sometimes we need to remove a file. IMPLEMENTS WHEN user (\S+) removes file (\S+) -- cgit v1.2.1