Commit Graph

3633 Commits

Author SHA1 Message Date
meejah
db517e8edd Progress API
- IProgress interface + PercentProgress implementation
 - progress= args to many upload/download APIs
 - ultimately for magic-folder
2016-04-12 00:30:50 -07:00
Brian Warner
bb7184163e test/common: add a slight stall in tearDown
With the new Foolscap-0.11.0 (which changed the way connections are
established), I'm seeing DirtyReactorErrors getting thrown by
allmydata.test.test_system.SystemTest.test_filesystem_with_cli_in_subprocess
, on a host that has three IP addresses (one is 127.0.0.1, two is wifi,
three is a VPN). The test itself is getting skipped because bin/tahoe
isn't in the expected place, but by that point, the nodes have already
been launched and have established connections over one of the three
hints (probably 127.0.0.1). The test terminates so quickly that the
connections to the other two addresses have not finished being
abandoned. The extra stall seems to give Foolscap enough time to reap
the cancelled connections and makes the DRT go away.

I think an offline test, or maybe one with a single external IP address,
wouldn't hit this case.

Arbitrary stalls are never very satisfactory, of course. Usually there
is some threshold delay value, below which it fails reliably, above
which it works on my own machine (for now). This one is weird: the
threshold seems to be below the resolution of the system clock. Stalling
for one nanosecond was enough to fix the problem, but using a simple
fireEventually() didn't work.
2016-04-07 20:59:42 -10:00
Brian Warner
8279d919f3 remove "manhole" (ssh-accessible REPL)
This little-used debugging feature allowed you to SSH or Telnet "into" a
Tahoe node, and get an interactive Read-Eval-Print-Loop (REPL) that
executed inside the context of the running process. The SSH
authentication code used a deprecated feature of Twisted, this code had
no unit-test coverage, and I haven't personally used it in at least 6
years (despite writing it in the first place). Time to go.

Also experiment with a Twisted-style "topfiles/" directory of NEWS
fragments. The idea is that we require all user-visible changes to
include a file or two (named as $TICKETNUM.$TYPE), and then run a script
to generate NEWS during the release process, instead of having a human
scan the commit logs and summarize the changes long after they landed.

Closes ticket:2367
2016-04-06 13:40:06 -10:00
Brian Warner
ce548687f8 iputil.py: avoid DirtyReactorError when running tests offline
The udpprot.transport.connect() fails if we don't have a network
connection, but the port is still listening, so trial gives us a
DirtyReactorError. The fix is a "finally:" which does
port.stopListening() even in this case.

Closes ticket:2769
2016-04-03 19:26:57 -10:00
Brian Warner
d57c8d5e39 bump Twisted dependency (>=15.1.0) to get the [tls] extra
We only really need "Twisted >= 13.0.0", but we must add "[tls]" because
otherwise pip won't install it when Foolscap asks for it later, and we
need ">= 15.1.0" because that's the first version that provided "[tls]".

Fixes ticket:2760.
2016-03-30 11:33:36 -07:00
Brian Warner
017fec16a4 test/check_memory: stop using .tac files 2016-03-25 16:26:29 -07:00
Brian Warner
77b3ab019d add __main__.py so "python -m allmydata" works
Thanks to dstufft for the suggestion. I know this can make it slightly
easier to run tahoe in some funny environments (where an appropriate
"python" is on your path but the generated "tahoe" executable is not).
2016-03-25 14:49:18 -07:00
Daira Hopwood
0598c830ed Rename distribution from allmydata-tahoe to tahoe-lafs. fixes ticket:2011
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-03-25 19:16:01 +00:00
Daira Hopwood
c3d54e0221 Back out the dependency on the conch extra for Twisted. refs ticket:2740
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-03-25 18:44:15 +00:00
Daira Hopwood
1db2419655 Update Twisted dependency to include tls and conch extras.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-03-25 18:33:04 +00:00
Brian Warner
b5aad1ba4c test_system: remove foolscap version check
Our install_requires= want foolscap>=0.10.1, and this check only fired
if we were given <0.6.4, so the check should be obsolete.

