Commit Graph

114 Commits

Author SHA1 Message Date
Jean-Paul Calderone
a4a73a20a2 Fix incorrect assertion 2019-03-28 16:18:43 -04:00
meejah
72f17a3834 better cleanup 2018-09-10 21:58:28 -06:00
meejah
d0141b2f95 better docstring from exarkun 2018-09-10 21:58:28 -06:00
meejah
edb581b434 better docstring from exarkun 2018-09-10 21:58:28 -06:00
meejah
507c2db649 better utest docstring, cleanup 2018-09-10 21:58:28 -06:00
meejah
2e2bdf1ea1 test for EnvironmentError that's not ENOENT 2018-09-10 21:58:28 -06:00
meejah
714b0887dc more docstrings 2018-09-10 21:58:27 -06:00
meejah
7632504373 create_client is async 2018-09-10 21:58:27 -06:00
meejah
767f4ddd5d reorder args to match other method 2018-09-10 21:58:27 -06:00
meejah
283be23e3a basedir fixup, more tests 2018-09-10 21:58:27 -06:00
meejah
f0c3db0e5a pyflakes 2018-09-10 21:58:27 -06:00
meejah
d1a83e9be0 more tests work 2018-09-10 21:58:27 -06:00
meejah
329ef1256a refactor create_client to be async (works to run, some unit-test fails still) 2018-09-10 21:58:27 -06:00
meejah
d478cf3831 add some docstrings, fix comments 2018-08-25 02:10:44 -06:00
meejah
5000787c18 flake8 2018-08-25 02:10:44 -06:00
meejah
abd7b638b8 basic stfpd setup test 2018-08-25 02:10:44 -06:00
meejah
6c388b9d58 test for authtoken API 2018-08-25 02:10:44 -06:00
meejah
4aec12a92f whitespace on long lines 2018-08-17 15:53:59 -06:00
meejah
3723945296 Actually validate configs when loading them
An indenting problem meant the validators weren't being
called, which revealed some follow-on errors.
2018-08-17 15:53:59 -06:00
Jean-Paul Calderone
035dc6dc76 reduce fragility of tests .. maybe?
only trivially, at best, of course.
2018-04-23 11:41:36 -04:00
Brian Warner
0616aa7de7 test_absolute_storage_dir: don't use uSNOWMAN on non-unicode platforms
Exercising the unicode possibilities are nice, but not critical to this test,
so let's just avoid the non-ascii characters when the filesystem encoding
can't handle them
2018-03-28 15:17:23 -07:00
Jean-Paul Calderone
1f92879788 improve test coverage 2018-03-19 14:21:28 -04:00
Ruben Pollan
136de7d7f7 Add storage_dir config field
On the [storage] section of the tahoe.cfg now there is a field
'storage_dir' where the path to the storage folder can be configured.
2018-03-19 11:20:04 -04:00
meejah
672475cb2b Multiple magic-folders
This moves all magic-folder configs to a single YAML
file. We load legacy config fine and don't mess with
legacy config unless you use a magic-folder command that
changes the config.

Increase test coverage
2017-12-05 10:34:48 -07:00
meejah
1b6f477549 Pull "config" handling out of Node and hide node-derivitives
This includes:

 - refactor to create_client and _Client
 - refactor to _IntroducerNode and create_introducer
2017-11-20 12:57:20 -07:00
meejah
da4e1589bb Rename _turn_delay and friends to make things more clear
This forces the Uploader and Downloader to implement a _scan_delay
method and makes the naming more consistent with what's actually
happening. Also, fix a few "bugs" in the names of args in the
mocks for some tests.
2016-10-25 12:38:57 -07:00
Brian Warner
30b421d48b test_client: improve coverage slightly 2016-08-28 02:39:39 -07:00
Brian Warner
cac99569e9 factor out "Tub maker"
This adds Node._create_tub(), which knows how to make a Tub with all the
right options and connection handlers that were specified in
tahoe.cfg (the connection handlers are disabled for now, but they'll get
implemented soon).

The new Node.create_main_tub() calls it. This main Tub is used:

* to connect to the Introducer
* to host the Helper (if enabled)
* to host the Storage Server (if enabled)

Node._create_tub() is also passed into the StorageFarmBroker, which
passes it into each NativeStorageServer, to create the (separate) Tub
for each server connection. _create_tub knows about the options, and
NativeStorageServer can override the connection handlers. This way we
don't need to pass tub options or default handlers into Client,
StorageFarmBroker, or NativeStorageServer.

A number of tests create NativeStorageServer objects: these were updated
to match the new arguments. test_storage_client was simplified because
we no longer need to mock out the Tub() constructor.
2016-08-27 17:36:55 -07:00
meejah
58f9641179 Correct magic-folder use of StorageFarmBroker
When landing the "connected enough" changes on master,
we changed the API; this fixes up usage of it in magic-folder.
2016-07-21 12:35:59 -07:00
David Stainton
9d7785f57b Fix magic folder constructor signature in test 2016-07-21 12:35:59 -07:00
Daira Hopwood
e03a1e3361 WIP.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
3170cab0fc Prepare to move drop_upload.py to magic_folder.py.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
5f143f7635 Enable Windows inotify support.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
61b3a9cef2 Add magic folder db.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
7b4067850f Unicode path fixes for drop-upload.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
David Stainton
6061b6fc3c WIP Storage broker client creates one tub per server
i was unable to get all the unit tests working;
this is my work in progress.
2016-05-02 15:23:07 +00: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
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
c830419e04 Eliminate mock dependency.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-07-17 22:12:25 +01: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
Brian Warner
597542dc77 test that web.static= is really treated as a relative path
Also ssh.authorized_keys_file .
2015-02-03 22:23:31 -08:00
Daira Hopwood
c20a3525b7 Use "long" paths prefixed with \\?\ on Windows. refs #2235
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-30 00:05:14 +00:00
Daira Hopwood
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
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
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
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
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
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