Commit Graph

3541 Commits

Author SHA1 Message Date
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
Brian Warner
518e4cec98 Fix text in Publish Status results. Closes #1762. 2012-06-08 15:21:46 -07:00
Brian Warner
188c7fecf5 CheckResults corrupt/incompatible shares now return IServers
DeepResultsBase also has a get_corrupt_shares(), and it is populated
from CheckResults.get_corrupt_shares(). It has been updated too, along
with get_remaining_corrupt_shares().

Remove temporary get_new_corrupt_shares() and
get_new_incompatible_shares().
2012-06-02 11:39:12 -07:00
Brian Warner
da9ac55294 CheckResults.get_servers_responding() now returns IServers
Remove temporary get_new_servers_responding().
2012-06-02 11:39:12 -07:00
Brian Warner
957a5315aa CheckResults.get_sharemap() now returns IServers
Remove temporary get_new_sharemap().
2012-06-02 11:39:11 -07:00
Brian Warner
76fca000df CheckResults: pass IServer to corrupt/incompatible share locators
Getters still return serverid. Adds temporary get_new_corrupt_shares()
and get_new_incompatible_shares().
2012-06-02 11:39:11 -07:00
Brian Warner
dd8178ee6d CheckResults: pass IServer to servers_responding=, getter returns serverid
Add temporary get_new_servers_responding().
2012-06-02 11:39:11 -07:00
Brian Warner
a4c95609c7 CheckResults: pass IServer to sharemap=, but get_sharemap() returns serverids
This changes all code which feeds CheckResults(sharemap=) to provide
IServer instances, but CheckResults converts these to old-style
serverids during output, so downstream code doesn't have to change yet.

It adds a temporary get_new_sharemap(), which *does* return IServer
instances, so the immutable repairer can build new CheckResults from an
old one. This will go away when get_sharemap() is updated to return
IServer (and downstream code is updated too).
2012-06-02 11:39:11 -07:00
Brian Warner
c03b6aff97 CheckResults: internal cleanup
replace the one-big-dictionary with normal private attributes
2012-06-02 11:39:11 -07:00
Brian Warner
437de4340b CheckResults: privatize remaining attributes 2012-06-02 11:39:10 -07:00
Brian Warner
0fcc054a61 CheckResults: use fat init, add type-checking assertions
Added assertions for sharemap, servermap, servers_responding,
list_corrupt_shares, and list_incompatible_shares.
2012-06-02 11:39:10 -07:00
Brian Warner
fba26d7bae mutable/checker: refactor to make CheckResults easier to change 2012-06-02 11:39:10 -07:00
Brian Warner
8daacbcf69 CheckResults: replace get_data() with as_dict(), use getters in web status 2012-06-02 11:39:10 -07:00
Brian Warner
4867dca3f0 use the new CheckResult getters almost everywhere
The remaining get_data() calls are either in
web.check_results.json_check_results(), or functioning as repr()s in
various unit test failure cases.
2012-06-02 11:39:10 -07:00
Brian Warner
1883d393c6 CheckResults: replace get_data() with a bunch of individual getters 2012-06-02 11:39:10 -07:00
Brian Warner
ccfcd4de37 change CheckResults to use a fat set_data()
i.e. change set_data() to accept lots of parameters, instead of taking
a single dictionary with lots of keys. Also Convert all CheckResults
creators to use it.
2012-06-02 11:39:10 -07:00
Brian Warner
d446897282 CheckResults: simplify self._data 2012-06-02 11:39:09 -07:00
Brian Warner
e313cf6406 CheckResults: start hiding .data, first step to clean it up
The goal is to make CheckResults more strongly typed, and remove the
ambiguous ".data" field in favor of a bunch of specific counters and
sharelists, so I can changes .sharemap and .servermap to use IServer
instances instead of string serverids. By cleaning this up first, I hope
to get that task done with less debugging.
2012-06-02 11:39:09 -07:00
Brian Warner
17c5384f79 immutable.CiphertextFileNode.check_and_repair: simplify for refactoring
There were too many nested functions here, making some upcoming changes
too difficult, so let's refactor it first.
2012-06-02 11:39:09 -07:00
david-sarah
2ee1bc7148 Catch exceptions from CLI in order to prevent the Ubuntu crash monolog from triggering. refs #1746 2012-05-20 15:35:29 +00:00
Brian Warner
3ba77925d9 node.py: stop stripping whitespace in write_private_config()
It's nice to add newlines to the saved file, so 'cat' is easy to use. We
still strip on the input side, in get_or_create_private_config().
2012-05-30 00:17:55 -07:00
Brian Warner
bfee999e20 test_web.py: fix memory leak when run with --until-failure
The Fake*Node classes in test/common.py were accumulating share data in
a class-level dictionary, which persisted from one test run to the next.
As a result, running test_web.py over and over (with trial's
--until-failure feature) made this dictionary grow without bound,
eventually running out of memory.

