Commit Graph

3589 Commits

Author SHA1 Message Date
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
Daira Hopwood
02d96b970e Quote local paths correctly in the output of node creation commands. fixes ticket:2556
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-12-01 17:54:46 +00:00
Daira Hopwood
913082230c Disable bridging of foolscap logging to the Twisted log, and remove docs for it. fixes ticket:2567
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-11-03 17:35:21 +00:00
Brian Warner
67dcedd8df introweb: fix connection hints for server announcements
A long time ago, the introducer's status web page would show the
advertised IP addresses for all published services, by parsing their
FURL's connection hints. This hasn't worked since about 12-Aug-2014 when
foolscap-0.6.5 changed the internal format of these hints (the column
has been empty this whole time).

This removes the "Advertised IPs" column from the Service Announcements
table. Instead, the service's full connection hints (not just the IP
address) is displayed in a tooltip/popup on the "Announced" timestamp
column.

The code that pulls these connection hints is now tolerant of all three
foolscap styles:

* foolscap<=0.6.4 : tuples of ("ipv4",host,port)
* 0.6.5 .. 0.8.0  : tuples of ("tcp",host,port)
* foolscap>=0.9.0 : strings

fixes ticket:2510
2015-09-22 17:19:52 -07:00
Brian Warner
8f0c417910 remove "announcement_distinct_hosts" from introweb JSON
The machine-parseable JSON output for the introducer status web page
used to include a key named "announcement_distinct_hosts", which counted
the number of distinct IP addresses advertised by all connected storage
servers. This hasn't worked since Aug-2014 when foolscap-0.6.5 change
the internal hints format.

This removes that field.
2015-09-22 17:19:47 -07:00
Brian Warner
71323fbd8f introducer: stop tracking hints for subscribed clients
A long time ago, the introducer's status web page would show the
advertised IP addresses for all subscribers, by parsing their
RemoteReference's FURL's connection hints. This hasn't worked since
about 12-Aug-2014 when foolscap-0.6.5 changed the internal format of
these hints.

This removes the feature: we no longer attempt to show advertised IP
addresses of subscribed clients. It also removes the code that looked
inside foolscap internals for this information.
2015-09-22 17:19:43 -07:00
Daira Hopwood
a4dfc31a19 Avoid spurious errors when an imported version is consistent with pkg_resources
but not parseable; also improve related error reporting. fixes ticket:2499

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-09-12 00:59:51 +01:00
Brian Warner
e5979f970f test_cli_cp: minor cleanup 2015-07-28 17:39:26 -07:00
Brian Warner
98ab848cda cp: error on target-filename collisions, rather than overwrite
Closes ticket:2447
2015-07-28 17:39:26 -07:00
Zooko
f0fd34d16c unit test for my desired behavior 2015-07-28 17:39:26 -07:00
Daira Hopwood
023f9fa4d3 test_version.py: minor cleanup.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-07-29 00:20:33 +01:00
Daira Hopwood
2c99294a4f Don't show scary diagnostic warnings from --version[-and-path] (corrected). refs ticket:2436
The previous version would incorrectly add to the output of
get_package_versions_string each time it was called.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-07-29 00:20:33 +01:00
Daira Hopwood
3239527929 Revert "Don't show scary diagnostic warnings from --version[-and-path]"
This reverts commit 431728f8f8.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-07-29 00:20:33 +01:00
Brian Warner
29ab496bd7 mutable/retrieve.py: remove all bare assert()s
Replace them with _assert() or precondition(). Closes ticket:2462.
2015-07-28 13:32:46 -07:00
Brian Warner
6252a72965 IReadable.read(): document out-of-range errors
closes ticket#2461
2015-07-28 13:01:15 -07:00
Brian Warner
27ea6e1a3c test_mutable: more enhancements 2015-07-28 10:27:24 -07:00
Brian Warner
89e9076c41 mutable/retrieve.py: rewrite partial-read handling
This should tolerate offset/size combinations that read the last byte of
the file, something which was broken before. It quits early in the case
of zero-byte reads, to simplify the resulting "which segments do I need"
logic. Probably addresses ticket:2459.
2015-07-28 10:13:32 -07:00
Brian Warner
46d7085dfe enhance SDMF/MDMF tests: zero-length files, size=None 2015-07-28 10:13:32 -07:00
Daira Hopwood
a7e1dac27f Add tests for SDMF partial reads. refs #2459
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-07-28 10:13:32 -07:00
Daira Hopwood
9076db137a Remove some bare asserts in retrieve.py (there are still quite a few left). refs #2462
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-07-28 10:13:32 -07:00
Daira Hopwood
19df54927d Minor code cleanup in __init__.py.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-07-21 18:55:47 +01:00
Daira Hopwood
431728f8f8 Don't show scary diagnostic warnings from --version[-and-path]
if the only problem is that extra packages are found by pkg_resources.
fixes ticket:2436

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-07-21 18:51:29 +01:00
Daira Hopwood
c830419e04 Eliminate mock dependency.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-07-17 22:12:25 +01:00
Daira Hopwood
3ae6ceb6a8 Add Namespace utility class. (This is already used in the leasedb/cloud backend branch.)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-07-17 22:12:25 +01:00
Daira Hopwood
2d7c852ace Bump pyasn1 requirement to >= 0.1.8.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-07-16 15:38:06 +01:00
Daira Hopwood
baaf2a4a55 Blacklist mock > 1.0.1.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-07-16 15:24:45 +01:00
Brian Warner
28b74b0b74 test/check_load: hush (newer) pyflakes
pyflakes-0.9.2 gets confused about list comprehensions, so rename the
loop variable even though we'd deleted that name already.
2015-07-12 18:25:55 -07:00
Brian Warner
7aedd7c1b2 test_web: avoid IP autodetection, was causing dirty reactor 2015-07-12 18:20:43 -07:00
Daira Hopwood
f18da535c9 Remove packages from not_import_versionable that we now can always version.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-06-02 18:12:23 +01:00
Daira Hopwood
96024d7244 Add OpenSSL version check and tests. refs ticket:2215
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-06-02 18:07:20 +01:00
Brian Warner
45ebbbf44b wrap long lines, and tolerate various-width wrappings of the --help output
test_cli.Help was too sensitive to the way that the --help output was
wrapped, which caused failures on travis when COLUMNS= was set low and
the expected strings were split across separate lines.
2015-05-26 11:40:17 -07:00
Brian Warner
8f41713fe9 cli: improve formatting of all commands
Also:

