Merge lp:~aaron-whitehouse/duplicity/bug_1620085_exclude-if-present-locked-folder into lp:~duplicity-team/duplicity/0.8-series
- bug_1620085_exclude-if-present-locked-folder
- Merge into 0.8-series
Status: | Rejected |
---|---|
Rejected by: | Kenneth Loafman |
Proposed branch: | lp:~aaron-whitehouse/duplicity/bug_1620085_exclude-if-present-locked-folder |
Merge into: | lp:~duplicity-team/duplicity/0.8-series |
Diff against target: |
579 lines (+280/-114) (has conflicts) 11 files modified
CHANGELOG (+34/-14) Changelog.GNU (+49/-26) README (+1/-1) README-REPO (+24/-7) duplicity/selection.py (+18/-4) po/duplicity.pot (+4/-0) testing/__init__.py (+5/-1) testing/functional/test_selection.py (+130/-49) testing/gnupg/gpg.conf (+0/-9) testing/test_code.py (+4/-1) tox.ini (+11/-2) Text conflict in CHANGELOG Text conflict in Changelog.GNU Text conflict in po/duplicity.pot |
To merge this branch: | bzr merge lp:~aaron-whitehouse/duplicity/bug_1620085_exclude-if-present-locked-folder |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kenneth Loafman | Disapprove | ||
Review via email: mp+304924@code.launchpad.net |
Commit message
Description of the change
Aaron Whitehouse (aaron-whitehouse) wrote : | # |
Hi Kenneth,
Apologies for any confusion. This branch is based of the current 0.7-series branch, not lp:duplicity.
I deliberately proposed this for merging into the 0.7-series (off which it was based):
https:/
It looks like you then proposed this merge into the 0.8-series which has caused the conflicts?
My intention was that once it was merged into 0.7 we could then easily merge all changes in 0.7 up into 0.8 and wrap up both this and any other improvements/fixes in the 0.7 series. Or, if you don't like that plan, I can easily make the same fixes on a branch from the 0.8 series.
Kenneth Loafman (kenneth-loafman) wrote : | # |
Sorry, my confusion. Going to mark as rejected and clear the books.
Unmerged revisions
Preview Diff
1 | === modified file 'CHANGELOG' |
2 | --- CHANGELOG 2016-08-22 11:11:55 +0000 |
3 | +++ CHANGELOG 2016-09-05 14:30:45 +0000 |
4 | @@ -1,19 +1,21 @@ |
5 | -New in v0.8.00 (2016/07/??) |
6 | ---------------------------- |
7 | -* Merged in lp:~aaron-whitehouse/duplicity/remove-python26 |
8 | - - Remove Python 2.6 support references and tests. |
9 | -* Fixed bug #1600692 with patch from Wolfgang Rohdewald |
10 | - - Allow symlink to have optional trailing slash during verify. |
11 | -* Merged in lp:~aaron-whitehouse/duplicity/07-fix_deja_dup_error_on_locked_files |
12 | - - Revert log.Error to log.Warn, as it was prior to the merge in rev 1224, |
13 | - as this was affecting other applications (e.g. deja dup; Bug #1605939). |
14 | -* Merged in lp:~mwilck/duplicity/duplicity |
15 | +New in v0.7.11 (2016/09/??) |
16 | +--------------------------- |
17 | +* Fixed bugs #815510 and #1615480 |
18 | + - Changed default --volsize to 200MB |
19 | +* Merged in lp:~mstoll-de/duplicity/duplicity |
20 | + - Backblaze announced a new domain for the b2 api |
21 | + |
22 | +New in v0.7.10 (2016/08/20) |
23 | +--------------------------- |
24 | +* Merged in lp:~mwilck/duplicity/0.7-series |
25 | - Speedup of path_matches_glob() by about 8x. See |
26 | - https://code.launchpad.net/~mwilck/duplicity/duplicity/+merge/301268 |
27 | + https://code.launchpad.net/~mwilck/duplicity/0.7-series/+merge/301332 |
28 | for more details. |
29 | +* Remove -w from setsid in functional tests. |
30 | * Fixed conflict in merge from Martin Wilck and applied |
31 | - https://code.launchpad.net/~mwilck/duplicity/0.7-series/+merge/301492 |
32 | - merge fixes setsid usage in functional testing. |
33 | +<<<<<<< TREE |
34 | * Fixed bug #1612472 with patch from David Cuthbert |
35 | - Restore from S3 fails with --with-prefix-archive if prefix includes '/' |
36 | * Merged in lp:~arashad.ahamad/duplicity/duplicity_latest |
37 | @@ -24,6 +26,24 @@ |
38 | - Changed default --volsize to 200MB |
39 | * Merged in lp:~mstoll-de/duplicity/duplicity |
40 | - Backblaze announced a new domain for the b2 api |
41 | +======= |
42 | +* Fixed bug #1612472 with patch from David Cuthbert |
43 | + - Restore from S3 fails with --with-prefix-archive if prefix includes '/' |
44 | +* Merged in lp:~arashad.ahamad/duplicity/duplicity_latest |
45 | + - Changes for connecting to IBM Bluemix ObjectStorage. See man page. |
46 | +* Merged in lp:~fenisilius/duplicity/acd_init_mkdir |
47 | + - Allow duplicity to create remote folder |
48 | + |
49 | + |
50 | +New in v0.7.09 (2016/07/24) |
51 | +--------------------------- |
52 | +* Fixed bug #1600692 with patch from Wolfgang Rohdewald |
53 | + - Allow symlink to have optional trailing slash during verify. |
54 | +* Merged in lp:~aaron-whitehouse/duplicity/07-fix_deja_dup_error_on_locked_files |
55 | + - Revert log.Error to log.Warn, as it was prior to the merge in rev 1224, |
56 | + as this was affecting other applications (e.g. deja dup; Bug #1605939). |
57 | +* Merged in lp:~duplicity-team/duplicity/po-updates |
58 | +>>>>>>> MERGE-SOURCE |
59 | |
60 | |
61 | New in v0.7.08 (2016/07/02) |
62 | @@ -81,6 +101,9 @@ |
63 | * Fixed bug #1570293 duplicity is very slow due to excessive fsync |
64 | - removed flush() after write. |
65 | - revert to previous version |
66 | +* Merged in lp:~aaron-whitehouse/duplicity/07-fix_deja_dup_error_on_locked_files |
67 | + - Revert log.Error to log.Warn, as it was prior to the merge in rev 1224, |
68 | + as this was affecting other applications (e.g. deja dup; Bug #1605939). |
69 | |
70 | |
71 | New in v0.7.07 (2016/04/10) |
72 | @@ -333,9 +356,6 @@ |
73 | * Merged in lp:~ed.so/duplicity/gpg.binary |
74 | - new parameter --gpg-binary allows user to point to a different gpg binary, |
75 | not necessarily in path |
76 | -* Merged in lp:~ed.so/duplicity/gpg.binary |
77 | - - new parameter --gpg-binary allows user to point to a different gpg binary, |
78 | - not necessarily in path |
79 | * Merged in lp:~aaron-whitehouse/duplicity/fix_POTFILES.in_and_run-tests |
80 | - Fixed two filename references in po/POTFILES.in, a mistake which crept in in |
81 | rev 1093 and caused testing/run-tests to fail with "IndexError: list index |
82 | |
83 | === modified file 'Changelog.GNU' |
84 | --- Changelog.GNU 2016-08-22 11:11:55 +0000 |
85 | +++ Changelog.GNU 2016-09-05 14:30:45 +0000 |
86 | @@ -1,22 +1,48 @@ |
87 | -2016-08-22 Kenneth Loafman <kenneth@loafman.com> |
88 | - |
89 | - * Fixed bugs #815510 and #1615480 |
90 | - - Changed default --volsize to 200MB |
91 | - * Merged in lp:~mstoll-de/duplicity/duplicity |
92 | - - Backblaze announced a new domain for the b2 api |
93 | - |
94 | -2016-08-18 Kenneth Loafman <kenneth@loafman.com> |
95 | - |
96 | - * Merged in lp:~fenisilius/duplicity/acd_init_mkdir |
97 | - - Allow duplicity to create remote folder |
98 | - |
99 | -2016-08-12 Kenneth Loafman <kenneth@loafman.com> |
100 | - |
101 | - * Fixed bug #1612472 with patch from David Cuthbert |
102 | - - Restore from S3 fails with --with-prefix-archive if prefix includes '/' |
103 | - * Merged in lp:~arashad.ahamad/duplicity/duplicity_latest |
104 | - - Changes for connecting to IBM Bluemix ObjectStorage. See man page. |
105 | - |
106 | +<<<<<<< TREE |
107 | +2016-08-22 Kenneth Loafman <kenneth@loafman.com> |
108 | + |
109 | + * Fixed bugs #815510 and #1615480 |
110 | + - Changed default --volsize to 200MB |
111 | + * Merged in lp:~mstoll-de/duplicity/duplicity |
112 | + - Backblaze announced a new domain for the b2 api |
113 | + |
114 | +2016-08-18 Kenneth Loafman <kenneth@loafman.com> |
115 | + |
116 | + * Merged in lp:~fenisilius/duplicity/acd_init_mkdir |
117 | + - Allow duplicity to create remote folder |
118 | + |
119 | +2016-08-12 Kenneth Loafman <kenneth@loafman.com> |
120 | + |
121 | + * Fixed bug #1612472 with patch from David Cuthbert |
122 | + - Restore from S3 fails with --with-prefix-archive if prefix includes '/' |
123 | + * Merged in lp:~arashad.ahamad/duplicity/duplicity_latest |
124 | + - Changes for connecting to IBM Bluemix ObjectStorage. See man page. |
125 | + |
126 | +======= |
127 | +2016-08-22 Kenneth Loafman <kenneth@loafman.com> |
128 | + |
129 | + * Fixed bugs #815510 and #1615480 |
130 | + - Changed default --volsize to 200MB |
131 | + * Merged in lp:~mstoll-de/duplicity/duplicity |
132 | + - Backblaze announced a new domain for the b2 api |
133 | + |
134 | +2016-08-20 Kenneth Loafman <kenneth@loafman.com> |
135 | + |
136 | + * Prep for 0.7.10 |
137 | + |
138 | +2016-08-18 Kenneth Loafman <kenneth@loafman.com> |
139 | + |
140 | + * Merged in lp:~fenisilius/duplicity/acd_init_mkdir |
141 | + - Allow duplicity to create remote folder |
142 | + |
143 | +2016-08-12 Kenneth Loafman <kenneth@loafman.com> |
144 | + |
145 | + * Fixed bug #1612472 with patch from David Cuthbert |
146 | + - Restore from S3 fails with --with-prefix-archive if prefix includes '/' |
147 | + * Merged in lp:~arashad.ahamad/duplicity/duplicity_latest |
148 | + - Changes for connecting to IBM Bluemix ObjectStorage. See man page. |
149 | + |
150 | +>>>>>>> MERGE-SOURCE |
151 | 2016-07-31 Kenneth Loafman <kenneth@loafman.com> |
152 | |
153 | * Fixed conflict in merge from Martin Wilck and applied |
154 | @@ -25,27 +51,24 @@ |
155 | |
156 | 2016-07-28 Kenneth Loafman <kenneth@loafman.com> |
157 | |
158 | - * Merged in lp:~mwilck/duplicity/duplicity |
159 | + * Merged in lp:~mwilck/duplicity/0.7-series |
160 | - Speedup of path_matches_glob() by about 8x. See |
161 | - https://code.launchpad.net/~mwilck/duplicity/duplicity/+merge/301268 |
162 | + https://code.launchpad.net/~mwilck/duplicity/0.7-series/+merge/301332 |
163 | for more details. |
164 | + * Remove -w from setsid in functional tests. |
165 | |
166 | 2016-07-24 Kenneth Loafman <kenneth@loafman.com> |
167 | |
168 | * Merged in lp:~aaron-whitehouse/duplicity/07-fix_deja_dup_error_on_locked_files |
169 | - Revert log.Error to log.Warn, as it was prior to the merge in rev 1224, |
170 | as this was affecting other applications (e.g. deja dup; Bug #1605939). |
171 | + * Prep for 0.7.09 |
172 | |
173 | 2016-07-20 Kenneth Loafman <kenneth@loafman.com> |
174 | |
175 | * Fixed bug #1600692 with patch from Wolfgang Rohdewald |
176 | - Allow symlink to have optional trailing slash during verify. |
177 | |
178 | -2016-07-03 Kenneth Loafman <kenneth@loafman.com> |
179 | - |
180 | - * Merged in lp:~aaron-whitehouse/duplicity/remove-python26 |
181 | - - Remove Python 2.6 support references and tests. |
182 | - |
183 | 2016-07-02 Kenneth Loafman <kenneth@loafman.com> |
184 | |
185 | * Merged in lp:~aaron-whitehouse/duplicity/PEP8_W503_fixes |
186 | |
187 | === modified file 'README' |
188 | --- README 2016-07-02 17:12:58 +0000 |
189 | +++ README 2016-09-05 14:30:45 +0000 |
190 | @@ -19,7 +19,7 @@ |
191 | |
192 | REQUIREMENTS: |
193 | |
194 | - * Python v2.7 or later |
195 | + * Python v2.6 or later |
196 | * librsync v0.9.6 or later |
197 | * GnuPG v1.x for encryption |
198 | * python-lockfile v0.9 or later for concurrency locking |
199 | |
200 | === modified file 'README-REPO' |
201 | --- README-REPO 2016-07-02 17:12:58 +0000 |
202 | +++ README-REPO 2016-09-05 14:30:45 +0000 |
203 | @@ -47,18 +47,35 @@ |
204 | Please run all tests on your branch (run-tests) before proposing a merge, to |
205 | ensure that all tests pass. The decorator @unittest.expectedFailure can be used |
206 | to commit a known-failing test case without breaking the test suite, for |
207 | -example to exhibit the behaviour in a bug report before it has been fixed. |
208 | +example to exhibit the behaviour in a bug report before it has been fixed: |
209 | + |
210 | +if sys.version_info < (2, 7): |
211 | + import unittest2 as unittest |
212 | +else: |
213 | + import unittest |
214 | + |
215 | + |
216 | +class TestClass(unittest.TestCase): |
217 | + """Test class to show expectedFailure""" |
218 | + |
219 | + @unittest.expectedFailure |
220 | + def test_expected_failure(self): |
221 | + """Test behaviour of expectedFailure""" |
222 | + self.assertEqual(1, 2) |
223 | |
224 | ----------------------------------------- |
225 | Testing against multiple Python versions: |
226 | ----------------------------------------- |
227 | |
228 | -Duplicity uses tox to make it easy to test your code against multiple |
229 | -environments. Running tests using the commands above will automatically test |
230 | -code against different supported environments, including the versions of |
231 | -dependencies used by the Launchpad build system. |
232 | - |
233 | +Duplicity currently supports Python versions v2.6 or later. Duplicity uses tox |
234 | +to make it easy to test your code against multiple Python versions. Running |
235 | +tests using the commands above will automatically test code against both |
236 | +Python v2.6 and v2.7, if you have both installed on your system. It will also |
237 | +test against the versions of dependencies used by the Launchpad build system. |
238 | You can test against a single environment, e.g. |
239 | -tox -e py27 |
240 | +tox -e py26 |
241 | for example if you are working on fixing a bug, but please do a full run-tests |
242 | before submitting a merge request. |
243 | + |
244 | +For instructions on installing Python v2.6 on newer versions of Ubuntu, see |
245 | +https://launchpad.net/~fkrull/+archive/ubuntu/deadsnakes |
246 | |
247 | === modified file 'duplicity/selection.py' |
248 | --- duplicity/selection.py 2016-07-27 11:56:07 +0000 |
249 | +++ duplicity/selection.py 2016-09-05 14:30:45 +0000 |
250 | @@ -447,10 +447,24 @@ |
251 | |
252 | def exclude_sel_func(path): |
253 | # do not follow symbolic links when checking for file existence! |
254 | - if path.isdir() and path.append(filename).exists(): |
255 | - return 0 |
256 | - else: |
257 | - return None |
258 | + if path.isdir(): |
259 | + # First check path is read accessible |
260 | + if not (os.access(path.name, os.R_OK)): |
261 | + # Path is not read accessible |
262 | + # ToDo: Ideally this error would only show if the folder |
263 | + # was ultimately included by the full set of selection |
264 | + # functions. Currently this will give an error for any |
265 | + # locked directory within the folder being backed up. |
266 | + log.Warn(_( |
267 | + "Error accessing possibly locked file %s") % util.ufn( |
268 | + path.name), |
269 | + log.WarningCode.cannot_read, util.escape(path.name)) |
270 | + if diffdir.stats: |
271 | + diffdir.stats.Errors += 1 |
272 | + elif path.append(filename).exists(): |
273 | + return 0 |
274 | + else: |
275 | + return None |
276 | |
277 | if include == 0: |
278 | sel_func = exclude_sel_func |
279 | |
280 | === modified file 'po/duplicity.pot' |
281 | --- po/duplicity.pot 2016-08-18 16:06:51 +0000 |
282 | +++ po/duplicity.pot 2016-09-05 14:30:45 +0000 |
283 | @@ -8,7 +8,11 @@ |
284 | msgstr "" |
285 | "Project-Id-Version: PACKAGE VERSION\n" |
286 | "Report-Msgid-Bugs-To: Kenneth Loafman <kenneth@loafman.com>\n" |
287 | +<<<<<<< TREE |
288 | "POT-Creation-Date: 2016-08-18 10:50-0500\n" |
289 | +======= |
290 | +"POT-Creation-Date: 2016-08-20 14:02-0500\n" |
291 | +>>>>>>> MERGE-SOURCE |
292 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
293 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
294 | "Language-Team: LANGUAGE <LL@li.org>\n" |
295 | |
296 | === modified file 'testing/__init__.py' |
297 | --- testing/__init__.py 2016-07-02 19:39:05 +0000 |
298 | +++ testing/__init__.py 2016-09-05 14:30:45 +0000 |
299 | @@ -21,7 +21,11 @@ |
300 | import os |
301 | import sys |
302 | import time |
303 | -import unittest |
304 | + |
305 | +if sys.version_info < (2, 7): |
306 | + import unittest2 as unittest |
307 | +else: |
308 | + import unittest |
309 | |
310 | from duplicity import backend |
311 | from duplicity import globals |
312 | |
313 | === modified file 'testing/functional/test_selection.py' |
314 | --- testing/functional/test_selection.py 2015-07-31 08:22:31 +0000 |
315 | +++ testing/functional/test_selection.py 2016-09-05 14:30:45 +0000 |
316 | @@ -837,6 +837,57 @@ |
317 | self.restore_and_check() |
318 | |
319 | |
320 | +class TestTrailingSlash2(IncludeExcludeFunctionalTest): |
321 | + """ This tests the behaviour of globbing strings with a trailing slash""" |
322 | + # See Bug #1479545 (https://bugs.launchpad.net/duplicity/+bug/1479545) |
323 | + |
324 | + def test_no_trailing_slash(self): |
325 | + """ Test that including 1.py works as expected""" |
326 | + self.backup("full", "testfiles/select2", |
327 | + options=["--include", "testfiles/select2/1.py", |
328 | + "--exclude", "**"]) |
329 | + self.restore() |
330 | + restore_dir = 'testfiles/restore_out' |
331 | + restored = self.directory_tree_to_list_of_lists(restore_dir) |
332 | + self.assertEqual(restored, [['1.py']]) |
333 | + |
334 | + def test_trailing_slash(self): |
335 | + """ Test that globs with a trailing slash only match directories""" |
336 | + # Regression test for Bug #1479545 |
337 | + # (https://bugs.launchpad.net/duplicity/+bug/1479545) |
338 | + self.backup("full", "testfiles/select2", |
339 | + options=["--include", "testfiles/select2/1.py/", |
340 | + "--exclude", "**"]) |
341 | + self.restore() |
342 | + restore_dir = 'testfiles/restore_out' |
343 | + restored = self.directory_tree_to_list_of_lists(restore_dir) |
344 | + self.assertEqual(restored, []) |
345 | + |
346 | + def test_include_files_not_subdirectories(self): |
347 | + """ Test that a trailing slash glob followed by a * glob only matches |
348 | + files and not subdirectories""" |
349 | + self.backup("full", "testfiles/select2", |
350 | + options=["--exclude", "testfiles/select2/*/", |
351 | + "--include", "testfiles/select2/*", |
352 | + "--exclude", "**"]) |
353 | + self.restore() |
354 | + restore_dir = 'testfiles/restore_out' |
355 | + restored = self.directory_tree_to_list_of_lists(restore_dir) |
356 | + self.assertEqual(restored, [['1.doc', '1.py']]) |
357 | + |
358 | + def test_include_subdirectories_not_files(self): |
359 | + """ Test that a trailing slash glob only matches directories""" |
360 | + self.backup("full", "testfiles/select2", |
361 | + options=["--include", "testfiles/select2/1/1sub1/**/", |
362 | + "--exclude", "testfiles/select2/1/1sub1/**", |
363 | + "--exclude", "**"]) |
364 | + self.restore() |
365 | + restore_dir = 'testfiles/restore_out' |
366 | + restored = self.directory_tree_to_list_of_lists(restore_dir) |
367 | + self.assertEqual(restored, [['1'], ['1sub1'], |
368 | + ['1sub1sub1', '1sub1sub2', '1sub1sub3']]) |
369 | + |
370 | + |
371 | class TestGlobbingReplacement(IncludeExcludeFunctionalTest): |
372 | """ This tests the behaviour of the extended shell globbing pattern replacement functions.""" |
373 | # See the manual for a description of behaviours, but in summary: |
374 | @@ -875,55 +926,85 @@ |
375 | self.assertEqual(restored, self.expected_restored_tree) |
376 | |
377 | |
378 | -class TestTrailingSlash(IncludeExcludeFunctionalTest): |
379 | - """ This tests the behaviour of globbing strings with a trailing slash""" |
380 | - # See Bug #1479545 (https://bugs.launchpad.net/duplicity/+bug/1479545) |
381 | - |
382 | - def test_no_trailing_slash(self): |
383 | - """ Test that including 1.py works as expected""" |
384 | - self.backup("full", "testfiles/select2", |
385 | - options=["--include", "testfiles/select2/1.py", |
386 | - "--exclude", "**"]) |
387 | - self.restore() |
388 | - restore_dir = 'testfiles/restore_out' |
389 | - restored = self.directory_tree_to_list_of_lists(restore_dir) |
390 | - self.assertEqual(restored, [['1.py']]) |
391 | - |
392 | - def test_trailing_slash(self): |
393 | - """ Test that globs with a trailing slash only match directories""" |
394 | - # ToDo: Bug #1479545 |
395 | - # (https://bugs.launchpad.net/duplicity/+bug/1479545) |
396 | - self.backup("full", "testfiles/select2", |
397 | - options=["--include", "testfiles/select2/1.py/", |
398 | - "--exclude", "**"]) |
399 | - self.restore() |
400 | - restore_dir = 'testfiles/restore_out' |
401 | - restored = self.directory_tree_to_list_of_lists(restore_dir) |
402 | - self.assertEqual(restored, []) |
403 | - |
404 | - def test_include_files_not_subdirectories(self): |
405 | - """ Test that a trailing slash glob followed by a * glob only matches |
406 | - files and not subdirectories""" |
407 | - self.backup("full", "testfiles/select2", |
408 | - options=["--exclude", "testfiles/select2/*/", |
409 | - "--include", "testfiles/select2/*", |
410 | - "--exclude", "**"]) |
411 | - self.restore() |
412 | - restore_dir = 'testfiles/restore_out' |
413 | - restored = self.directory_tree_to_list_of_lists(restore_dir) |
414 | - self.assertEqual(restored, [['1.doc', '1.py']]) |
415 | - |
416 | - def test_include_subdirectories_not_files(self): |
417 | - """ Test that a trailing slash glob only matches directories""" |
418 | - self.backup("full", "testfiles/select2", |
419 | - options=["--include", "testfiles/select2/1/1sub1/**/", |
420 | - "--exclude", "testfiles/select2/1/1sub1/**", |
421 | - "--exclude", "**"]) |
422 | - self.restore() |
423 | - restore_dir = 'testfiles/restore_out' |
424 | - restored = self.directory_tree_to_list_of_lists(restore_dir) |
425 | - self.assertEqual(restored, [['1'], ['1sub1'], |
426 | - ['1sub1sub1', '1sub1sub2', '1sub1sub3']]) |
427 | +class TestExcludeIfPresent(IncludeExcludeFunctionalTest): |
428 | + """ This tests the behaviour of duplicity's --exclude-if-present option""" |
429 | + |
430 | + def test_exclude_if_present_baseline(self): |
431 | + """ Test that duplicity normally backs up files""" |
432 | + with open("testfiles/select2/1/1sub1/1sub1sub1/.nobackup", "w") as tag: |
433 | + tag.write("Files in this folder should not be backed up.") |
434 | + self.backup("full", "testfiles/select2/1/1sub1", |
435 | + options=["--include", "testfiles/select2/1/1sub1/1sub1sub1/*", |
436 | + "--exclude", "**"]) |
437 | + self.restore() |
438 | + restore_dir = 'testfiles/restore_out' |
439 | + restored = self.directory_tree_to_list_of_lists(restore_dir) |
440 | + self.assertEqual(restored, [['1sub1sub1'], |
441 | + ['.nobackup', '1sub1sub1_file.txt']]) |
442 | + |
443 | + def test_exclude_if_present_excludes(self): |
444 | + """ Test that duplicity excludes files with relevant tag""" |
445 | + with open("testfiles/select2/1/1sub1/1sub1sub1/.nobackup", "w") as tag: |
446 | + tag.write("Files in this folder should not be backed up.") |
447 | + self.backup("full", "testfiles/select2/1/1sub1", |
448 | + options=["--exclude-if-present", ".nobackup", |
449 | + "--include", "testfiles/select2/1/1sub1/1sub1sub1/*", |
450 | + "--exclude", "**"]) |
451 | + self.restore() |
452 | + restore_dir = 'testfiles/restore_out' |
453 | + restored = self.directory_tree_to_list_of_lists(restore_dir) |
454 | + self.assertEqual(restored, []) |
455 | + |
456 | + def test_exclude_if_present_excludes_2(self): |
457 | + """ Test that duplicity excludes files with relevant tag""" |
458 | + with open("testfiles/select2/1/1sub1/1sub1sub1/EXCLUDE.tag", "w") as tag: |
459 | + tag.write("Files in this folder should also not be backed up.") |
460 | + self.backup("full", "testfiles/select2/1/1sub1", |
461 | + options=["--exclude-if-present", "EXCLUDE.tag", |
462 | + "--include", "testfiles/select2/1/1sub1/1sub1sub1/*", |
463 | + "--exclude", "**"]) |
464 | + self.restore() |
465 | + restore_dir = 'testfiles/restore_out' |
466 | + restored = self.directory_tree_to_list_of_lists(restore_dir) |
467 | + self.assertEqual(restored, []) |
468 | + |
469 | + |
470 | +class TestLockedFoldersNoError(IncludeExcludeFunctionalTest): |
471 | + """ This tests that inaccessible folders do not cause an error""" |
472 | + |
473 | + def test_locked_baseline(self): |
474 | + """ Test no error if locked in path but excluded""" |
475 | + folder_to_lock = "testfiles/select2/1/1sub1/1sub1sub3" |
476 | + initial_mode = os.stat(folder_to_lock).st_mode |
477 | + os.chmod(folder_to_lock, 0o0000) |
478 | + self.backup("full", "testfiles/select2/1/1sub1", |
479 | + options=["--include", "testfiles/select2/1/1sub1/1sub1sub1/*", |
480 | + "--exclude", "**"]) |
481 | + os.chmod(folder_to_lock, initial_mode) |
482 | + self.restore() |
483 | + restore_dir = 'testfiles/restore_out' |
484 | + restored = self.directory_tree_to_list_of_lists(restore_dir) |
485 | + self.assertEqual(restored, [['1sub1sub1'], |
486 | + ['1sub1sub1_file.txt']]) |
487 | + |
488 | + def test_locked_excl_if_present(self): |
489 | + """ Test no error if excluded locked with --exclude-if-present""" |
490 | + # Regression test for Bug #1620085 |
491 | + # https://bugs.launchpad.net/duplicity/+bug/1620085 |
492 | + folder_to_lock = "testfiles/select2/1/1sub1/1sub1sub3" |
493 | + initial_mode = os.stat(folder_to_lock).st_mode |
494 | + os.chmod(folder_to_lock, 0o0000) |
495 | + self.backup("full", "testfiles/select2/1/1sub1", |
496 | + options=["--exclude-if-present", "EXCLUDE.tag", |
497 | + "--include", "testfiles/select2/1/1sub1/1sub1sub1/*", |
498 | + "--exclude", "**"]) |
499 | + os.chmod(folder_to_lock, initial_mode) |
500 | + self.restore() |
501 | + restore_dir = 'testfiles/restore_out' |
502 | + restored = self.directory_tree_to_list_of_lists(restore_dir) |
503 | + self.assertEqual(restored, [['1sub1sub1'], |
504 | + ['1sub1sub1_file.txt']]) |
505 | + |
506 | |
507 | if __name__ == "__main__": |
508 | unittest.main() |
509 | |
510 | === added file 'testing/gnupg/gpg.conf' |
511 | --- testing/gnupg/gpg.conf 1970-01-01 00:00:00 +0000 |
512 | +++ testing/gnupg/gpg.conf 2016-09-05 14:30:45 +0000 |
513 | @@ -0,0 +1,9 @@ |
514 | +# gpg2 doesn't try all secrets by default, so add this option |
515 | +# Otherwise the tests with hidden encryption key will fail |
516 | +try-all-secrets |
517 | + |
518 | +# gpg2 2.1.13 has a bug that prevents the line above from working |
519 | +# (https://bugs.gnupg.org/gnupg/issue1985) |
520 | +# Uncomment the line below if you have gnupg2 2.1.13 |
521 | +# (but that line will break gpg 1.x, so we can't use it by default) |
522 | +#try-secret-key 96B629431B77DC52B1917B40839E6A2856538CCF |
523 | |
524 | === removed file 'testing/gnupg/gpg.conf' |
525 | --- testing/gnupg/gpg.conf 2016-08-01 14:57:22 +0000 |
526 | +++ testing/gnupg/gpg.conf 1970-01-01 00:00:00 +0000 |
527 | @@ -1,9 +0,0 @@ |
528 | -# gpg2 doesn't try all secrets by default, so add this option |
529 | -# Otherwise the tests with hidden encryption key will fail |
530 | -try-all-secrets |
531 | - |
532 | -# gpg2 2.1.13 has a bug that prevents the line above from working |
533 | -# (https://bugs.gnupg.org/gnupg/issue1985) |
534 | -# Uncomment the line below if you have gnupg2 2.1.13 |
535 | -# (but that line will break gpg 1.x, so we can't use it by default) |
536 | -#try-secret-key 96B629431B77DC52B1917B40839E6A2856538CCF |
537 | |
538 | === modified file 'testing/test_code.py' |
539 | --- testing/test_code.py 2016-07-02 19:39:05 +0000 |
540 | +++ testing/test_code.py 2016-09-05 14:30:45 +0000 |
541 | @@ -22,7 +22,10 @@ |
542 | import sys |
543 | import subprocess |
544 | |
545 | -import unittest |
546 | +if sys.version_info < (2, 7): |
547 | + import unittest2 as unittest # @UnresolvedImport @UnusedImport |
548 | +else: |
549 | + import unittest # @Reimport |
550 | |
551 | from . import _top_dir, DuplicityTestCase # @IgnorePep8 |
552 | |
553 | |
554 | === modified file 'tox.ini' |
555 | --- tox.ini 2016-07-02 19:33:34 +0000 |
556 | +++ tox.ini 2016-09-05 14:30:45 +0000 |
557 | @@ -1,5 +1,14 @@ |
558 | [tox] |
559 | -envlist=py27,lpbuildd-precise |
560 | +envlist=py26,py27,lpbuildd-precise |
561 | + |
562 | +[testenv:py26] |
563 | +setenv= |
564 | + RUN_CODE_TESTS=0 |
565 | +deps= |
566 | + mock==0.7.2 |
567 | + pexpect==2.4 |
568 | + ptyprocess==0.4 |
569 | + unittest2 |
570 | |
571 | [testenv:py27] |
572 | setenv= |
573 | @@ -20,5 +29,5 @@ |
574 | {envpython} {toxinidir}/setup.py test {posargs} |
575 | |
576 | [pep8] |
577 | -ignore=E402,E731 |
578 | +ignore=E402,E501,E731,W503 |
579 | max-line-length=120 |
Aaron, there are a lot of conflicts in this merge. Would you mind pulling the latest lp:duplicity and generating the merge again?