Commit Graph

3622 Commits

Author SHA1 Message Date
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
Daira Hopwood
fc886a7d02 Improve error reporting and help for start/stop/etc. commands.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-10-21 19:15:32 +01:00
Daira Hopwood
13ae872ace startstop_node.py: rename internal command and twistd plugin class used to start tahoe nodes.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-10-21 19:04:14 +01:00
Brian Warner
87a6894e62 'tahoe start': stop using the contents of .tac files
Instead of constructing a sys.argv for 'twistd' that reads the node's
.tac file, we construct arguments that tell twistd to use a special
in-memory-only plugin that creates the desired node instance directly.

We still use the name of the .tac file to decide which kind of instance
to make (Client, IntroducerNode, KeyGenerator, StatsGatherer), but never
actually read the contents of the .tac file. Later improvements could
change this to look inside the tahoe.cfg for a nodetype= directive, etc.

This also makes it easy to have "tahoe start BASEDIR" pass the rest of
its arguments on to twistd, so e.g. "tahoe start BASEDIR --nodaemon
--profile=prof.out" does what you'd expect "twistd --nodaemon
--profile=prof.out" to do. "tahoe run BASEDIR" is thus simply aliased to
"tahoe start BASEDIR --nodaemon". This removes the need to special-case
--profile and --syslog.

I also removed some of the default logging behavior:

 before:
  'tahoe start' = 'twistd --logfile BASEDIR logs/twistd.log'
  'tahoe start --profile' adds '--profile=profiling_results.prof --savestats'
  'tahoe run' = 'twistd --nodaemon --logfile BASEDIR/logs/tahoesvc.log'

 after:
  'tahoe start' = 'twistd --logfile BASEDIR logs/twistd.log'
     unless --logfile, --nodaemon, or --syslog are passed
  'tahoe start --profile' invalid, use 'tahoe start --profile=OUTPUT'
  'tahoe run' = 'twistd --nodaemon'
     so log messages go to stdout

This finally enables 'tahoe run' to work with all node types, including
the key-generator and stats-gatherer.

It gets 'tahoe start' one step closer to accepting --reactor= . To
actually accomplish this will require this file, the enclosing
__init_.py files, and everything they import to avoid importing the
reactor. (if anything imports twisted.internet.reactor before
startstop_node.start() gets to run, then --reactor= comes too late).
That will take a lot of work, and requires lazy-loading of many core
libraries (foolscap.logging in particular), and removing a lot of code
from src/allmydata/__init__.py .
2014-10-21 19:02:25 +01:00
Daira Hopwood
323cff5b56 Remove an unused import.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-10-10 20:39:18 +01:00
Daira Hopwood
346b5c4c3d Don't call filenode.get_size() twice. refs #1634
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-10-10 20:36:08 +01:00
zooko
200492760a Merge pull request #120 from zancas/1634-dont-return-none_5
1634 dont return none 5
2014-10-10 19:16:12 +00:00
zancas
425b9049ea Do not report 'size' metadata if get_size returns None 2014-10-10 11:27:28 -06:00
zancas
1545e14076 exercise all branches of new helper "get_filenode_metadata"
Note fix following issues from origial commit:

refactor unittests, fix style, add test

(0) use CommonFixture as mixin to increase DRYness
(1) self.failUnlessIn('size', metadata.keys()) --> self.failUnlessIn('size', metdata)
(2) test_size_is_not_None --> test_size_is_0 AND test_size_is_1000
2014-10-10 11:27:27 -06:00
zancas
0baa744411 refactor get_filenode_metadata(...) into common.py 2014-10-10 11:19:25 -06:00
Daira Hopwood
5bd76005a6 Correct a comment about which version of Twisted introduces a pywin32 dependency (12.3.0, not 13.0).
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-10-08 12:57:31 +01:00
Daira Hopwood
b0b76a7c5b Improve comments in _auto_deps.py. refs #2249, #2028, #2193, #2005, #1258
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-10-07 21:04:40 +01:00
Daira Hopwood
680559d58e _auto_deps.py cosmetics and cleanup.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-10-07 19:11:23 +01:00
Daira Hopwood
18ffc29f49 Only allow pyOpenSSL >= 0.14 if it is already installed. fixes #2193
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-10-07 19:11:13 +01:00
Daira Hopwood
ec188d254c Make dependencies different for Windows and non-Windows. fixes #2249
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-10-07 19:11:00 +01:00
Daira Hopwood
b2e897c2a9 Move require_more() to top-level.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-10-07 19:06:14 +01:00
Daira Hopwood
ea09305987 Refactoring to move the not_import_versionable and ignorable package lists to _auto_deps.py.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-10-02 16:42:44 +01:00
Loose Cannon
7bfa9c64fb 1901 - Fix Welcome Page
Solution was very simple to implement, no content disposition header was
necessary.
Tested with both Firefox and Chrome, using binary image file stored in
folder, as well as with text data using LIT cap.
2014-09-26 17:02:14 -04:00
Brian Warner
d27a57cb49 Avoid Popen() of executables that don't exist
The stdlib 'subprocess' module in python-2.7.4 through 2.7.7 suffers
from http://bugs.python.org/issue18851 which causes unrelated file
descriptors to be closed when `subprocess.call()` fails the `exec()`,
such as when the executable being invoked does not actually exist. There
appears to be some randomness involved. This was fixed in python-2.7.8.

Tahoe's iputil.py uses subprocess.call on many different "ifconfig"-type
executables, most of which don't exist on any given platform (added in
git commit 8e31d66cd0). This results in a lot of file-descriptor
closing, which (at least during unit tests) tends to clobber important
things like Tub TCP sockets. This seems to be the root cause behind
ticket:2121, in which normal code tries to close already-closed sockets,
crashing the unit tests. Since different platforms have different
ifconfigs, some platforms will experience more failed execs than others,
so this bug could easily behave differently on linux vs freebsd, as well
as working normally on python-2.7.8 or 2.7.4.