This fix moves that dictionary into the FakeClient built fresh for each
test, so it doesn't build up. It does the same thing for "file_types",
which was much smaller but still lived at the class level.

Closes #1729
2012-05-22 15:39:49 -07:00
Brian Warner
bcdfb5802e test/check_memory.py: oops, fix one last ur.uri -> ur.get_uri() 2012-05-22 08:50:36 -07:00
Brian Warner
3a1c02cfdf change UploadResults to return IServers, update users to match
This finally changes all callers of get_servermap()/get_sharemap() to
accept IServers, and changes UploadResults to provide them.
2012-05-21 21:18:37 -07:00
Brian Warner
843739486a UploadResults: store IServers internally, but still return serverids
This stores IDisplayableServer-providing instances (StubServers or
NativeStorageServers) in the .servermap and .sharemap dictionaries. But
get_servermap()/get_sharemap() still return data structures with
serverids, not IServers, by translating their data on the way out. This
lets us put off changing the callers for a little bit longer.
2012-05-21 21:18:25 -07:00
Brian Warner
97a1eb6ebf split IDisplayableServer from IServer, add sb.get_stub_server()
IDisplayableServer includes just enough functionality to call
.get_name() and friends, which is all that the UploadResults really
need. IServer is a superset that includes actual share-manipulation
methods. StubServer instances provide only IDisplayableServer, while
actual NativeStorageServer instances provide the full IServer interface.

When the Helper sends a serverid (so we know what to call the server but
nothing else about it, and have no corresponding NativeStorageServer
object to reference), but we want to store an IDisplayableServer in the
UploadResults, we create a synthetic StubServer "server" and store that
instead.
2012-05-21 21:17:27 -07:00
Brian Warner
3d771132a8 switch UploadResults to use get_uri(), hide internal ._uri
Complete the getter-based transformation, by hiding ".uri" and updating
callers to use get_uri(). Also don't set a dummy self._uri, leave it
undefined until someone calls set_uri().
2012-05-21 21:14:44 -07:00
Brian Warner
29b11531b5 switch UploadResults to use getters, hide internal data, for all but .uri
This hides attributes with e.g. _sharemap, and creates getters like
get_sharemap() to access them, for every field except .uri . This will
make it easier to modify the internal representation of .sharemap
without requiring callers to adjust quite yet.

