Commit Graph

53 Commits

Author SHA1 Message Date
meejah
17fa32633c post-rebase fixups; needs review 2018-09-10 21:58:27 -06:00
meejah
0ff21ea7d5 all tests pass. wooo 2018-09-10 21:58:27 -06:00
meejah
d544284f92 introduce create_node_dir 2018-08-25 02:10:44 -06:00
meejah
35810a5692 pull 'basedir' entirely into _Config
Put all config-related methods into _Config; change
code to ask config for paths instead of using basedir;
add some better docstrings
2018-08-25 02:10:44 -06:00
Jean-Paul Calderone
28a2e6e557
Merge pull request #502 from exarkun/2926.cli-status-exceptions
Fix several cases where `tahoe status` rendering raises an unhandled exception.

Closes ticket:2926

Some possible operation states were not accounted for.
2018-05-28 08:38:42 -04:00
Jean-Paul Calderone
20084506b3 Handle all the status cases 2018-05-23 13:59:42 -04:00
Jean-Paul Calderone
234db487cd Add a unit test for X-Frame-Options being set 2018-04-13 12:56:50 -04:00
Jean-Paul Calderone
7bc207cdcb Shift this out of the way 2018-04-13 12:52:12 -04:00
Brian Warner
38da8f471c test_web: appease pyflakes 2018-03-21 00:22:31 -07:00
Brian Warner
e6ddd03338 test_web: remove noisy print statement 2018-03-21 00:13:52 -07:00
meejah
c7cbb4a6b3 better var names 2018-03-20 11:40:49 -06:00
meejah
9032539860 flake8; naming 2018-03-20 11:40:49 -06:00
meejah
1f495ec41f cover uploads and downloads in tests 2018-03-20 11:40:49 -06:00
meejah
75e97e6c6d use QueuedItem directly instead of FakeStatusItem 2018-03-20 11:40:49 -06:00
meejah
bfabfeba64 add 'size' to tests, print unicode 2018-03-20 11:40:49 -06: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
Brian Warner
05317d4d12 test_web: replace all shouldHTTPError with assertHTTPError
and update to inlineCallbacks while we're in there
2017-07-27 16:31:44 -07:00
Brian Warner
2687ee90c5 test_web: remove last traces of deprecated client.getPage 2017-07-27 16:31:44 -07:00
Brian Warner
965e974ce8 test_web: fix POST(url,body) calls that should have been POST2()
and remove the followRedirect= argument from POST
2017-07-27 16:31:44 -07:00
Brian Warner
0deb903888 test_web: rewrite all POST(followRedirect=True) calls with do_http
Since POST() is about to lose followRedirect=True
2017-07-27 16:31:44 -07:00
Brian Warner
3f03367d2f test_web: remove all other uses of shouldRedirect 2017-07-27 16:31:44 -07:00
Brian Warner
76063b1c12 test_web: replace some instances of shouldRedirect with shouldRedirectTo 2017-07-27 16:31:44 -07:00
Brian Warner
6be91e369c test_web: replace shouldReplace2 with shouldReplaceTo
This removes many uses of self.POST (since shouldReplaceTo does its own
HTTP), which will make it easier to remove client.getPage from POST.
2017-07-27 16:31:44 -07:00
Brian Warner
4745239c2c test_web: use inlineCallbacks in many functions
specifically everywhere we use self.shouldRedirect2
2017-07-27 16:31:44 -07:00
Brian Warner
73d09082d7 test_web.web.Web.POST: split out build_form() helper function 2017-07-27 16:31:44 -07:00
Brian Warner
202a9714c4 test_web test_bad_method: remove a client.getPage
Add WebErrorMixin.assertHTTPError, to replace (getPage + shouldHTTPError)
2017-07-27 16:31:44 -07:00
Brian Warner
bee05e883c test_web: remove HTTPClientGETFactory
This also changes the tests to handle the new API: URL can be unicode, and
the returned Headers object is not a dictionary.
2017-07-27 16:31:44 -07:00
Jean-Paul Calderone
e32f581d07 Get rid of the reliance on rref
It provides information more correctly obtained from
get_connection_status().
2017-07-27 16:31:41 -04:00
Jean-Paul Calderone
1f16a173f0 flatten the result structure
flat is better than nested
2017-07-27 15:32:47 -04:00
Jean-Paul Calderone
7027547ecc fix buggy test; restructure data
scared about duplicate nodeids in the data getting lost, switch to a list
2017-07-27 15:26:30 -04:00
Jean-Paul Calderone
f518c2a521 Switch over to stdlib json 2017-07-27 15:26:30 -04:00
Jean-Paul Calderone
e339130e63 Just make an assertion against the full value 2017-07-27 15:26:30 -04:00
Jean-Paul Calderone
e3e49632a5 use preferred spelling for new assertions 2017-07-27 15:26:30 -04:00
David Stainton
cd97f8519b web test: get_version should use a version string 2017-07-27 15:26:29 -04:00
David Stainton
923363c0d6 web test: test for server key in json welcome 2017-07-27 15:26:29 -04:00
David Stainton
ecb6651926 Add basic unit test for json welcome page 2017-07-27 15:26:29 -04:00
Jean-Paul Calderone
7c8c63a01f a helper for the ?t=json resources 2017-07-27 13:57:02 -04:00
Brian Warner
ad92b2b9b2 test_web: replace HEAD/PUT/DELETE with treq 2017-07-12 17:10:49 -07:00
Brian Warner
486fca0d5c web.test_introducer: replace getPage with treq 2017-07-12 17:10:49 -07:00
meejah
adb9a98383 WIP: refactoring (squahshed all meejah's commits) 2017-06-05 16:26:46 -06:00
meejah
031a88c25f simplejson -> json 2017-02-23 15:21:36 -07:00
Stefan Lew
481a02aee7 made tests work with new attribute rel="noreferrer" 2016-12-23 23:20:52 -05:00
Vladimir Rusinov
a95f2743ef Add test for deep-stats api version. 2016-12-23 22:50:48 -05:00
Brian Warner
5cbe580d90 improve ConnectionStatus and welcome-page display
* replace "last_details" with "non_connected_statuses" dict
* rename "last_connection_summary" to just "summary"
* for connected servers, show other hints in a tooltip
* for not-yet-connected servers, show all hints in a list
* build the list (in STAN) on the server side, not using IContainer
2016-12-09 18:41:38 -08:00
Brian Warner
38935bbca6 remove old unused connection-status APIs 2016-12-08 16:25:00 -08:00
Brian Warner
77fd41b66e update WUI welcome page with new connection-status info
This shows current-connection info, and provides per-hint status details in a
tooltip.

The "Connection" section no longer shows seconds-since-loss when the server
was not connected (previously it showed seconds-since-connect when connected,
and flipped to seconds-since-loss when disconnected). We already have the
"Last RX" column, which is arguably more meaningful (and I can't think of a
good case when these would differ), so we don't really need
seconds-since-loss, and the new ConnectionStatus doesn't track it anyways.

So now the "Connection" timestamp for non-connected servers is just
"N/A" (both the main text and the tooltip). The "Introducers" section was
changed the same way.

This moves the per-server connection timestamp out of the nickname/serverid
box and over into the Connection box. It also right-floats all timestamps,
regardless of which box they're in, which makes them share the box with
connection_status more politely.

Internally, this adds code to create ConnectionStatus objects when necessary.
2016-12-08 16:24:32 -08:00
David Stainton
4f717ba808 Add a multi-introducer implementation
this is based the previous work of warner, killyourtv and leif
 fixes ticket #68
2016-09-13 00:15:52 +00: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
Brian Warner
663e39593b static servers: tolerate missing nickname/versions
A minimally-defined static server only specifies server_id,
anonymous-storage-FURL, and permutation-seed-base32. But the WUI Welcome
page wouldn't render (it raised an exception) without also defining
nickname and version. This allows those values to be missing.
2016-08-27 11:34:32 -07:00