This patch inserts a guard to make sure that os.path.isfile() is true
before allowing Popen.call() to try executing the target. This ought to
be enough to avoid the bug. It changes both iputil.py and
allmydata.__init__ (which uses Popen for calling "lsb_release"), which
are all the places where 'subprocess' is used outside of unit tests.

Other potential fixes: use the 'subprocess32' module from PyPI (which is
a bug-free backport of the Python3 stdlib subprocess module, but would
introduce a new dependency), or require python >= 2.7.8 (but this would
rule out development/deployment on the current OS-X 10.9 release, which
ships with 2.7.5, as well as other distributions like Ubuntu 14.04 LTS).

I believe this closes ticket:2121, and given the apparent relationship
between 2121 and 2023, I think it also closes ticket:2023 (although
since 2023 doesn't have copies of the failing log files, it's hard to
tell). I'm hoping that this will tide us over until 1.11 is released, at
which point we can execute on the plan to remove iputil.py entirely by
changing the way that nodes learn their externally-facing IP address.
2014-09-12 13:01:56 -07:00
Brian Warner
38668c9e35 test_disk_stats: tolerate used==0 for a Travis worker bug
Some Travis-CI workers report persistently empty disks, causing spurious
test failures. It's not really that important to assert used>0, so this
relaxes the test.

Closes ticket:2290
2014-09-12 12:55:52 -07:00
Brian Warner
528364a421 welcome.xhtml: explain MDMF too 2014-09-11 21:32:27 -07:00
Scott Arciszewski
62a4b2721c Update welcome.xhtml
Add a tooltip to explain what SDMF means. Cannot find a definition for MDMF; I presume "Medium" but at the risk of being wrong, I don't want to just blindly make that suggested change.
2014-09-11 21:29:13 -07:00
Brian Warner
6ffcb50173 Remove 'trialcoverage' plugin and support code
Closes ticket:2281 (trac).