".uri" has so many users that it seemed better to update it in a
subsequent patch.
2012-05-21 21:14:28 -07:00
Brian Warner
08f5bc8e2f convert UploadResults to a fat init
Populate most of UploadResults (except .uri, which is learned later when
using a Helper) in the constructor, instead of allowing creators to
write to attributes later. This will help isolate the fields that we
want to change to use IServers.
2012-05-21 21:14:14 -07:00
Brian Warner
b71234c538 add HelperUploadResults
This splits the pb.Copyable on-wire object (HelperUploadResults) out
from the local results object (UploadResults). To maintain compatibility
with older Helpers, we have to leave pb.Copyable classes alone and
unmodified, but we want to change UploadResults to use IServers instead
of serverids. So by using a different class on the wire, and translating
to/from it on either end, we can accomplish both.
2012-05-21 21:14:00 -07:00
Brian Warner
b3af012b13 Uploader cleanup: create results at end, not beginning
This will make it easier to populate the UploadResults during __init__,
instead of doing it one-field-at-a-time later.
2012-05-21 21:13:47 -07:00
Brian Warner
0df833eac9 clean up Helper to make later changes easier
Fix up control flow inside the Helper, to make it more friendly for
later refactoring.
2012-05-21 21:13:32 -07:00
Brian Warner
e60982c851 helper: remove timings["existence_check"], aka "Already-In-Grid Check"
This measured how long the Helper took to do a filecheck before asking
for ciphertext. The "Contacting Helper" report includes both
existence_check and the client-helper RTT.

For non-overlapping uploads, it was being returned correctly. But when
multiple upload requests overlapped, and the file was not already in the
grid, the filecheck would only run once, and its existence_check time
would be reported for all uploaders (even if they didn't have to wait
for that time). Cleaning that up proved too difficult: the only correct
place to report this time is from the initial remote_upload_chk() call,
but the return value of that is too constrained to accomodate it in the
needs-upload case.

So I'm removing it altogether. Eventually I plan to add a proper
events/times field and record more data, including this check, in a form
that can be drawn on a nice zoomable timeline view.

Old clients talking to a new Helper (which doesn't supply the value)
will tolerate the loss (they'll just display an empty field on the web
view).
2012-05-21 21:13:11 -07:00
Brian Warner
393c0729de test_checker: minor improvement in fake-server setup
This prepares for testing the differences between tubid and pubkey-based
name/longname.
2012-05-21 19:49:36 -07:00
david-sarah
4ddcde3094 Since we now require Python 2.5, we can use os.SEEK_END. 2012-05-16 21:39:48 +00:00
david-sarah
a1a1b5bf8a Simplifications resulting from requiring Python 2.5 and therefore being able to use sqlite3 from the standard library. This also drops sqlite3 from the set of versions and paths we report. 2012-05-16 02:47:25 +00:00
david-sarah
0fc196ea5f Require Python 2.5. 2012-05-16 02:41:49 +00:00
Brian Warner
cc366903ce dictutil.DictOfSets: remove .union() method, it was misleading
Unlike set.union(), which returns a new set, DictOfSets.union() modified
the DictOfSets in-place. The name collision bit me when I changed some
code from using DictOfSets to a normal set, and expected that
set.union() would modify the set in-place. Since there was only one user
of DictOfSets.union, I figured it was safer to just get rid of it.
2012-05-16 16:55:09 -07:00
Brian Warner
9acf5beebd immutable repairer: populate servers-responding properly
If a server did not respond to the pre-repair filecheck, but did respond
to the repair, that server was not correctly added to the
RepairResults.data["servers-responding"] list. (This resulted from a
buggy usage of DictOfSets.union() in filenode.py).

In addition, servers to which filecheck queries were sent, but did not
respond, were incorrectly added to the servers-responding list
anyawys. (This resulted from code in the checker.py not paying attention
to the 'responded' flag).

The first bug was neatly masked by the second: it's pretty rare to have
a server suddenly start responding in the one-second window between a
filecheck and a subsequent repair, and if the server was around for the
filecheck, you'd never notice the problem. I only spotted the smelly
code while I was changing it for IServer cleanup purposes.

I added coverage to test_repairer.py for this. Trying to get that test
to fail before fixing the first bug is what led me to discover the
second bug. I also had to update test_corrupt_file_verno, since it was
incorrectly asserting that 10 servers responded, when in fact one of
them throws an error (but the second bug was causing it to be reported
anyways).
2012-05-16 16:55:09 -07:00
david-sarah
3738c3e2d1 fileutil.py: use try/finally to close file in write_atomically. 2012-05-16 23:08:39 +00:00
Brian Warner
c4d7b7b109 write node.url and portnum files atomically, to fix race in test_runner
Previously, test_runner sometimes fails because the _node_has_started()
poller fires after the portnum file has been opened, but before it has
actually been filled, allowing the test process to observe an empty file,
which flunks the test.

This adds a new fileutil.write_atomically() function (using the usual
write-to-.tmp-then-rename approach), and uses it for both node.url and
client.port . These files are written a bit before the node is really up and
running, but they're late enough for test_runner's purposes, which is to know
when it's safe to read client.port and use 'tahoe restart' (and therefore
SIGINT) to restart the node.