Also, the check was breaking my attempt to test Tahoe against a
development release of Foolscap, as the NormalizedVersion call threw an
IrrationalVersionError at my Versioneer-based "0.10.1+14.g37d8279"
version string.
2016-03-23 02:16:50 -07:00
Brian Warner
831b39d8fb remove src/buildtest/ and related build_helper/ test files
This was used to exercise our old virtualenv-like scheme. Now that we
use virtualenv, they're unnecessary. Plus, removing it lets us stop
polluting end-user installs with the extra package (that might
conceivably conflict with some other project that names itself
"buildtest").
2016-03-22 22:56:03 -07:00
Brian Warner
dd84abd9f2 setup.py: work with tox under py3
This allows a python3-based "tox" (as shipped with modern debian and
ubuntu systems) to run setup.py egg_info, update_version, and sdist
commands. It moves the main "tahoe requires py2" check out of setup.py
and into allmydata.scripts.runner.run, where it gets applied at runtime
rather than build time.

It also changes the execfile(_auto_deps.py) and Versioneer-like "ask git
what our version string should be" code to work under both py2 and py3.

fixes ticket:2747
2016-03-22 22:34:42 -07:00
Brian Warner
b8ad887823 Reduce setuptools dep to >=11.3
We don't necessarily need this ourselves (__init__.py's version-checking
code is the only thing in tahoe per se that uses setuptools, and our
setup.py's use of setuptools isn't something that install_requires= can
say anything about). But at least one old environment failed because a
sub-dependency needed a newer version than Tahoe asked for. I'm not sure
if this ought to be here, but it may help for a transitional period
until these ancient environments get updated.

closes ticket:2744
2016-03-18 11:28:58 -07:00
Brian Warner
141ff17b91 auto_deps: bump to setuptools>=20.3
20.3 is the current version as of today. I'm not really sure what
version we need, but this is better than the previous zetuptoolz "0.6c6"
requirement. Closes ticket:2744.
2016-03-17 22:12:04 -07:00
Brian Warner
36865a329c fix test_runner.BinTahoe.test_the_right_code
With our new tox/pip/virtualenv -based environment, we no longer need
the bin/tahoe script, so the tests that examine it needed to change.
In particular, we no longer need to be running tests from the root of a
source tree. Instead, what we care about is that the subprocess 'tahoe'
is importing code from the same place that the unit test .py files live.
2016-03-15 18:15:29 -07:00
Daira Hopwood
2e91068da1 Use version information from pkg_resources when we can't get it from import.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-03-15 17:31:32 +00:00
Daira Hopwood
8ddfc3def0 Tolerate IrrationalVersionError when parsing version numbers of dependencies,
without a warning. fixes ticket:2733

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-03-15 17:31:32 +00:00
Daira Hopwood
fe360ee47b Fix tests that were incorrectly skipping due to not being able to find the 'tahoe' script.
TODO: this may have broken testing "frozen" builds.
refs ticket:1582

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-03-15 17:31:32 +00:00
Daira Hopwood
aa8a5be037 On Windows we need pypiwin32. refs ticket:1582
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-03-15 17:31:13 +00:00
Daira Hopwood
f1890c09f2 Delete some crufty workarounds.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-03-15 17:30:35 +00:00
Daira Hopwood
d8549a2c7f setuptools delenda est. fixes ticket:1582 :-D
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-03-15 17:19:10 +00:00
Brian Warner
28f2a0f12d test_util: tolerate unordered repr of NumDict
NumDict does not make any claims about the order of its repr(), so the
test needs to be prepared for it to be stringified in any order. On unix
the old test happened to pass, but on certain windows boxes (maybe
certain versions of python?), it failed. Fixes ticket:2736.
2016-02-23 10:51:25 -08:00
Brian Warner
186f6d4a59 Merge pull request #236 from daira/2725.timezone-test.0
Fix tests on platforms without time.tzset (e.g. Windows)
2016-02-08 14:39:28 -08:00
Daira Hopwood
e4d536e609 Avoid spurious SUCCESS!?? for test_format_time_y2038.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-02-05 20:04:43 +00:00
Daira Hopwood
c6449b687a Fix tests on platforms without time.tzset (e.g. Windows). fixes ticket:2725
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-02-05 19:14:09 +00:00
Leif Ryge
56a9f5adaf remove introducer's set_encoding_parameters
I'm not sure why this ever existed, but it doesn't appear to be used.

(If an introducer called a client's set_encoding_parameters method it would
keep the provided parameters in an instance attribute but would not actually
use them.)
2016-02-05 11:44:12 +00:00
Brian Warner
46fd26e7d2 bump foolscap dependency to 0.10.1
The tahoe-deps repo was also updated, and the tahoe-deps tarball was
regenerated.