* do some light refactoring of create-client/node
* make it clear that these commands' --basedir options do the same as
  the global --node-directory option
* use "global-options" instead of "global-opts"
2015-05-26 11:31:06 -07:00
Brian Warner
01619844de scripts: improve rendering of synopsis/usage
Subcommands "--help" is now rendered as:

```
 tahoe [global-options] COMMAND [options] ARGS
 (use 'tahoe --help' to view global options)
 USAGE (flags/options)
 DESCRIPTION
 DESCRIPTION_UNWRAPPED
```

The new .description and .description_unwrapped fields allow
commands (subclasses of twisted.python.usage.Usage) better control over
how their explanations are rendered: the old .longdesc field was wrapped
unpleasantly.
2015-05-26 11:29:49 -07:00
Brian Warner
5d5fa05a42 scripts/runner.py: put command group descriptions in parens 2015-05-26 11:27:57 -07:00
Brian Warner
1c34cbd627 refactor scripts/common.py: move _default_nodedir out to its own file 2015-05-26 11:27:57 -07:00
Zooko
a9b152780e remove dead code: NamedTemporaryDirectory
fixes #2433
2015-05-26 17:20:11 +00:00
Daira Hopwood
143af61518 fileutil.py: use ctypes.get_last_error() instead of GetLastError(). refs #1531
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-05-18 01:42:01 +01:00
Daira Hopwood
4794666df6 On Windows, the user's home directory may be either %USERPROFILE% or %HOMEDRIVE%%HOMEPATH% depending on the Windows version. fixes ticket:2417
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-05-13 14:42:31 +01:00
Daira Hopwood
f973657a6a interfaces.py: fix arguments to create_subdirectory.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-05-13 14:21:28 +01:00
Daira Hopwood
5d046c597e drop-upload.py: fix error messages.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-05-13 14:21:17 +01:00
Daira Hopwood
0c4acc763b Fix a pyflakes warning.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-05-13 14:21:17 +01:00
Daira Hopwood
07aa5e76b5 Retire the setup_requires hack in cases where it isn't needed (and can cause build problems). refs #2286
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-05-13 12:49:18 +01:00
Daira Hopwood
d106a77567 _auto_deps.py: update comments. refs #2416
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-05-13 12:44:21 +01:00
Daira Hopwood
c2874a7073 Allow working with Twisted >= 13 on Windows if pywin32 is manually installed. fixes #2416
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-05-13 12:44:21 +01:00
Brian Warner
be5d07a70a apply review feedback 2015-05-03 22:14:36 -07:00
Brian Warner
275ddb93cc cp: trailing slash on source filename is an error, just like on targets 2015-05-03 22:14:35 -07:00
Brian Warner
ca23c4fa23 tahoe cp: ignore trailing slash on source arguments
This avoids an error case where an empty child name resulted in a
duplicate mkdir. It adds a precondition check to guard against empty
child names, and some test cases. It also cleans up a funny redundancy
noticed earlier (refs ticket:2329).
2015-05-03 22:13:52 -07:00
Brian Warner
97fd19407d Improve docs on 'cp -r', noting the recent 2329 changes
refs ticket:2329
2015-05-03 21:49:34 -07:00
Brian Warner
341e263e03 control.py: minor improvements
refs ticket:1737
2015-04-28 11:03:12 -07:00
Daira Hopwood
53ced4be8b Change foolscap dependency to >= 0.8.0. refs #2400
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-04-28 17:21:31 +01:00
Daira Hopwood
e6cede21f2 Fix a test that was dependent on Windows path separators.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-04-21 21:28:21 +01:00
Daira Hopwood
6bcef565d9 Reduce differences between Windows and non-Windows dependencies.
This also fixes some warnings on Windows when using Twisted 12.1.0.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-04-21 21:16:29 +01:00
Brian Warner
f0e783e20e fix check-memory test, with new new (safe) control-port methods 2015-04-21 13:05:58 -07:00
Daira Hopwood
eb34e0d625 Ensure the 'base' argument to abspath_expanduser_unicode takes effect on Windows. fixes #2398
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-04-21 21:04:20 +01:00
Brian Warner
edcdaa2799 finish removing control-port upload/download functions 2015-04-21 11:26:16 -07:00
Brian Warner
2eea4e9a07 remove control-port upload/download file interfaces
FURLs are unguessable, but an attacker who somehow learned this FURL
could overwrite files and read sensitive data.