The current node/client code doesn't offer any better "are you really done
with startup" indicator.. the ideal approach would be to either watch the
logfile, or connect to its flogport, but both are a hassle. Changing the node
to write out a new "all done" file would be intrusive for regular
operations.
2012-05-14 15:03:14 -07:00
david-sarah
bf7e351464 Improve a comment in __init__.py. 2012-05-14 16:34:31 +00:00
david-sarah
4b80299fdd Suppress the PowmInsecureWarning from PyCrypto. refs #1586 2012-05-14 03:23:52 +00:00
Brian Warner
fcc7e64759 Doc updates and cosmetic fixes for #1115 patch.
Removes the caveat from webapi.txt about count-good-share-hosts being wrong.

This series should close #1115.
2012-05-13 01:15:50 -07:00
Andrew Miller
04eb6086ad Fixed an error in previous commit where an empty servermap would throw an exception in 'count-good-share-hosts'. Augmented unit test.
Signed-off-by: Andrew Miller <amiller@dappervision.com>
2012-05-13 00:59:30 -07:00
Andrew Miller
4b7f34d179 Added tests for count-good-share-hosts under check and repair conditions. Patched the incorrect computation in immutable/filenode.py
Signed-off-by: Andrew Miller <amiller@dappervision.com>

Fixed missing import statements

Signed-off-by: Andrew Miller <amiller@dappervision.com>
2012-05-13 00:59:30 -07:00
Brian Warner
8f630a76fe test_web: fix use of headers= that's been wrong for a while 2012-05-13 00:45:12 -07:00
Brian Warner
5d404db898 webapi: don't allow ETags in t=info or t=rename-form, both are variable
t=info contains randomly-generated ophandles, and t=rename-form contains the
name of the child being renamed, so neither is eligible for a
short-circuiting ETag. Enhanced test_web to exercise this. Had to improve
FakeCHKFileNode slightly to let it participate. Refs #443.
2012-05-13 00:45:11 -07:00
Brian Warner
d437a9b33e test_web: improve ETag tests, add If-None-Match test 2012-05-13 00:45:11 -07:00
Andrew Miller
16eddc35e8 Added unit tests covering #466:comment-15. Refactored the 'etag' behavior for immutable files to respond to all GET '?t=' flags, not just t=None
Signed-off-by: Andrew Miller <amiller@dappervision.com>
2012-05-13 00:45:11 -07:00
Jeremy Fitzhardinge
4f1bc1b387 Short circuit GET on ETags match
When client does a conditional GET/HEAD with If-none-match:, if the condition
fails (ie, the client's ETag matches the file's) then we can short-circuit
the whole process and immediately return an empty body.
2012-05-13 00:45:11 -07:00
Jeremy Fitzhardinge
518ef25bdb Add ETags for immutable directories
Like immutable files, the ETag is based on the storage index. However, since
a directory is a special interpretation of a file, it is distinguished from
the file by prepending "DIR:" onto the start of the ETag, and adding
-representation on the end (where -representation is the ?t= argument, json,
info, etc).