Closes ticket:2722
2016-02-02 22:19:57 -08:00
Daira Hopwood
e1285d27b9 Fix an error-reporting problem in test_welcome (this does not fix the underlying failure). refs ticket:2725
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-02-02 19:34:01 +00:00
Daira Hopwood
278ee0db76 Fix an error handling path that would never have been reached. fixes ticket:2543
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-02-02 18:55:34 +00:00
Daira Hopwood
0d6fcf445e Remove -u shortcut for 'tahoe ls --uri' which clashes with --node-url. fixes ticket:1949, ticket:2137
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-02-02 18:45:52 +00:00
Daira Hopwood
498563da69 Simplify an existing test by using TimezoneMixin.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-02-02 18:11:24 +00:00
Daira Hopwood
0abbf474b0 Don't call time.tzset() if the platform doesn't have it. fixes ticket:2723
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-02-02 18:10:33 +00:00
Brian Warner
67af736db1 web/status.py: minor renaming to hush pyflakes 2016-01-31 11:02:50 -08:00
Leif Ryge
55fdbaa3a2 Make tests work with both Nevow 0.11 and 0.12
closes #2663
2016-01-31 17:18:03 +00:00
Leif Ryge
5b33f1fdf3 wui: improved columns in welcome page server list
As discussed at https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1973 and in
previous pull request #129.

 - replace lengthy timestamps with human-readable deltas (eg 1h 2m 3s)
 - replace "announced" column with "Last RX" column
 - remove service column (it always said the same thing, "storage")
 - fix colspan on 'You are not presently connected' message

Previous versions, some with github comments: 3fe9053134 , 486dbfc7bd , and c89ea62580, 9fabb92486, bbd8b42a25

Unlike previous attempts, the tests on this one should pass in any timezone.
(But like current master, will fail with Nevow >=0.12...)

Thanks to an anonymous contributor who wrote some of the tests.
2016-01-23 14:28:09 +00:00
Leif Ryge
c86388b79c revert previous commit to fix attribution (vanity)
This reverts the previous commit (modulo the one line that daira added) so that
my contributions will be properly attributed by git blame etc.
2016-01-23 14:27:11 +00:00
Daira Hopwood
a2d724aab7 wui: improved columns in welcome page server list
As discussed at https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1973 and in
previous pull request #129.

 - replace lengthy timestamps with human-readable deltas (eg 1h 2m 3s)
 - replace "announced" column with "Last RX" column
 - remove service column (it always said the same thing, "storage")
 - fix colspan on 'You are not presently connected' message

Previous versions, some with github comments: 3fe9053134 , 486dbfc7bd , and c89ea62580, 9fabb92486, bbd8b42a25

Unlike previous attempts, the tests on this one should pass in any timezone.
(But like current master, will fail with Nevow >=0.12...)

Thanks to an anonymous contributor who wrote some of the tests.
2016-01-15 20:02:19 +00:00
Leif Ryge
6226f6b497 wui: use standard time format (#1077) 2016-01-15 19:46:39 +00:00
Daira Hopwood
f2824459eb Reject path arguments that start with '-' with a usage error.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-12-28 21:27:15 +00:00
Daira Hopwood
e88e07a278 Improved error handling and cosmetics for ctypes calls on Windows.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-12-28 21:17:32 +00:00
Daira Hopwood
56bf458355 Find the node-directory option correctly even if we are in a subcommand.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-12-28 20:52:51 +00:00
Daira Hopwood
1f7069e622 test_encodingutil: use self.patch rather than modifying encodingutil.io_encoding directly.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-12-28 20:52:51 +00:00
Daira Hopwood
394a4e25e6 Require arguments to do_cli to be strs.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-12-28 20:52:51 +00:00
Daira Hopwood
48917186f2 URIs are strs.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-12-28 20:12:29 +00:00
Daira Hopwood
46719a8bcf Aliases are Unicode.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-12-28 20:12:29 +00:00
Daira Hopwood
58841cab38 Refactor tahoe.cfg handling to configutil.
Author: David Stainton <david@leastauthority.com>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-12-28 19:36:19 +00:00
Daira Hopwood
b5222e3679 Merge pull request #204 from leif/preferred_peers-rebased3
new feature: preferred storage servers
2015-12-04 18:01:30 +00:00
Leif Ryge
96eaca6a6d new feature: preferred storage servers
this includes a squash merge of dca1de6856 which
was previously seen in pull request #128, as well as daira's suggested changes
from pull request #204.
2015-12-01 19:35:41 +00:00
Daira Hopwood
8ce7e2430c Add test for 'tahoe create-node/client/introducer' output. closes ticket:2556
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-12-01 17:58:16 +00:00