David Stainton
6ed4480eb9
Scan our own dmd upon start only
2016-07-21 12:35:59 -07:00
meejah
0aaabe0ebe
remove print
2016-07-21 12:35:59 -07:00
meejah
ed4e4d053e
Add a unit-test and correct the code for "already deleted"
...
If a Downloader decides that it needs to delete a file, but that
file is already gone locally, the exeption is caugt and a log message
produced.
2016-07-21 12:35:59 -07:00
David Stainton
49b5661347
Fix test: previously we accounted for the propagation of the conflict
...
because alice scaned her own dmd... whereas now she does not.
2016-07-21 12:35:59 -07:00
David Stainton
eab24d022b
Fix test helper _check_version_in_local_db
2016-07-21 12:35:59 -07:00
Daira Hopwood
9d59ef493f
WIP: Refactoring to get db fields in one query.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
David Stainton
bca4c87e47
WIP
2016-07-21 12:35:59 -07:00
Daira Hopwood
42f535edf9
Fix pending upload conflict detection.
...
Author: David Stainton <david@leastauthority.com>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
David Stainton
6eeab03b70
Create test for last upload uri conflict
2016-07-21 12:35:59 -07:00
Daira Hopwood
e8b6b31373
Detect remote conflict by checking for pending upload.
...
Author: David Stainton <david@leastauthority.com>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
David Stainton
c7f38a496d
Add debugging print statement for timestamp comparison
2016-07-21 12:35:59 -07:00
David Stainton
edc671f577
Add last uploaded timestamp comparison for remote conflict detection
2016-07-21 12:35:59 -07:00
Daira Hopwood
6402159106
Fix an unused import.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
c7f298bce5
Fix some miscapture bugs.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
868c38d228
Workaround.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
b21a3dc070
Simplify _notify and improve logging.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
17384ac512
Simplify _scan_remote_* and remove Downloader._download_scan_batch attribute.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
d686575393
Cosmetics.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
4f41be0e70
Downloader doesn't need the pending set.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
017d63b47b
Delete redundant is_ready attribute from MagicFolder.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
3fab5caa02
test_encodingutil: fixes for Unix.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
5f98d73216
Add precondition to Uploader._process.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
583066b364
Fix test_errors.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
9646a3ce3e
Fix test_move_tree.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
0c12162bc8
Debugging WIP.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
b53efdbf8b
Fix a corner case for to_filepath on Windows to make it consistent with Unix.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
b9eb8932b6
test_encodingutil: add tests for FilePath-related functions.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
b6b638efd1
Depend on FilePath.asTextMode().
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
84af199d51
WIP: exclude own dirnode from scan. This is not quite right; we shouldn't exclude it on startup. refs #2553
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
ea14b1bebe
Don't add subdirectory watches if the platform's notifier doesn't require them. refs #2559
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
6bb0963197
Improve reporting of assertion failures.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
a5b9cf36b8
Fix unused import.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
f77c593177
Add test for 'tahoe create-node/client/introducer' output. closes ticket:2556
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
d1eb64c01b
bin\tahoe can't be run directly on Windows.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
3647ffc3a7
Correct type for Windows BOOL.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
9dafa2e759
Disable precondition that autoAdd == recursive.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
a6842946ca
Fix a type error.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
0e19636146
Flush handling WIP.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
5e9792f8d7
Use fileutil.write for magic folder tests.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
f3803c058d
Improve all of the Windows-specific error reporting.
...
Also make the Windows function declarations more readable and consistent.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
c20cf843eb
Fix fileutil tests.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
dacf6ef633
More path fixes.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
f12ac3d94e
Fix a test broken by the last commit.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
a622109a87
Don't include [magic_folder]enabled and local.directory fields by default.
...
Add a comment reminding to do the field modification properly.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
6fb7f86855
Don't use a long path for the [magic_folder]local.directory field.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
2a79252a72
Fix some path Unixisms.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
45adc30ed6
Fix test_alice_bob.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
e591c3aa81
Refactor _check_up/downloader_count.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
1abc2c39c8
Don't download the deletion marker file unnecessarily.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
c6191257ea
Distinguish deletion of directories.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
d6bb49b1a6
Rename deleted files to .backup rather than unlinking them.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
David Stainton
a043a31860
Add file conflict unit test
2016-07-21 12:35:59 -07:00
David Stainton
99d1339d38
Add basic bob upload test and fix conflict detect
2016-07-21 12:35:59 -07:00
David Stainton
ee3d9b19be
Fix bob's uploading test...
2016-07-21 12:35:59 -07:00
David Stainton
890e4622b9
Attempt to teach bob to upload a file
2016-07-21 12:35:59 -07:00
David Stainton
9ed61f1eb4
Count conflicted objects
2016-07-21 12:35:59 -07:00
Daira Hopwood
7a3b35e29c
Basic remote conflict detection based on ancestor uri
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
f75dda7635
Avoid .format, since it is inconsistent between Python 2.6 and 2.7 (and the rest of Tahoe-LAFS doesn't use it).
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
5a2b2e61c7
Fix test_alice_bob.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
e4082a45d3
Add counter for uploader.objects_not_uploaded.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
95e2961a2e
Advance Bob's clock after notifying.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
6e5e8ddd80
test_alice_bob: use magic= argument to notify, rather than self.magicfolder.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
meejah
0d466ec1f9
add excluded check
2016-07-21 12:35:59 -07:00
meejah
c883977eb6
add the 'spurious' notifies
2016-07-21 12:35:59 -07:00
Daira Hopwood
c156581b73
Fix a pyflakes warning and check existence of file in Bob's local dir.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
meejah
d61b8ed39e
implement 'delete' functionality, with tests
2016-07-21 12:35:59 -07:00
meejah
946656b249
smoketest for magic-folder functionality
2016-07-21 12:35:59 -07:00
Daira Hopwood
cec315da49
Add test that we don't write files outside the magic folder directory. refs ticket:2506
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
567668eb8c
Fix infinite loop in should_ignore_path for absolute paths.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
5d5d804719
More debug logging.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
57753a62bc
Unicode fix for do_join.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
7d2f30643e
Minor cleanups to tests.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
f754938cc9
Ensure that errors from Alice-and-Bob tests are reported correctly if setup fails.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
b56c3e06e4
Cosmetics.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
2a7bb6f444
Eliminate duplicate parsing of invite code.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
c28594268e
Remaining test fixes.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
a5874070e3
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>
2016-07-21 12:35:59 -07:00
Daira Hopwood
ed2d27e712
Cosmetics.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
643a105991
URIs are strs.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
59eede8e88
Aliases and nicknames are Unicode.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
bb596b017d
Fix call to argv_to_abspath. Also rename localdir to local_dir.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
David Stainton
b32b61e727
Fix magic-folder cli tests
...
convert path to abs path when matching
strings in the generated config file.
2016-07-21 12:35:59 -07:00
David Stainton
a1beef34a7
Attempt to fix cli tests
2016-07-21 12:35:59 -07:00
Daira Hopwood
b2d494837c
Better but still broken tests.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
903c6f1d6c
Fix check for initial '-' in argv_to_abspath.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
David Stainton
0789d295a6
Fix tests by submitting unicode args instead of str
2016-07-21 12:35:59 -07:00
David Stainton
16275cb8f6
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
2016-07-21 12:35:59 -07:00
David Stainton
941f67f3b0
Use argv_to_abspath for magic-folder join file path arg
2016-07-21 12:35:59 -07:00
Daira Hopwood
5f6783e382
Test creation of a subdirectory.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
8184ed4414
Watch for IN_CREATE events but filter them out for non-directories.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
ee5245ed2c
Patch Downloader.REMOTE_SCAN_INTERVAL rather than setting it persistently.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
cbec939d86
Implement creating local directories in downloader.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
60ab5a057a
Decode names in the scanned remote.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
a3fa1617c2
Refactoring to allow logging from _write_downloaded_file and _rename_conflicted_file.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
6cb41cadf5
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>
2016-07-21 12:35:59 -07:00
Daira Hopwood
cb905d8d97
Logging/debugging improvements.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
fc3513d172
Refactor and fix race conditions in test_alice_bob.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
ac5730ea1c
Correct a call to did_upload_version in the downloader.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
8a6dae6d59
Make sure that test_move_tree waits until files have been uploaded as well as downloaded.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
28587b5b2a
Restore a call to increment files_uploaded that was mistakenly removed.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
David Stainton
2fcaa8c2b2
Teach uploader+downloader to use to db schema
...
here we attempt to fix all the unit tests as well...
however two tests still fail
2016-07-21 12:35:59 -07:00
Daira Hopwood
5754c01cb5
Add magicfolderdb.py.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
David Stainton
615859acc1
Remove magic-folder db code from backupdb.py
2016-07-21 12:35:59 -07:00
David Stainton
e2cee9ba2a
WIP
2016-07-21 12:35:59 -07:00
David Stainton
3c50764486
Minor comment correction for get_all_relpaths
2016-07-21 12:35:59 -07:00
David Stainton
f8bb229ab7
For all downloaded files ensure parent dir exists
2016-07-21 12:35:59 -07:00
Daira Hopwood
c2d672e0b6
Simplify the cleanup_Alice_and_Bob callback.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
meejah
94a2ef0095
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
2016-07-21 12:35:59 -07:00
meejah
9aecfed421
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)
2016-07-21 12:35:59 -07:00
meejah
4ed2fb725a
Fix call to ready()
2016-07-21 12:35:59 -07:00
Daira Hopwood
31ab5cf4ed
Correct a string-type error.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
e03a1e3361
WIP.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
262e238a7d
Magic Folder file moves.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
3170cab0fc
Prepare to move drop_upload.py to magic_folder.py.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
76a178969d
Move backupdb.py to src/allmydata.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
976c89d2e4
Rename upload_ready_d to connected_enough_d.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
5f143f7635
Enable Windows inotify support.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
e7fb665e06
New code for Windows drop-upload support. refs #1431
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
61b3a9cef2
Add magic folder db.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
7b4067850f
Unicode path fixes for drop-upload.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Brian Warner
b6dedc6223
clean up got_static_announcement() call
2016-07-19 17:31:43 -07:00
Brian Warner
2c5f7ed425
factor out yamlutil.py
...
The yaml.SafeLoader.add_constructor() should probably only be done once,
and moving this all into a module gives us an opportunity to test it
directly.
2016-07-19 17:31:41 -07:00
Brian Warner
9c1e22209f
client.py: add missing import, fix wrong name
...
Without these, clients with a non-empty connections.yaml would crash as
they start up. It's safe to say we need some tests for this :-).
pyflakes catches all of these, but it got accidentally disabled
recently, so travis wasn't running it. I'll fix that in the next commit.
2016-07-19 17:30:45 -07:00
David Stainton
9063106f3a
Change 'servers' sections of connections.yaml to support new design in #2788
2016-07-12 17:44:21 +01:00
David Stainton
a67e7c0db9
Remove old self.testing reference and conditional
2016-07-12 17:44:21 +01:00
David Stainton
e4d93a745c
Load static server configuration from connections.yaml
2016-07-12 17:44:21 +01:00
Brian Warner
7d692d0afd
Split control and log to two separate tubs, remove control knobs.
...
This also removes the tahoe.cfg keys that would have configured the
control-port. And it deletes the logport.furl file before asking the Tub
to re-create it, because we're now using an ephemeral Tub (so we're not
persisting the private key, so the tubid will change each time).
closes ticket:2794
2016-07-06 21:09:35 -07:00
David Stainton
e5ffbdbcdf
Move control/logging to a separate Tub
2016-07-06 21:09:35 -07:00
Brian Warner
3402f75454
copy fixed allocate_tcp_port() from foolscap
...
The old copy had a bug which occasionally returns a port that was
actually in use, causing intermittent test failures (when large numbers
of ports were allocated). I finally figured out how to fix it in
Foolscap, so this is just a copy of the updated function.
closes ticket:2795
2016-07-06 19:20:32 -07:00
Brian Warner
a39270bd46
more v1-introducer cleanup: require sigs
...
This removes a little bit of code that tolerated unsigned announcements.
2016-07-05 16:41:15 -07:00
Brian Warner
6f1e01453e
remove make_index()
...
index is now always (service_name, key_id)
2016-06-29 23:06:40 -07:00
Brian Warner
b2e5507e09
sign_to_foolscap: require key
2016-06-29 23:06:40 -07:00
Brian Warner
ae91fa9ffe
require all outbound announcements to be signed
2016-06-29 23:06:40 -07:00
Brian Warner
c64ff7b310
more v1 removal cleanup
...
Historical note: V2 introducers have been around for three years
now (released in 1.10.0), so it's time to drop v1. This branch removes a
lot of fallback code, and tests which exercised it. refs ticket:2784
This patch removes some now-unused code: v1-related support functions on
the client, "stub-client" handlers, and v1-tolerant remote methods on
the server. The unit tests have been cleaned up a bit too, now that
there are fewer cases to exercise.
2016-06-29 22:58:14 -07:00
David Stainton
7feee8a25e
Butcher unit tests until all test_introducer tests pass
2016-06-02 17:20:31 +00:00
David Stainton
ea35563b81
Remove v1 introducer code and fix tests
...
Fixed many of the test_introducer tests.
Work-in-progress.
2016-06-02 16:47:58 +00:00
Brian Warner
0ff00dff6f
test loading the cache
2016-05-11 18:17:22 -07:00
Brian Warner
5bedca43e3
load-yaml-cache cleanups
...
* use yaml.safe_load and yaml.safe_dump
* configure SafeLoader to return unicode consistently, not str
* log+ignore bad cache, instead of throwing error, since we're already
in the log+ignore chain from connect_failed()
* use a local exception type, instead of one from storage_client.py
* delegate delivery to self._deliver_announcements
Using yaml.safe_dump gives us:
- ann:
my-version: tahoe-lafs/1.11.0.post96.dev0
nickname: node-4
instead of:
- ann:
!!python/unicode 'my-version': !!python/unicode 'tahoe-lafs/1.11.0.post96.dev0'
!!python/unicode 'nickname': !!python/unicode 'node-4'
We want SafeLoader to consistently return unicode instead of sometimes
plain strings (for ASCII-safe values) and sometimes unicode
(for everything else). The data we write into the cache was all unicode
to start with (it came from a JSON parser), so it seems better to get
back unicode too.
2016-05-11 18:15:50 -07:00
David Stainton
5508f751b6
Load announcement cache if failure to connect to introducer
2016-05-11 16:48:09 -07:00
Brian Warner
cfb939aa99
improve test_client_cache
2016-05-11 16:48:05 -07:00
Brian Warner
ecec58b339
test_introducer: factor out _load_cache
2016-05-11 15:03:32 -07:00
Brian Warner
1197b15106
introducer_client: split out _deliver_announcements
2016-05-11 12:54:11 -07:00
Brian Warner
155ca03174
test_introducer: cleanups
...
* Use tempfile for cache to avoid collisions
* Fix pyflakes complaints
* Remove test_client_cache_2, which exercises unsigned announcements.
These are scheduled to be removed soon (see ticket:2784) and don't
need to be tested.
2016-05-10 12:14:36 -07:00
Brian Warner
0c2dd8b86b
IntroducerClient: small changes to cache handling
...
* don't remove the cache at connection establishment, we can just wait
for the first announcement to truncate the cache
* save announcements before notifying subscribers, so they can safely
read it right away
* remove unused self._got_announcement_cb
2016-05-10 12:14:04 -07:00
David Stainton
ae2b82a1f0
Add IntroducerClient write-only yaml cache file
...
this change also includes unit tests
2016-05-10 20:19:35 +00:00
Brian Warner
608719df91
tox: add "coverage" environment
...
Run with "tox -e coverage". Uses a new helper
module (allmydata.test.run_trial) to let us import+execute trial without
knowing exactly where the "trial" binary lives, which helps with using
"coverage run" under tox.
2016-05-09 14:32:21 -07:00
Brian Warner
93bb3e995a
stats-gatherer: add --hostname/--location/--port
...
Updates docs, tests, explains how to update an old gatherer.
2016-05-04 17:58:45 -07:00
Brian Warner
d1d988410b
remove "key-generator" node type and client support
...
closes ticket:2783
2016-05-04 16:53:04 -07:00
meejah
fa418a7809
appease windows, and skip test
2016-05-04 07:54:42 -07:00
Daira Hopwood
dd02f31a3b
Fix missing import
2016-05-04 07:54:42 -07:00