It also checks the return of setETag and avoids generating a representation
if the client already has it.
2012-05-13 00:45:11 -07:00
david-sarah
379901bf8f Add 'tahoe debug flogtool' command, test for --help, and docs. This version gets the help synopses more correct, and changes the doc to say that this command is added in 1.10.0 rather than 1.9.2. fixes #1693 2012-03-31 22:41:22 +00:00
Brian Warner
eb2a4ef246 webapi: remove undocumented t=mkdir-p operation
Closes #380
2012-05-12 19:19:43 -07:00
Brian Warner
8417579147 webui: merge 'move' form with 'rename' form 2012-05-09 14:21:37 -07:00
Brian Warner
81c30b1cd1 test_web: improve shouldFail2() error reporting 2012-05-09 14:18:37 -07:00
Brian Warner
a92385b54b webapi 'move'-button cleanups
test_web.py: use shouldFail2(), safer than old shouldFail()
directory.py: forbid slashes in from_name=, return BAD_REQUEST instead of
              GONE when trying to move into a non-directory
2012-05-09 14:18:27 -07:00
Marcus Wanner
e89bce21a5 Add unit test for moving a directory
My gut tells me this case sould be tested. The rename suite tests it, so
move's will too.
2012-05-09 13:07:14 -07:00
Marcus Wanner
e58a01270b Change the arbitrary URI support from implied to explicit
The move webapi function now takes a target_type argument which lets it
know whether the target is a subdirectory name or URI. This is an
improvement over the old system in which the move handler tried to guess
whether the target was a name or a URI. Also fixed a little docs
copypaste problem and tweaked some line wrapping.
2012-05-09 13:07:14 -07:00
Marcus Wanner
b29d0920d3 Adding 'move' button to web UI, closes #1579
This adds "move file" capability to the web UI's directory display. The
support and test framework is heavily based on the similar "rename file"
feature. Unit tests and documentation are included. Multiple in-progress
versions of this patch may be found in ticket 1579. This version
includes arbitrary URI target support and is compatible with the change
from tahoe_css to tahoe.css.
2012-05-09 13:07:13 -07:00
david-sarah
a555336910 Make sure that foolscap.logging.log.setLogDir is called with a str (not unicode) path, v2. Includes test. fixes #1725 2012-04-29 02:28:44 +00:00
Brian Warner
842a3a132b introweb announcements: show serverid, not tubid
'serverid' is the pubkey (for V2 clients), falling back to the tubid (for V1
clients). This also required cleaning up the way the index is created for the
old V1 introducer.
2012-04-24 01:37:28 -04:00
Brian Warner
84c9f3bfb4 Fix introweb display for mixed V1/V2 clients. Closes #1721.
This significantly cleans up the IntroducerServer web-status renderers.
Instead of poking around in the introducer's internals, now the web-status
renderers get clean AnnouncementDescriptor and SubscriberDescriptor
objects. They are still somewhat foolscap-centric, but will provide a clean
abstraction boundary for future improvements.

The specific #1721 bug was that old (V1) subscribers were handled by
wrapping their RemoteReference in a special WrapV1SubscriberInV2Interface
object, but the web-status display was trying to peek inside the object to
learn what host+port it was associated with, and the wrapper did not proxy
those extra attributes.

