summaryrefslogtreecommitdiff
path: root/obnamlib/repo_interface.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2016-03-11 17:18:32 +0200
committerLars Wirzenius <liw@liw.fi>2016-03-11 17:19:33 +0200
commit450870e1414b1be579a9130006ff62d429754280 (patch)
treea88897f8dbbc0f4032e4d0cd0c2c8652999426a9 /obnamlib/repo_interface.py
parent898a4f7242318e3593f97cb15f7bdb4932cc1b2a (diff)
downloadobnam-450870e1414b1be579a9130006ff62d429754280.tar.gz
Do not alias test key with symlink target key
This caused other parts of Obnam to break when backing up symlinks.
Diffstat (limited to 'obnamlib/repo_interface.py')
-rw-r--r--obnamlib/repo_interface.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/obnamlib/repo_interface.py b/obnamlib/repo_interface.py
index 640fbffb..1c74981d 100644
--- a/obnamlib/repo_interface.py
+++ b/obnamlib/repo_interface.py
@@ -1893,41 +1893,47 @@ class RepositoryInterfaceTests(unittest.TestCase): # pragma: no cover
gen_id, '/foo/bar', obnamlib.REPO_FILE_TEST_KEY)
def test_committing_client_remembers_set_file_keys(self):
+ # We use the symlink target for these tests, since the
+ # FILE_TEST_KEY mightn't get stored.
+
gen_id = self.create_generation()
self.repo.add_file(gen_id, '/foo/bar')
self.repo.set_file_key(
gen_id, '/foo/bar', obnamlib.REPO_FILE_MODE, stat.S_IFREG)
self.repo.set_file_key(
- gen_id, '/foo/bar', obnamlib.REPO_FILE_TEST_KEY, 'yoyo')
+ gen_id, '/foo/bar', obnamlib.REPO_FILE_SYMLINK_TARGET, 'yoyo')
self.repo.commit_client('fooclient')
self.repo.unlock_client('fooclient')
value = self.repo.get_file_key(
- gen_id, '/foo/bar', obnamlib.REPO_FILE_TEST_KEY)
+ gen_id, '/foo/bar', obnamlib.REPO_FILE_SYMLINK_TARGET)
self.assertEqual(value, 'yoyo')
def test_setting_file_key_does_not_affect_previous_generation(self):
+ # We use the symlink target for these tests, since the
+ # FILE_TEST_KEY mightn't get stored.
+
gen_id = self.create_generation()
self.repo.add_file(gen_id, '/foo/bar')
self.repo.set_file_key(
gen_id, '/foo/bar', obnamlib.REPO_FILE_MODE, stat.S_IFREG)
self.repo.set_file_key(
- gen_id, '/foo/bar', obnamlib.REPO_FILE_TEST_KEY, 'first')
+ gen_id, '/foo/bar', obnamlib.REPO_FILE_SYMLINK_TARGET, 'first')
self.repo.commit_client('fooclient')
self.repo.unlock_client('fooclient')
self.repo.lock_client('fooclient')
gen_id_2 = self.repo.create_generation('fooclient')
self.repo.set_file_key(
- gen_id_2, '/foo/bar', obnamlib.REPO_FILE_TEST_KEY, 'second')
+ gen_id_2, '/foo/bar', obnamlib.REPO_FILE_SYMLINK_TARGET, 'second')
self.repo.commit_client('fooclient')
self.repo.unlock_client('fooclient')
value = self.repo.get_file_key(
- gen_id, '/foo/bar', obnamlib.REPO_FILE_TEST_KEY)
+ gen_id, '/foo/bar', obnamlib.REPO_FILE_SYMLINK_TARGET)
self.assertEqual(value, 'first')
value_2 = self.repo.get_file_key(
- gen_id_2, '/foo/bar', obnamlib.REPO_FILE_TEST_KEY)
+ gen_id_2, '/foo/bar', obnamlib.REPO_FILE_SYMLINK_TARGET)
self.assertEqual(value_2, 'second')
def test_new_file_has_no_chunk_ids(self):