Commit Graph

3433 Commits

Author SHA1 Message Date
Brian Warner
e80697da1b test_cli_cp.py: turn off debug mode, tests now assert for real 2015-03-03 18:20:03 -08:00
Brian Warner
2a361bc46f tahoe cp: overhaul target assignment, update tests
This substantially changes the internals of "tahoe cp", to behave in
accordance with the scheme developed in ticket:2329. test_cli_cp.py got
a large new test to exercise all the various combinations. This also
changes the set of error messages that "tahoe cp" can produce.

This modifies try_copy(), inserts a new implementation of
copy_things_to_directory() (and supporting methods), and fixes a few
bugs elsewhere.

fixes ticket:2329
2015-03-03 18:19:58 -08:00
Brian Warner
ca92bfdc88 tahoe_cp: delete copy_to_directory() code
This code will be replaced in the next commit with an entirely different
approach, and modifying it in a single commit would yield a completely
unreadable diff.
2015-03-03 18:18:17 -08:00
Brian Warner
c32c8794bc tahoe_cp: simplify some checks, rename some functions
no behavioral changes
2015-03-03 18:03:17 -08:00
Brian Warner
6d84cdd35d tahoe_cp.py: use s.basename() instead of tracking it separately 2015-02-24 02:07:57 -08:00
Brian Warner
98ec466d54 tahoe_cp.py: store basename in the Source instance 2015-02-24 01:55:53 -08:00
Brian Warner
be4b13c318 test_cli.py: split the largest test classes out into separate files
That file was getting unruly. No behavioral changes, apart from tests
now having different names.
2015-02-24 01:41:23 -08:00
Daira Hopwood
5a37ff0d0e Discourage future readers of iputil.py from using Win32 APIs in preference to route.exe.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-02-19 17:41:09 +00:00
Daira Hopwood
c5817c3ce3 It is Twisted 12.2.0 that starts depending on pywin32 for endpoints, not Twisted 12.3.0.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-02-17 19:11:57 +00:00
Daira Hopwood
0b24756cc7 Allow multiple occurrences of AUTO. refs #754
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-02-10 17:31:10 +00:00
Daira Hopwood
759512da28 Add tests for combining autodetected and statically configured locations. refs #754
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-02-10 17:12:43 +00:00
Daira Hopwood
10ebbeebaa test_node.py: refactor test_location* to reduce code duplication. refs #754
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-02-10 17:12:43 +00:00
Daira Hopwood
ca3c7abe3a Only get the local addresses if they are actually used. refs #754
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-02-10 17:12:43 +00:00
Daira Hopwood
c9a56eae2b Allow combining autodetected and statically configured locations. fixes #754
Replaces the location 'AUTO' with the autodetected IP/port combination.

Author: Chris Kerr <debdepba@dasganma.tk>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-02-09 19:18:58 +00:00
Daira Hopwood
9ac392802b Test the quotemarks=True and quotemarks=False options of quote_local_unicode_path.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-02-05 02:22:27 +00:00
Daira Hopwood
d53c7ee905 Test the quotemarks=False option of encodingutil.quote_path.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-02-05 02:13:23 +00:00
Daira Hopwood
fc90607eec Further refine error handling in windows_getenv to correctly handle zero-length environment values. refs #1674
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-02-04 17:02:02 +00:00
Brian Warner
30987c1e7d remove stray trailing whitespace 2015-02-04 01:35:44 -08:00
Brian Warner
597542dc77 test that web.static= is really treated as a relative path
Also ssh.authorized_keys_file .
2015-02-03 22:23:31 -08:00
Daira Hopwood
86726729b7 Quote the default node-directory correctly in help output. refs #2235
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-02-04 00:10:21 +00:00
Daira Hopwood
d756ef1765 More robust error handling in windows_getenv. refs #1674
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-02-03 23:47:53 +00:00
Brian Warner
7426eccb29 tahoe_cp.py: clean up unicode handling 2015-02-03 11:10:36 -08:00
Daira Hopwood
8147f3c77e Changes filename to unicode before placing the file. refs #2027
Author: Mark Berger <mark.berger.j@gmail.com>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-30 00:50:25 +00:00
Daira Hopwood
b6a645aeb3 Adds test_ticket_2027 to test_cli.Cp. refs #2027
Author: Mark Berger <mark.berger.j@gmail.com>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-30 00:50:25 +00:00
Daira Hopwood
c1d5c4f07a Fix user-path-expansion on Windows for non-ASCII home directories. refs #1674
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-30 00:50:24 +00:00
Daira Hopwood
14f783086f Change uses of os.path.expanduser and os.path.abspath. refs #2235
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-30 00:50:18 +00:00
Daira Hopwood
4a0cdce86b Use absolute paths in tahoe cp and tahoe backup. refs #2235
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-30 00:47:35 +00:00
Daira Hopwood
21b477f235 Add support in abspath_expanduser_unicode for expanding relative to a base path. refs #2235
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-30 00:47:09 +00:00
Daira Hopwood
95f98e1aae Quote local paths correctly. refs #2235
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-30 00:05:20 +00:00
Daira Hopwood
c20a3525b7 Use "long" paths prefixed with \\?\ on Windows. refs #2235
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-30 00:05:14 +00:00
Daira Hopwood
9a401b760e fileutil cleanup: delete the unused open_or_create function.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-29 18:19:57 +00:00
Mark Berger
db12f1cffb Adds _servers_with_shares to ServermapUpdater
When calculating the query boundary for updates to mutable files,
instead of using servers that used to have shares, use servers we
have added to the servermap. This way the querying process won't finish
until we have finished interacting with the servers that have shares.