This removes src/allmydata/test/trial_coverage.py, which was a
in-process way to run trial tests under the "coverage" code-coverage
tool. These days, the preferred way to do this is with "coverage run",
although the actual invocation is a bit messy because of the way
bin/trial uses subprocess.call() to invoke the real entrypoint script
with the right PYTHONPATH (see #1698 for details). Hopefully this will
be improved to use a simpler "coverage run .." command in the future.

This patch also removes twisted/plugins/allmydata_trial.py, which
enabled the "--reporter=bwverbose-coverage" option. Finally it modifies
setup.py to stop looking for that option and adding "trialcoverage" to
the dependencies list, which gets us closer to removing "setup_requires"
entirely.
2014-09-08 17:28:26 -07:00
Mark Berger
954229231d Removes unnecessary import 2014-09-02 18:48:39 -07:00
Mark Berger
e594f2b1ab Fixes tests which were improperly deleting shares 2014-09-02 18:48:39 -07:00
Mark Berger
2ab6172302 Adds delete_all_shares 2014-09-02 18:48:39 -07:00
Mark Berger
1467eb53b9 Deletes shares from server 0 correctly
Deletes the shares from server 0 without setting the remaining
size to 0
2014-09-02 18:48:39 -07:00
Brian Warner
58b66b4018 check_memory: stop using long-deprecated twisted internals 2014-09-02 18:22:59 -07:00
Leif Ryge
d7aef0cffb add a <br> 2014-09-02 13:55:13 -07:00
Mark J. Berger
52859423ba Updates webui directory forms 2014-09-02 13:55:13 -07:00
Leif Ryge
61395328c3 make tests pass with redesigned directory pages 2014-09-02 13:55:13 -07:00
Tony Arcieri
c1f3008d03 Redesigned directory pages (WIP)
This is an initial conversion of the directory pages from the old style
to the new style which is based on Twitter Bootstrap.

Still some remaining work to be done. You can see a screenshot here:

http://i.imgur.com/MPEngGx.png
2014-09-02 13:55:12 -07:00
Brian Warner
7015f21e5a welcome page: improve CSS slightly for narrow windows
Thanks to tarcieri for the patch.

refs ticket:1931
2014-09-02 13:44:53 -07:00
Brian Warner
45adde7180 publish.py: log roothash in base32, not binary
Closes ticket:1800
2014-09-02 13:32:59 -07:00
Mark Berger
47c8616dd5 Fix tests which relied on the old behavior of tahoe cp -r 2014-09-02 12:51:13 -07:00
Mark Berger
1c96039270 tahoe cp -r now copies the top level directory with its children 2014-09-02 12:51:13 -07:00
Mark Berger
2d8ffdc0ee Adds test_cli.Cp.test_cp_copies_dir 2014-09-02 12:51:13 -07:00
Daira Hopwood
e613111c45 Suppress a DeprecationWarning from Twisted.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-09-01 21:12:53 +01:00
travis-tahoe
036c325d35 Suppress all UserWarnings, not just ones with known messages. refs #2248
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-09-01 19:39:57 +01:00
travis-tahoe
cc223d08fa Suppress warning about service_identity. fixes #2248
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-09-01 19:10:32 +01:00
travis-tahoe
7ecc27e2d9 Revert previous patch; service_identity has too many subdependencies.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-09-01 19:04:10 +01:00
travis-tahoe
f7b8fe02ba Add service_identity as a dependency. fixes #2248
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-09-01 18:46:58 +01:00
Daira Hopwood
91077f084d test_runner: rename *_FILE variables to lowercase, because they are not constants.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-08-17 15:51:19 +01:00
Daira Hopwood
647ebce6b9 Better name for the file that causes a node to exit after a timeout when running unit tests. refs #1336
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-08-17 15:51:19 +01:00
Zooko Wilcox-O'Hearn
617f667769 remove obsolete comment 2014-08-05 16:36:59 +00:00
Brian Warner
99479226ed hush current pyflakes warnings (list comprehensions)
closes #2245
2014-06-23 13:54:07 -07:00
Daira Hopwood
488cfb939f Fix a pyflakes warning.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-05-05 23:17:51 +01:00
Daira Hopwood
efc223ad1f Improve error reporting for '#' characters in config entries. refs #2128
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-05-05 23:14:48 +01:00
Daira Hopwood
87df9d218d Fix a shallow bug.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-05-05 23:05:06 +01:00
Daira Hopwood
883dd9795b Error if a .furl config entry contains an unescaped '#'. fixes #2128
Author: Andrew Miller <amiller@dappervision.com>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-05-05 22:55:50 +01:00
Daira Hopwood
c85060c436 Revert [603f5eba32] which was applied unintentionally.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-05-05 22:09:33 +01:00
Daira Hopwood
20b26f773b Fix #2048 (test_copy_using_filecap was doing much more work than necessary).
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-05-05 15:29:29 +01:00
Daira Hopwood
a707639380 Fix comments in test_copy_using_filecap to reflect what the tests actually do.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-05-05 15:29:29 +01:00
Daira Hopwood
603f5eba32 Use "long" paths prefixed with \\?\ on Windows. refs #2235
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-05-04 17:05:48 +01:00
Brian Warner
b6c0297dee Include unminified versions of d3+jquery. Addresses #2208.
This should hopefully satisfy the Debian requirement to include original
sources. The old minified files for d3 and jquery were 63k and 91k
respectively, while the new unminified files are 133k and 293k.
2014-04-25 16:16:05 -07:00
Daira Hopwood
4889129f37 Minor comment fix. refs #1847
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-04-21 22:41:23 +01:00
Daira Hopwood
77767e9e12 Remove ugly shadowing of Client.DEFAULT_ENCODING_PARAMETERS. fixes #1847
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-04-21 22:41:23 +01:00
Daira Hopwood
7db853a777 setup.py: include data files in package_data= with paths relative to src/allmydata/web.
Remove packages= entries and unneeded __init__.py files for those subdirectories.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-03-29 00:41:33 +00:00
Daira Hopwood
0ef5939477 Remove 'needs-rebalancing' and add 'count-happiness' to checker reports; repair tests. fixes #1784, #2105
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-03-20 16:13:57 +00:00
Daira Hopwood
6ca5f5fc39 Use bigger random one-time keys in timing_safe_compare. fixes #2165
Follows this advice from Marsh Ray and Solar Designer: https://twitter.com/zooko/status/431105294777597952

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-02-24 20:43:23 +00:00
Daira Hopwood
d5651a0d0e Rename 'constant_time_compare' to 'timing_safe_compare'. refs #2165
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2014-02-24 20:43:23 +00:00
Leif Ryge
db43528430 isolate test_keygen data
This makes test_keygen use its own basedir, to avoid polluting the _trial_temp
directory for later tests.
2014-01-12 21:25:11 +00:00
David
34517f5f68 Right aligning services div 2013-12-26 23:26:56 +01:00
Daira Hopwood
aa29f2655d tahoe debug trial: print a warning message if testing uncommitted code. fixes #1992
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-08-31 18:01:34 +01:00
zooko
e493dcec4a Merge pull request #48 from markberger/740-cli-accept-multiple-aliases
740 cli accept multiple aliases
2013-08-27 08:16:12 -07:00
Mark Berger
71504699a2 Added test_check_with_multiple_aliases in test_cli 2013-07-26 13:01:51 -04:00
Mark Berger
bf235849c9 Allows check and deep-check to take multiple arguments (ticket #740) 2013-07-26 13:01:50 -04:00
Daira Hopwood
7702999107 Fix a pyflakes import warning.
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-07-18 20:54:19 +01:00
Daira Hopwood
2bbfc7927d src/allmydata/uri.py: Remove unused 'human encoding' methods, and associated tests. fixes #1807
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-07-18 20:51:06 +01:00
Daira Hopwood
b088380736 test_iputil.py: fix and improve tests on Windows.
Test all platform variants (Unix, Windows, Cygwin) on each platform.

Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-06-26 16:44:05 +01:00
Daira Hopwood
f97b8e5e1d test_iputil.py: repair a test for cygwin (which is intended to behave differently).
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-06-25 23:32:02 +01:00
Daira Hopwood
08590b1f6a iputil.py: simplify address finding code on cygwin.
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-06-25 19:51:27 +01:00
Daira Hopwood
16b245563d test_iputil.py: use more realistic error for 'command not found' in mock.
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-06-25 19:50:52 +01:00
Daira Hopwood
b31a4f6e87 test_iputil.py: repair a test by mocking 'get_local_ip_for'.
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-06-25 19:50:00 +01:00
Daira Hopwood
a493ee0bb6 iputil.py: add tests for recent changes. refs #1381, #1988, #982, #1064, #1536, #1935, #898, #1707, #1918
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-06-25 19:15:05 +01:00
Daira Hopwood
6104950ed8 iputil.py: fix an error handling bug. refs #1381
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-06-25 19:13:48 +01:00
Daira Hopwood
f77ec470d7 iputil.py: minor cleanup to avoid dropping a Deferred.
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-05-28 19:52:47 +01:00
Daira Hopwood
8e31d66cd0 iputil.py: refactor address-finding code to treat all Unices the same.
refs #1988, #982, #1064, #1536, #1935
fixes #898, #1707, #1918

Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-05-28 19:52:19 +01:00
Daira Hopwood
6a445d73bc iputil.py: retry address queries on EINTR. fixes #1381
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-05-28 19:44:02 +01:00
Daira Hopwood
ec191bfca6 WUI: add time page was rendered to client and introducer welcome pages. closes #1972
Author: Leif Ryge <leif@synthesize.us>
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-05-19 23:27:23 +01:00
Leif Ryge
30924a506c properly describe saving incident reports. closes #1974 2013-05-19 07:31:43 +00:00
Daira Hopwood
705c47f9e9 Improvements to test refs #1742
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-05-15 14:14:12 +01:00
Daira Hopwood
e821c9e23d Add a test for raising NotEnoughSharesError when a Retrieve object is created with an insufficient servermap. refs #1742
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-05-15 04:25:42 +01:00
Daira Hopwood
7956e22d21 Include the number of remaining shares of the right version in NotEnoughSharesError messages.
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-05-14 23:20:47 +01:00
Daira Hopwood
e76281744c mutable/retrieve.py: improve comments. refs #1742
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-05-14 23:20:46 +01:00
Daira Hopwood
cf52c512c5 Raise NotEnoughSharesError if there are initially not enough shares for a mutable retrieve. refs #1742
We also change the order of setting up attributes in Retrieve so that _raise_notenoughshareserror() can be called from _setup_download.

Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-05-14 23:20:46 +01:00
Daira Hopwood
a74b09ec86 mutable/retrieve.py: inline the single-use function _remove_reader.
A simple refactoring. Doesn't even require a new or updated unit test.

Author: Zooko O'Whielacronx <zooko@zooko.com>
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-05-14 23:20:46 +01:00
Daira Hopwood
2fa832b060 Add dummy __init__.py files for directories containing data. fixes #1960
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-05-14 23:07:19 +01:00
Brian Warner
2b6975d3a4 minor changes to hush newer pyflakes
apparently it can now detect aliasing from inside list comprehensions
2013-05-01 19:09:07 -07:00
Daira Hopwood
8a1b2c7aa6 Show git branch in version output. fixes #1953
Also make sure strings in _version.py are correctly escaped, and repair a test.

Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-05-01 22:38:08 +01:00
Daira Hopwood
7bb07fb5e2 Update version requirement for zope.interface.
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-04-25 19:33:55 +01:00
Daira Hopwood
57e9978090 Add "[global-opts]" to help synopsis for tahoe ls. refs #166
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-04-22 16:10:48 +01:00
Daira Hopwood
b06f8cd8d0 Add comments and a caveat in webapi.rst indicating that
the needs-rebalancing field may be computed incorrectly. refs #1115, #1784, #1477

Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-04-18 23:48:45 +01:00
Brian Warner
b989555d96 client.py: create node key even when storage is disabled. Closes #1945.
Thanks to Leif for the catch!
2013-04-18 00:06:55 -07:00
Daira Hopwood
d24f931acc Improve a test for ref #1643, and make sure that unexpected URIs actually raise AssertionError.
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-04-15 19:30:49 +01:00
Brian Warner
f14602cb34 welcome page: display new nodeid (ed25519-based) instead of old tubid
The old tubid is displayed in a tooltip. Also cleaned up the regexps in
the relevant tests.
2013-04-14 15:07:56 -07:00
Brian Warner
e706156323 client.py: remove the old "server.privkey" fallback
For a brief while (in between releases 1.9 and 1.10, specifically from
revision bc21726 on 12-Mar-2012, until bf416af on 10-Jun-2012), the new
introducer code stored its node key in NODEDIR/private/server.privkey .
After that point, it was updated to store this key in
NODEDIR/private/node.privkey instead. Fallback code was added to read
from the old location if present (so that folks using development
versions could keep their node keys after the bf416af change).

This patch removes the fallback code. If you have a node which was run
under a version of Tahoe within this range, you need to manually update
your node by running:

 mv NODEDIR/private/server.privkey NODEDIR/private/node.privkey

and then restart the node. If you accidentally start an older node with
code after this patch, it will create a new key (and other peers will
think a new server has appeared). You can either stick with the new key,
or use the command above to switch back to the old key.

See docs/nodekeys.rst (not yet written) for details about the node key
and how it is used.
2013-04-14 14:03:34 -07:00
Brian Warner
bda0e971f0 client.py: internal renaming, _server_key -> _node_key 2013-04-14 13:22:10 -07:00
Brian Warner
f23ecb4af0 test_sftp.py: minor cosmetic changes 2013-04-14 13:03:55 -07:00
Brian Warner
7edae210c6 CLI: tolerate caps-from-future in unused aliases. Closes #1643. 2013-04-12 20:45:55 +01:00
Brian Warner
74843948d1 test_cli: probably remove the unix-ism that broke tests on windows 2013-04-09 20:09:37 +01:00
Brian Warner
d8c536847b Remove the whitespace reported by find-trailing-spaces. No code changes. 2013-04-09 20:04:12 +01:00
Brian Warner
3ee950f09e CLI: put "[global-opts]" in all command synopses 2013-04-09 19:11:33 +01:00
Brian Warner
51ddab6edb rename VDriveOptions to FilesystemOptions 2013-04-09 19:11:33 +01:00
Brian Warner
5874a7d3a7 bin/tahoe: clean up global-vs-subcommand arguments like --node-directory
The new rules for "bin/tahoe ARG1.. SUBCOMMAND ARG2.." arg:

* --node-directory is only accepted in ARG1, not ARG2
* create-*/start/stop/restart accept --basedir in ARG2, or an explicit
  basedir argument
* only one of --node-directory/--basedir/explicit-basedir is accepted
* --quiet/--version is only accepted in ARG1, not ARG2

Closes #166
2013-04-09 19:11:32 +01:00
Brian Warner
4751a46840 ServerMap.copy(): deepcopy .update_data too. Closes #1785.
This was apparently unused, but good to copy for completeness. Tests
pass with and without the change.
2013-04-09 12:18:19 +01:00
Daira Hopwood
35f37cc5b8 Change web-API to support t=relink instead of t=move (+ docs and tests). fixes #1732
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
2013-04-05 19:38:43 +01:00
David-Sarah Hopwood
68b7f9e979 Correct off-by-one in maximum-immutable-share-size for old servers. fixes #1781
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-23 03:10:50 +00:00
David-Sarah Hopwood
9be1a94043 Censor the introducer and helper furls' swissnums from the web welcome page. refs #1802
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-21 00:25:49 +00:00
Brian Warner
b084396bdd client.py: throw error when reserved_space= is unparseable. Closes #1812.
This should now fail quickly (during "tahoe start"). Previously this
would silently treat an unparseable size as "0", and the only way to
discover that it had had a problem would be to look at the foolscap log,
or examine the storage-service web page for the unexpected "Reserved
Size" number.
2013-03-20 23:24:22 +00:00
Brian Warner
0a89b738bc Make introducer.furl unguessable. Closes #1802.
Previously, Introducers always used a swissnum of "introducer", so
anyone who could learn the (public) tubid of the introducer would be
able to connect to and use it. This changes new Introducers to use the
same randomly-generated swissnum as clients and storage servers do, so
that you absolutely must learn the introducer.furl from someone who
knows it already before you can connect.

This change also moves the location of the file that stores
introducer.furl from BASEDIR/introducer.furl to
BASEDIR/private/introducer.furl, since that's where we keep the private
things. The first time an introducer is started with the new code, it
will move any existing BASEDIR/introducer.furl into the new place.

Note that this will not change the FURL of existing introducers: it will
only affect newly created ones. When you change an introducer's FURL,
you must also update all of the nodes (clients and storage servers)
which connect to it, so upgrading it to an unguessable one isn't
something we should do automatically.
2013-03-20 22:40:33 +00:00
Brian Warner
e981828b25 test_cli.py: fix mutable PUT stderr expectations 2013-03-20 12:27:38 -07:00
David-Sarah Hopwood
656e819560 Improve 'tahoe put --help' to clarify behaviour for mutable files, and
make sure the documented behaviour is tested. fixes #1372

Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-20 01:27:17 +00:00
David-Sarah Hopwood
ef0a6c3015 Avoid double-counting source files in 'tahoe cp --verbose'. fixes #1783
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-20 00:57:50 +00:00
Brian Warner
19b2ef9764 Remove darcs from setup.py, remove darcsver egg. Closes #1908.
Also remove lingering traces of darcs from MANIFEST.in,
.darcs-boringfile, setup.cfg, and unit tests.
2013-03-19 16:07:22 -07:00
David-Sarah Hopwood
1f38c92011 New Welcome page: ensure 'not connected' status for Introducer and Helper is shown via text as well as bullet colour. refs #1713
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-19 05:37:09 +00:00
David-Sarah Hopwood
50c6562901 Improve SFTP error handling and remove use of IFinishableConsumer. fixes #1525
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-19 05:37:02 +00:00
David-Sarah Hopwood
48a2989ee1 sftpd.py: switch from using bare asserts to assertutil.
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-19 02:34:27 +00:00
Brian Warner
3e26c78ee3 introducer.client: use integer seqnums, not time-based. Closes #1767.
This stores the sequence number in BASEDIR/announcement-seqnum, and
increments it each time any service is published (every service
announcement is regenerated with the new sequence number). As everyone
knows, time is an illusion, and occasionally goes backwards, so a
counter is generally safer (and reveals less information about the
node).

Later, we'll improve the introducer client to tolerate rollbacks (where,
perhaps due to a VM being restarted from an earlier checkpoint, the
stored sequence number reverts to an earlier version).
2013-03-18 17:40:56 -07:00
Brian Warner
ff64a0fef5 fileutil.write: accept mode=, and use it in Node.write_config
I want mode="w" (i.e. text, with newline conversion) for code that
writes newline-terminated strings (which should also be human readable)
to files. I like to use things like "cat .tahoe/permutation-seed"
without seeing the seed jammed together with the next command prompt.
2013-03-18 17:34:57 -07:00
David-Sarah Hopwood
75f6c8ca08 test_web.py: relax tests for upload and mkdir forms to tolerate nondeterministic order of attributes.
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-17 18:26:34 +00:00
David-Sarah Hopwood
709be93a29 Redesigned Welcome page using Twitter Bootstrap CSS.
Author: Tony Arcieri <tarcieri>
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-17 16:53:32 +00:00
Brian Warner
427193d855 bump 'mock' dependency to >=0.8.0, to get the .call object
The 0.6.0 version that was previously allowed did not provide .call, so
test_cli.py failed during import.
2013-03-15 21:46:32 -07:00
David-Sarah Hopwood
7008ffa55e Require at least Python 2.6. fixes #1658
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-15 05:13:30 +00:00
David-Sarah Hopwood
52a583ce6d Add test for anti-Ubuntu-crash-reporter exception-catching code. fixes #1746
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-15 03:42:00 +00:00
David-Sarah Hopwood
ea9dfb0de1 tahoe_ls.py: JSON responses don't need quotemarks or quoted newlines.
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-07 16:22:47 +00:00
David-Sarah Hopwood
07c26ff805 Only quote newline characters where necessary. fixes #1484
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-03-07 16:22:47 +00:00
Mike Kazantsev
0f499873b0 test_web.py: fix test_GET_DIRECTORY_html_filenode_encoding for Twisted==12.3.0. fixes #1922
twisted.web.html.escape was used to produce html-encoded string (to then look
it up in "value" attribute), but behavior of that function has changed between
Twisted 12.2.0 (simple custom implementation) and 12.3.0 (imported from stdlib
cgi module).
2013-02-27 23:21:38 +06:00
David-Sarah Hopwood
cdf1752a5d Add comment explaining fix to #1679. refs #1679
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-02-08 19:27:57 +00:00
Zooko O'Whielacronx
45c64edc76 do not cache and re-use imm filenodes in nodemaker
fixes #1679
2013-02-07 16:35:43 +00:00
Zooko O'Whielacronx
8df3a07625 unit test for #1679 2013-02-07 16:35:23 +00:00
David-Sarah Hopwood
a9272522d5 tahoe_check.py: tolerate missing fields in check results for LIT files/dirs. fixes #1758
Also test this case and improve some existing tests of 'tahoe check'.

Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2013-01-03 22:16:20 +00:00
David-Sarah Hopwood
456955e4f0 Make WUI headings and titles more consistent and accurate:
'Recent and Active Operations' and 'Operational Statistics'. fixes #1457

Signed-off-by: David-Sarah Hopwood <davidsarah@jacaranda.org>
2012-12-29 23:54:54 +00:00
David-Sarah Hopwood
062ae99372 test_web.py: minor cleanup to test_helper_status.
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2012-12-29 23:44:11 +00:00
David-Sarah Hopwood
a5895b9d59 If a helper is not configured, make the banner on the welcome page say that, and have a white background.
fixes #1735

Author: kick
Signed-off-by: David-Sarah Hopwood <davidsarah@jacaranda.org>
2012-12-29 04:17:00 +00:00
David-Sarah Hopwood
3888915996 Make abbreviate_space able to output in exabytes. refs #1812
Signed-off-by: David-Sarah Hopwood <davidsarah@mint>
2012-12-27 20:08:27 +00:00
David-Sarah Hopwood
6d2ca45c4a Allow T (terabytes), P (petabytes), and E (exabytes), case-insensitive, in parse_abbreviated_size.
This also simplifies how case-insensitivity is handled, and fixes a corner case
where the wrong exception was raised when the size ends in "BB".
fixes #1812

Signed-off-by: David-Sarah Hopwood <davidsarah@mint>
2012-12-27 20:08:00 +00:00
David-Sarah Hopwood
5c4ca677e1 Make the system test nodes have non-ASCII nicknames.
This ensures that non-ASCII nicknames are exercised with the real server code.
refs #1298

Signed-off-by: David-Sarah Hopwood <davidsarah@mint>
2012-12-27 19:00:22 +00:00
David-Sarah Hopwood
0d4a826f0e Allow welcome and storage status pages to display a non-ASCII node nickname. fixes #1298
Signed-off-by: David-Sarah Hopwood <davidsarah@jacaranda.org>
2012-12-27 05:08:53 +00:00
David-Sarah Hopwood
4563ba456b Remove ResponseCache in favor of MDMFSlotReadProxy's cache. closes #1240.
This contains several merged patches. Individual messages follow, latest first:

* Fix a warning from check-miscaptures.
* In retrieve.py, explicitly test whether a key is in self.servermap.proxies
  rather than catching KeyError.
* Added a new comment to the MDMF version of the test I removed, explaining
  the removal of the SDMF version.
* Removed test_corrupt_all_block_hash_tree_late, since the entire block_hash_tree
  is cached in the servermap for an SDMF file.
* Fixed several tests that require files larger than the servermap cache.
* Remove unused test_response_cache_memory_leak().
* Exercise the cache.
* Test infrastructure for counting cache misses on MDMF files.
* Removed the ResponseCache. Instead, the MDMFSlotReadProxy initialized
  by ServerMap is kept around so Retrieve can access it. The ReadProxy
  has a cache of the first 1000 bytes initially read from each share by
  the ServerMap. We're able to satisfy a number of requests out of this
  cache, so roundtrips are reduced from 84 to 60 in test_deepcheck_mdmf.
  There is still some mystery about under what conditions the cache has
  fewer than 1000 bytes. Also this breaks some existing unit tests that
  depend on the inner behavior of ResponseCache.
* The servermap.proxies (a cache of SlotReadProxies) is now keyed
  by (verinfo,serverid,shnum) rather than just (serverid,shnum)
* Minor cosmetic changes
* Added a test failure if the number of cache misses is too high.

Author: Andrew Miller <amiller@dappervision.com>
Signed-off-by: David-Sarah Hopwood <davidsarah@jacaranda.org>
2012-12-27 00:00:17 +00:00
David-Sarah Hopwood
884685278b test/common_util.py: fix a bug in NonASCIIPathMixin that would cause spurious log entries on Windows.
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2012-12-02 01:54:47 +00:00
Zooko O'Whielacronx
73d5a059bd tests: add more diagnostics when code-under-test fails
This prints out which things are different when two sets are expected to be the
same. This was useful to me when debugging the code under test. Hm, this
pattern might be more generally useful...
2012-11-29 14:11:47 -07:00
Zooko O'Whielacronx
abcde9645c remove unnecessary request from upload-helper
The unnecessary request was from the upload helper to the sender, and it was
there in order to trigger the sender to deliver cleartext hashes. But we've
long since removed cleartext hashes.

Unit tests pass both before and after this change, and code-coverage shows that
the block I changed is exercised in unit tests.
2012-11-29 13:44:32 -07:00
David-Sarah Hopwood
e097cf96b2 web/unlinked.py: don't use % operator to expand %(uri)s. fixes #1860.
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2012-11-15 04:16:19 +00:00
David-Sarah Hopwood
1ffed22651 CLI: fix synopsis for 'tahoe ls'. fixes #1839
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2012-11-01 23:40:06 +00:00
David-Sarah Hopwood
edc1f5f67f Makefile: add 'make tmpfstest', which uses a tmpfs for _trial_temp.
This probably only works on Linux. It uses sudo to mount and unmount the tmpfs,
which may prompt for a password. refs #20

Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2012-10-25 02:16:21 +01:00
David-Sarah Hopwood
b3bf20748f test_runner: we no longer need to skip tests on Twisted < 9.0.
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2012-10-25 01:17:12 +01:00
David-Sarah Hopwood
1df7f114b7 src/allmydata/web/directory.py: fix HTML double-encoding issue for filenames.
Nevow automatically HTML-escapes strings passed in stan without a raw marker.
Written by MK_FG. fixes #1143

Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
2012-10-25 01:01:25 +01:00
frederik b
595d611c9b fixed wrong index in tahoe cp --verbose, as explained in #1805
this bug shows wrong counters for copied files in verbose mode
2012-09-29 21:32:51 -07:00
david-sarah
36c176224d src/allmydata/__init__.py: ensure that if a dependency cannot be imported, we will report that rather than reporting a confusing message about the version and location being None. fixes #1804 2012-09-14 02:14:48 +00:00
Brian Warner
15c95c2e12 Apply David-Sarah's recommended changes. Closes #974 2012-09-04 15:45:38 -07:00
Andrew Miller
4f19f2b4b4 When the CLI cannot connect to the gateway, it prints an error message rather than raising a python exception. Includes a unit test
Signed-off-by: Andrew Miller <amiller@dappervision.com>
2012-09-04 14:48:50 -07:00
david-sarah
ca620a6ce1 Cosmetic changes to match cloud backend branch. 2012-07-24 03:40:49 +00:00
david-sarah
5105448421 interfaces.py: corrections to take into account that lease cancel secrets are no longer honoured. 2012-07-24 03:40:06 +00:00
david-sarah
e8240b0923 interfaces.py: corrections to interfaces to make more of them checkable. 2012-07-24 03:39:24 +00:00
david-sarah
5c92c71fd5 interfaces.py: which -> that. 2012-07-24 03:37:07 +00:00
david-sarah
12e30c6e92 Default arguments in interface declarations should only be used to specify a default, not to specify the type, in order to be checkable. 2012-07-24 03:34:46 +00:00
david-sarah
dcfb27f9bf Remove spurious 'self' arguments that should not be included in interface declarations. 2012-07-24 03:32:56 +00:00
david-sarah
fd09b84bb6 interfaces.py: whitespace 2012-07-24 03:29:14 +00:00
david-sarah
702fe87b7d Slightly improve the error message when a stats.pickle file cannot be read. 2012-07-03 14:45:22 +00:00
david-sarah
3cb99364e6 Failing to load a crawler state pickle uses default values, but the exception clause to detect this failure is too narrow; it can also fail with EOFError or KeyError for example. 2012-07-02 18:18:47 +00:00
david-sarah
d278b1220f If a stats.pickle file cannot be read, print a better error message. 2012-07-02 18:15:55 +00:00
david-sarah
37ee8f79d5 src/allmydata/__init__.py: head off a possible warning on platforms where twisted-conch is a separate package. 2011-08-08 18:20:13 +00:00
Brian Warner
2ed6b67644 'tahoe --version': remove inconsistent trailing comma, easier to parse 2012-06-26 09:18:45 -07:00
Brian Warner
69bd49fc57 _auto_deps: bump foolscap to >=0.6.3 to tolerate twisted-12.0.0
The current Twisted release is 12.1.0, which (like 12.0.0 before it)
isn't compatible with foolscap-0.6.2 and earlier. We previously required
foolscap>=0.6.1, since that's all we actually need from foolscap itself.
_auto_deps specifies twisted>=11.0.0, so any system that can't meet that
will install the current Twisted (12.1.0), which will give them
something incompatible with foolscap-0.6.1 and 0.6.2 .

If we're limited to setuptools's declarative constraint language (and
can't have a function which evaluates the available dependency versions
and gives recommendations on which to change), then the only safe
approach is to make sure that any acceptable Foolscap version will be
compatible with all acceptable Twisted versions. So, bump the foolscap
dependency to >=0.6.3, which covers all currently-known
incompatibilities.
2012-06-24 12:10:24 -07:00
david-sarah
33e2d2962e Change the maximum mutable share size to 69105 TB, and add a maximum-mutable-share-size field to the version announcement. Includes a test. refs #1778 2012-06-22 15:43:54 +00:00
david-sarah
26dad5044b _auto_deps.py: bump the Twisted dependency to >= 11.0.0 to avoid Twisted bugs #411 (Deferred recursion limit) and #4395 (SSH server rekeying). refs #1297 fixes #1771 2012-06-17 00:21:25 +00:00
david-sarah
8c6c410b87 mutable: fix shape of 'verinfo' tuple returned from MDMFSlotWriteProxy.get_verinfo(). fixes #1669 2012-06-21 20:52:21 +00:00
david-sarah
adca74d9f8 Tests for ref #1669. Also refactor the existing tests to reduce duplicated code and to fix a cut-and-paste error that caused one case (successful SDMF repair) to go untested. 2012-06-21 20:46:27 +00:00
david-sarah
196bd583b6 Add assertions to make sure that set_default_encoding_parameters is always called, rather than using hardcoded 3/7/10 defaults. Also update affected tests. Note that this by itself cannot fix the bug mentioned in ticket:1212#comment:41, but it might make it easier to reproduce. refs #1212 2012-06-19 02:05:04 +00:00
david-sarah
323774698e Make the intent of the loop over servers in test_system.Connections.test_rref clearer, and able to be the same in 1.9.2 and trunk. Remove the now-unused node_key_s attribute of Client. refs #1636 2012-06-16 18:18:44 +00:00
david-sarah
635e87bd7b Fix a bug in mutable publish that could cause an IndexError when a writer is removed in Publish._connection_problem. This version uses DictOfSets as suggested by warner. fixes #1749 2012-06-15 03:44:37 +00:00
david-sarah
3ab0f33413 Skip allmydata.test.test_system.Connections.test_rref unless we have foolscap >= 0.6.4, because of http://foolscap.lothar.com/trac/ticket/196 . refs #1636 2012-06-15 23:20:28 +00:00
david-sarah
1b07d30761 After a server disconnects, make the IServer retain the dead RemoteReference, and continue to return it to anyone who calls get_rref(). This removes the need for callers to guard against receiving a None (as long as the server was connected at least once, which is always the case for servers returned by get_servers_for_psi(), which is how all upload/download code gets servers). Includes test. fixes #1636 2012-06-15 01:48:55 +00:00
david-sarah
2c4ea1df5f Since DeprecationWarning about twisted.internet.interfaces.IFinishableConsumer is suppressed globally, it doesn't need to be suppressed during import. refs #1295 2012-06-14 21:33:15 +00:00
david-sarah
854afc095f Suppress DeprecationWarning about twisted.internet.interfaces.IFinishableConsumer. This also unifies the handling of DeprecationWarnings that need to be suppressed globally. refs #1295 2012-06-14 21:23:08 +00:00
Brian Warner
b2dcbbb62d test/common.py: fix race condition waiting for the helper connection
The wait_for_connections() method, which is used at the start of
test_system to make sure that all the clients are connected to all the
servers, did not also wait for clients to be connected to their Helpers.
Every once in a while, the helper connection would take a bit longer,
and then
test_system.SystemTest.test_filesystem._test_web._got_welcome_helper
would fail, because we'd check for a helper connection before it was
ready.

The fix is to modify wait_for_connections's polling predicate to look
for helper connections (if configured) as well as the regular
introducer- and server- connections.

Tested by temporarily adding a large (30s) delay to the connectTo() call
in Uploader.startService, simulating a long helper
connection-establishment delay. This makes the test fail consistently.
Then I fixed wait_for_connections(), and the test passed (slowly). Then
I removed the delay.

Closes #1467
2012-06-14 12:18:35 -07:00
david-sarah
daa24bce8b Clarify documentation of RIStorageServer.slot_testv_and_readv_and_writev. fixes #1744 2012-06-13 16:51:35 +00:00
Brian Warner
ef2db56104 introweb: the Subscribed Clients list shows tubids, not serverids
Improve the column headers to make it clear that this list shows Tub
IDs. (we can't show pubkey-based serverids because clients don't give
those to us: only servers provide pubkeys). This should be the only
place in the whole webapi that shows TubIDs for modern (V2-introducer)
nodes.
2012-06-12 14:37:27 -07:00
Brian Warner
c073565ecc Display serverids consistently as 8-char pubkey, or 6-char tubid.
This makes it easy to distinguish between old V1-Introducer
nodes (identified by their Foolscap TubID) and new V2 nodes (identified
by their ed25519 pubkey).

This fixes a few places where we used to display a tubid even if we had
a pubkey, making it hard to visually correlate servers in two different
displays. It also cleans up the way we pass serverids to the JS-based
download timeline.

The "introweb" subscribed-clients list still shows tubids.
2012-06-12 14:30:34 -07:00
Brian Warner
51a5aaa639 test_system.py: wait for the Helper connection properly before uploading 2012-06-11 23:19:30 -07:00
Brian Warner
5e432b12a1 test_system.py: clean up control flow, reduce use of stall()
The _upload_resumable() test interrupts a Helper upload partway
through (by shutting down the Helper), then restarts the Helper and
resumes the upload. The control flow is kind of tricky: to do anything
"partway through" requires adding a hook to the Uploadable. The previous
flow depended upon a (fragile) call to self.stall(), which waits a fixed
number of seconds.

This removes one of those stall() calls (the remainder is in
test/common.py and I'll try removing it in a subsequent revision). It
also removes some now-redundant wait_for_connections() calls, since
bounce_client() doesn't fire its Deferred until the client has finished
coming back up (and uses wait_for_connections() internally to do so).
2012-06-11 18:22:35 -07:00
Brian Warner
82519ef93f test_system.py: fix minor typo 2012-06-11 18:16:36 -07:00
Brian Warner
a809e4caba offloaded.py: don't drop the Deferred
There was one corner case (where the client disconnects at just the
wrong time) that could have dropped a Deferred, leading to an Unhandled
Error. Clean up the control flow to avoid this case.
2012-06-11 18:16:02 -07:00
Brian Warner
e1093cbb33 introducer: add sequence-numbers to announcements, ignore replays
This will support revocation of Accounting recommendation records,
assuming the gossip-based broadcast channel isn't easily jammed.
2012-06-10 19:10:22 -07:00
Brian Warner
bf416af49e client.py: rename "server key" to "node key", use old name if present
This prepares for invitation-based reciprocal-permission Accounting. In
the scheme I'm developing, nodes publish "I accept shares from Y"
messages, which are assembled into a graph, and server will accept
shares from any client node reachable in this graph. For this to work,
the serverX->clientY edge must be connectable to the serverY->clientZ
edge, which means "clientY" and "serverY" must be connected. If clientY
and serverY are two distinct keys, they must be cross-signed. Life is
easier if there's just one key "Y", rather than distinct client- and
server- keys. Calling this one key "server.privkey" would be confusing.
"node.privkey" and "node.pubkey" makes more sense.

One-server-per-node is a pretty easy restriction. Originally I was
thinking that the client.key should be provided in each webapi call,
just like a filecap is, making a single node useable by multiple users
(Accounting principals), and not providing any ambient storage
authority. But I've been unable to think of a comfortable WUI for
that (at least without requiring javascript), nor a friendly way to
transfer account authority (e.g. writecaps that include storage
authority). So I'm more willing to have one-client-per-node these days.

(and note that this rename doesn't seriously preclude
many-clients-per-node or zero-clients-per-node anyways, it just makes
one-client-per-node less awkward)
2012-06-10 18:14:55 -07:00
Brian Warner
26d3869076 node.py: add get_private_config()
Also add tests for this and the pre-existing private-config methods.
2012-06-10 17:46:38 -07:00