Commit Graph

6240 Commits

Author SHA1 Message Date
Daira Hopwood
e067d2d682 Add test that we don't write files outside the magic folder directory. refs ticket:2506
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-22 14:30:13 +01:00
Daira Hopwood
35e05fa979 Fix infinite loop in should_ignore_path for absolute paths.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-22 14:28:26 +01:00
Daira Hopwood
ae27bc2b83 More debug logging.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-22 14:27:39 +01:00
Daira Hopwood
98879af6e9 Unicode fix for do_join.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-20 21:50:00 +01:00
Daira Hopwood
f7e02c51b3 Minor cleanups to tests.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-20 21:43:54 +01:00
Daira Hopwood
b5b301707b Ensure that errors from Alice-and-Bob tests are reported correctly if setup fails.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-20 21:37:05 +01:00
Daira Hopwood
fadd2049bb Cosmetics.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-20 21:36:11 +01:00
Daira Hopwood
3d4deca0b2 Eliminate duplicate parsing of invite code.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-20 21:19:04 +01:00
Daira Hopwood
dc77acc424 Remaining test fixes.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-20 17:31:03 +01:00
Daira Hopwood
3eecd1ab2e Make sure that do_cli is only called with strs, and avoid unnecessary use of attributes in tests.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-20 17:30:53 +01:00
Daira Hopwood
1552b7dde0 Cosmetics.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-20 17:27:38 +01:00
Daira Hopwood
db536a3bce URIs are strs.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-20 17:16:32 +01:00
Daira Hopwood
238479305f Aliases and nicknames are Unicode.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-20 17:13:58 +01:00
Daira Hopwood
8c4a9b08ee Add precondition that arguments to do_cli are strs.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-20 15:12:36 +01:00
Daira Hopwood
f1ed5b7136 Fix call to argv_to_abspath. Also rename localdir to local_dir.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-20 14:52:00 +01:00
David Stainton
aa4a3c2da4 Fix magic-folder cli tests
convert path to abs path when matching
strings in the generated config file.
2015-10-20 14:27:05 +02:00
David Stainton
2e587937c1 Attempt to fix cli tests 2015-10-20 13:08:14 +02:00
Daira Hopwood
b032ab829f Better but still broken tests.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-19 18:25:02 +01:00
Daira Hopwood
588002a8b1 Fix check for initial '-' in argv_to_abspath.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-19 18:24:33 +01:00
David Stainton
09871d76c7 Fix tests by submitting unicode args instead of str 2015-10-19 16:14:12 +02:00
David Stainton
ef39ca17ba Teach magic-folder join to use argv_to_abspath
- also we modify argv_to_abspath to through a usage error
if the name starts with a '-'

- add a test
currently the tests fail
2015-10-19 16:02:28 +02:00
David Stainton
3367b40990 Use argv_to_abspath for magic-folder join file path arg 2015-10-19 14:14:32 +02:00
Daira Hopwood
fb55baa91b Test creation of a subdirectory.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-16 20:39:39 +01:00
Daira Hopwood
58388bebf1 Watch for IN_CREATE events but filter them out for non-directories.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-16 16:21:50 +01:00
Daira Hopwood
5297f99116 Patch Downloader.REMOTE_SCAN_INTERVAL rather than setting it persistently.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-16 03:27:59 +01:00
Daira Hopwood
07b80cf669 Implement creating local directories in downloader.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-16 03:27:20 +01:00
Daira Hopwood
dad9b11853 Decode names in the scanned remote.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-16 03:25:45 +01:00
Daira Hopwood
8c8d1885ce Refactoring to allow logging from _write_downloaded_file and _rename_conflicted_file.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-16 03:24:46 +01:00
Daira Hopwood
8348913b8a Simplify and fix non-existent-file handling.
Also make the existent and non-existent cases as similar as possible,
with a view to merging them.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-15 23:02:30 +01:00
Daira Hopwood
1d0e2b5cda Logging/debugging improvements.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-15 23:02:07 +01:00
Daira Hopwood
768b478cb9 Refactor and fix race conditions in test_alice_bob.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-15 22:56:38 +01:00
Daira Hopwood
257da9f86d Correct a call to did_upload_version in the downloader.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-13 15:56:31 +01:00
Daira Hopwood
fd506bd550 Make sure that test_move_tree waits until files have been uploaded as well as downloaded.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-13 15:56:00 +01:00
Daira Hopwood
6945b85ce7 Restore a call to increment files_uploaded that was mistakenly removed.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-13 15:55:00 +01:00
David Stainton
37269740dd Teach uploader+downloader to use to db schema
here we attempt to fix all the unit tests as well...
however two tests still fail
2015-10-12 20:07:39 +02:00
Daira Hopwood
2342393d8a Add magicfolderdb.py.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-08 16:02:34 +01:00
David Stainton
c82f977fb7 Remove magic-folder db code from backupdb.py 2015-10-08 16:02:34 +01:00
David Stainton
f819aa5b5d WIP 2015-10-08 16:02:34 +01:00
David Stainton
70c623d7d3 Include brief summary of magic-folder CLI commands 2015-10-08 16:02:34 +01:00
David Stainton
7868f0b400 Add link to our cli design doc 2015-10-08 16:02:34 +01:00
David Stainton
fd34630218 Mention gc is not part of the otf grant and link to the gc ticket 2015-10-08 16:02:34 +01:00
David Stainton
30feb122c5 Remove old obsolete/inaccurate statements 2015-10-08 16:02:34 +01:00
David Stainton
5d7d2febc6 Minor comment correction for get_all_relpaths 2015-10-08 16:02:34 +01:00
David Stainton
531747303d For all downloaded files ensure parent dir exists 2015-10-08 16:02:34 +01:00
Daira Hopwood
27fb403dad Simplify the cleanup_Alice_and_Bob callback.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-08 14:54:39 +01:00
meejah
1377aecbd7 Make downloader delay a class-variable
This gives the integration-style CLI-based tests a chance
to set the delay to 0 before the first 3-second delayed
call is queued to _lazy_tail in the Downloader
2015-10-08 14:54:39 +01:00
meejah
906d3da819 Teach unit-tests to time-warp
1. Split alice/bob clocks to avoid races conditions
   in the tests
2. Wrap ._notify so we can advance the clock after inotify
   calls in the RealTest (since it takes >0ms to do the "real" notifies)
2015-10-08 14:54:39 +01:00
Daira Hopwood
bfbc20f40b Merge pull request #193 from meejah/2438.magic-folder-stable.3
Fix call to ready()
2015-10-08 14:07:05 +01:00
meejah
c398218c55 Fix call to ready() 2015-10-06 14:11:32 -06:00
Daira Hopwood
0b5039d253 Correct a string-type error.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-10-02 22:08:54 +01:00