This fixes the race condition which sometimes caused the querying process
to finish before the updater was done talking to servers with shares.
2015-01-27 00:40:14 -08:00
Brian Warner
38a4acd623 Appease req.setHeader by passing bytes, not ints.
twisted.web.http.Request.setHeader() really wants a "bytes" object, but
we've been passing integers like len(body). Twisted-12.3 started to
complain about this (with a DeprecationWarning), but the warning is
usually silenced because py2.7 disables deprecations by default.

This fixes Tahoe's misbehavior, but others remain (in Nevow, at least).
I plan to set up some tooling to run tests with
PYTHONWARNINGS=default::DeprecationWarning and collect others. We won't
be able to fix the ones that occur outside of Tahoe, but at least we
should be able to fix our own.

refs ticket:2312
2015-01-21 10:31:31 -08:00
Brian Warner
3ad18648dd welcome.xhtml: improve layout by floating the icons to the left.
This uses less vertical space.
2015-01-20 17:24:27 -08:00
Nathan Wilcox
e499d84755 Introduce icons with distinct shape for connection status display on the front wui page...
This replaces the status display which was only distinct by color which is a usability issue for color-blind users.  This commit includes test coverage by way of pattern matching on rendered templates.  The PNG icons are conversions of original SVG source which I've included and placed in the public domain.
2015-01-20 16:41:01 -08:00
Daira Hopwood
e73d76eb1b Latest cryptography depends on enum34.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-20 10:52:07 -08:00
Daira Hopwood
ef455df990 dependecy specs: tolerate new PEP440 semantics too
The latest setuptools (version 8) changed the way dependency
specifications ("I can handle libfoo version 2 or 3, but not 4") are
interpreted. The new version follows PEP440, which is simpler but
somewhat less expressive. Tahoe's _auto_deps.py now uses dep-specs which
are correctly parsed by both old and new setuptools.

Fixes ticket:2354.

* Restrict the requirements in _auto_deps.py to work with either the old
  or PEP 440 semantics.
* Update check_requirement and tests to take account of changes for PEP
  440 compatibility.
* Fix an error message.
* Remove a superfluous TODO.
2015-01-20 10:52:02 -08:00
Daira Hopwood
0e9f0da51f Reserve all keytypes starting with "ssh-" in an accounts file, rather than only "ssh-rsa" and "ssh-dsa".
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-06 19:09:04 +00:00
Daira Hopwood
6c756ba3e9 Simplify key checking code by inlining _allowedKey and _correctSignature. refs #1141
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-06 18:10:41 +00:00
Jean-Paul Calderone
102d581a90 Give out FTPAvatarID objects instead. 2015-01-04 09:48:38 -05:00
Jean-Paul Calderone
38aee94a3e Add the rest of the failure-case tests and a success-case test. Update the implementation to make them pass. 2015-01-04 09:44:56 -05:00
Jean-Paul Calderone
79a6be565b Add a test for the bad key case of unauthorized ssh key checking. 2015-01-04 08:02:49 -05:00
Jean-Paul Calderone
f3cb2d42d7 Add a test for one unauthorized case of ssh key checking. 2015-01-04 08:02:23 -05:00
Matt Hazinski
4a18f03960 Move UDP listen inside try block 2014-12-29 20:21:24 -05:00
Daira Hopwood
e4149496d2 Fix minor dependencies on "allmydata-tahoe" as appname.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-12-05 23:29:07 +00:00
Daira Hopwood
c0a2af5d69 test_storage_client.py: add test_get_available_space_{old,new}.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-11-23 06:03:00 +00:00
Leif Ryge
b9e0d19944 add available-space to VERSION_DEFAULTS
as per warner's suggestion in https://github.com/warner/tahoe-lafs/pull/4
2014-11-23 06:03:00 +00:00
Leif Ryge
336688165e tests for "Available" column (#648)
thanks to the anonymous author who posted this on trac
2014-11-23 06:03:00 +00:00
Leif Ryge
335c2ed06a add "Available" column to welcome page (#648)
add get_available_space() to NativeStorageServer

It uses a new 'available-space' key in the server's v1 version dict, or falls
back to 'maximum-immutable-share-size' (which presently always has the same
value but could have a different meaning in the future).

This is a squash merge of 9773555bb87fab71145ad7a0e84785a4e92d11f7
2014-11-23 06:03:00 +00:00
Leif Ryge
bca538ac64 rm NativeStorageServer's unused min_shares argument 2014-11-22 04:08:45 +00:00