This will break the memory tests. I will add a new interface to support
the memory tests soon.

refs ticket:1737
2015-04-21 11:13:17 -07:00
Daira Hopwood
45c1dc7e63 backupdb.py: cosmetics
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-04-17 22:31:01 +01:00
Daira Hopwood
6e9a602df6 Make backupdb use dbutil.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-04-17 22:30:47 +01:00
Daira Hopwood
769de61a90 Add util/dbutil.py: open/create/update sqlite databases given some schema.
Author: Brian Warner <warner@lothar.com>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-04-17 18:11:10 +01:00
Daira Hopwood
4de4e0e65e Some useful Deferred utilities, originally from the cloud backend branch.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-04-17 18:10:21 +01:00
Brian Warner
eda00a5c58 typo 2015-03-31 11:07:21 -07:00
Brian Warner
cc68a81326 bump Twisted dep to 11.1.0, thus simplify IntishPermissions 2015-03-31 11:06:14 -07:00
Brian Warner
b36903d02c test_ftp: fix comparison against integer 2015-03-31 11:06:14 -07:00
Brian Warner
26c8abadec Fix ftp 'ls' to work with current Twisted-15.0.0
refs ticket:2394

It's kind of a hack, but Twisted changed the API and I couldn't find a
cleaner way to detect which form of "permissions" value the Twisted FTP
server wants.

I've manually tested it against 14.0.2 and 15.0.0.
2015-03-31 11:06:14 -07:00
Brian Warner
2d3c805a90 use more servers for test_mutable.Update, to test #2034 properly 2015-03-25 18:49:37 -07:00
Daira Hopwood
b6be693cbe Add a test, add missing imports. refs #2388
This tests ftpd, but not sftpd. Doing this sort of test on sftpd
requires the creation of a valid pubkey/privkey file pair, which is more
work than I want to do right now.

init_ftp/init_sftp were changed to interpret the configured
accounts.file as relative to the node's basedir, with
abspath_expanduser_unicode(accountfile, base=self.basedir).
This would happen naturally in a real node, since it os.chdir()s
to the basedir before doing anything. But tests don't do that.

Author: Brian Warner <warner@lothar.com>
Author: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-03-24 17:10:00 +00:00
Daira Hopwood
3066039f0f Ensure that path parameters to SFTPServer and FTPServer constructors are unicode. refs #2388
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-03-24 16:46:40 +00:00
Daira Hopwood
21226cbb82 Add from_utf8_or_none and tests.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-03-24 16:46:40 +00:00
Brian Warner
681eb4d12e check_memory.py: announce 32-bit vs 64-bit 2015-03-19 18:59:16 -07:00
Brian Warner
3dd7142c42 test_cli_cp.py: hush pyflakes 2015-03-17 11:16:06 -07:00