A test was added to test_introducer to make sure the introweb page renders
properly and at least contains the nicknames of both the V1 and V2 clients.
2012-04-23 18:30:53 -04:00
david-sarah
9d87f8ddd5 Change capitalization of WUI and introducer welcome page headings; add test for introducer welcome page. Also fix a typo in a CSS class name. fixes #1708 2012-04-05 23:57:23 +00:00
Brian Warner
4e93f77289 test/common.py: remove ununsed 'is_bad' mechanism
This was a premature feature addition to the mock filenode, and gets in the
way of the IServer refactoring I'm trying to do. Best to remove it now and
re-introduce it in a better form later when it's actually needed.
2012-04-04 12:11:03 -07:00
Brian Warner
4b8876c5da checker.py: minor simplifications 2012-04-04 12:05:31 -07:00
Brian Warner
55973e61e5 make IServer instances retain identity in copy() and deepcopy() 2012-04-04 11:14:09 -07:00
Brian Warner
b38cfd0235 move IServer from storage_client.py to interfaces.py 2012-04-04 11:13:59 -07:00
Brian Warner
bf390cca4b Rename web CheckResults to -Renderer, to avoid confusion. Closes #1705.
This avoids the name collision between the actual results
objects (defined in allmydata.check_results) and the code that renders
these objects into HTML (defined in allmydata.web.check_results). Only
the web-side objects were renamed.
2012-04-02 20:04:51 -07:00
Brian Warner
470acbf1e1 servermap.py: oops, fix _done() condition, good catch by davidsarah 2012-04-01 15:10:34 -07:00
david-sarah
93e50f5e16 interfaces.py: ensure that NoSuchChildError can be converted to str even when it is for a non-ASCII name. fixes #1483 2011-08-14 22:59:59 +00:00
david-sarah
122f63aa64 Spelling error in a comment. 2012-04-01 01:36:55 +00:00
david-sarah
972beffb25 test_node.py: test that we tolerate a UTF-8 BOM at the start of tahoe.cfg, and can read UTF-8 option values. refs #1470 2011-08-08 18:05:52 +00:00
david-sarah
ba0df23927 node.py: tolerate a UTF-8 BOM at the start of tahoe.cfg. fixes #1470 2011-08-08 18:02:04 +00:00
david-sarah
87ca4fc705 mutable/layout.py: improve confusing documentation of layout. fixes #1534 2011-09-14 14:39:47 +00:00
Brian Warner
5bae4a1bd2 Mutable repair: use new MODE_REPAIR to query all servers *and* get privkey
This fixes bug #1689. Repair was using MODE_READ to build the servermap,
which doesn't try hard enough to grab the privkey, and also doesn't guarantee
sending queries to all servers. This patch adds a new MODE_REPAIR which does
both, and does a separate, distinct mapupdate to start wth repair cycle,
instead of relying upon the (MODE_CHECK) mapupdate leftover from the
filecheck that triggered the repair.
2012-03-31 11:39:02 -07:00
Brian Warner
2b8a312cb7 Add test for bug #1689: repairing empty file hits no-privkey assertion 2012-03-31 11:39:02 -07:00
david-sarah
74cfa65f0d test_ftp.py: fix a couple of unused imports. refs #1668 2012-03-31 02:17:25 +00:00
Peter Le Bek
7f6ee7e918 ftpd file `size' attribute must be an integer 2012-03-22 13:18:06 +00:00
Peter Le Bek
be1fd9d2b5 unit test for ftpd LIST 2012-03-30 23:41:39 +00:00
Peter Le Bek
14a50f258a fix ftpd mtime retrieval 2012-03-30 23:41:19 +00:00
Brian Warner
24812905a1 test_introducer.SystemTest: fix race condition
SystemTest has a couple of different phases, separated by a poller which
waits for everything to be idle (all messages delivered, none in flight). It
does this by watching some internal "_debug_outstanding" counters in the
server and in each client, and waiting for them to hit zero.

Just before the last phase, we replace the server with a new one (to make
sure clients re-send their messages properly). Unfortunately, the polling
function closed over the variable holding the original server, and didn't see
the replacement. It kept polling the old server, and failed to notice the
outstanding messages for the new server. The last phase of the test (check3)
was started too early, which failed (since some messages had not yet been
delivered), and then exploded in a flurry of dirty-reactor errors (because
some messages were delivered after test shutdown).

This replaces the closed-over-variable with a "self.the_introducer", which
seems to fix the race.

One additional place to look at in the future: the client
announcement-receive path (remote_announce) uses an eventually(). If the
message has been received and the eventual-send posted (but not yet executed)
when the poller sees it, the poller might erroneously conclude that the
client is idle and cause the same problem as above. To fix this, the poller
(probably all pollers) could be enhanced to do a flushEventualQueue before
querying the are-we-done-yet predicate function.
2012-03-30 17:29:06 -07:00