Commit Graph

4224 Commits

Author SHA1 Message Date
Brian Warner
5e62118e14 hush somewhat-real problems found by static analysis
These would have caused problems if a certain unlikely code path was taken:
mostly error-handling pathways.
2017-12-31 00:23:43 +01:00
Brian Warner
da4e7dcfbe hush a bunch of not-really-problems caught by the lgtm.com static analyzer
This is all minor stuff: unreachable debug code (that should be commented-out
instead of in an 'if False:' block), unnecessary 'pass' and 'global'
statements, redundantly-initialized variables. No behavior changes. Nothing
here was actually broken, it just looked suspicious to the static analysis at
https://lgtm.com/projects/g/tahoe-lafs/tahoe-lafs/alerts/?mode=list .
2017-12-31 00:19:41 +01:00
meejah
6c0c90829f cheezy test for more coverage 2017-12-05 12:02:16 -07:00
meejah
87ad3cb8e9 fix 2880
- remember upload URI so we don't re-download
- account for empty files in "should_download"
- fix 'conflicted' asserts in tests
2017-12-05 12:02:16 -07: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
50f8397c99 Merge branch 'invalid-pidfile' into delete-invalid-pidfile--lpirl
Conflicts:
	src/allmydata/scripts/startstop_node.py
	src/allmydata/test/cli/test_cli.py
2017-11-08 14:49:29 -07:00
Brian Warner
a1711088ed test_i2p_provider: exercise escaping of apiEndpoint attribute 2017-11-03 00:24:46 -07:00
Brian Warner
1f1afe65ec tor_provider.get_listener(): return a real endpoint, instead of a descriptor
get_listener() is allowed to return either, and the Tor provider is currently
simple enough to not really need more than a basic descriptor, but have it
return a full Endpoint for use as an example of what I2P can do later.
2017-11-03 00:24:46 -07:00
Brian Warner
d713e0e57d address review feedback: docstrings, better test class name 2017-11-03 00:24:46 -07:00
Brian Warner
097abb42fa tahoe.cfg: add tub.port=listen:i2p (and/or listen:tor)
This delegates the construction of the server Endpoint object to the i2p/tor
Provider, which can use the i2p/tor section of the config file to add options
which would be awkward to express as text in an endpoint descriptor string.

refs ticket:2889 (but note this merely makes room for a function to be
written that can process I2CP options, it does not actually handle such
options, so it does not close this ticket yet)
2017-11-03 00:24:46 -07:00
Brian Warner
d1fd43aa4f tor/i2p: rename create_onion/create_dest to create_config 2017-11-03 00:24:46 -07:00
meejah
fd90346c88 Wait up to 60s for node start; improve messaging; look for errors 2017-09-20 00:55:19 -06:00
meejah
263a3f43c1 stop chdir 2017-09-19 10:39:19 -06:00
meejah
9375056b61 Split up startstop_node and add 'tahoe daemonize'
This sets the stage for further changes to the startup
process so that "async things" are done before we create
the Client instance while still reporting early failures
to the shell where "tahoe start" is running

Also adds a bunch of test-coverage for the things that got
moved around, even though they didn't have coverage before
2017-09-19 10:39:19 -06:00
Lukas Pirl
89bacbb70a Merge branch 'master' into invalid-pidfile 2017-08-24 18:40:00 +02:00
Lukas Pirl
46305c74e1 added test for (ignoring an) invalid PID file when starting a node 2017-08-24 17:56:57 +02:00
Jean-Paul Calderone
86f79e8111 Add a test for the non-numeric case 2017-08-24 16:46:46 +02:00
Jean-Paul Calderone
354567cb85 Add a test for the non-numeric case 2017-08-24 10:34:58 -04:00
Lukas Pirl
1bf032959f delete invalid PID file on `tahoe (re)start` 2017-08-24 15:22:25 +02:00
Lukas Pirl
dd9b951c4b fix crash when stopping/restarting with an invalid pidfile
in node directory
2017-08-23 20:23:15 +02:00
Brian Warner
8dd0a5f772 dictutil: remove unused move, subtract, del_if_present 2017-08-12 21:48:05 -07:00
Brian Warner
61b85dbf78 dictutil: remove unused ValueOrderedDict 2017-08-12 21:34:24 -07:00
Brian Warner
4f493b1a03 remove unused UtilDict 2017-08-12 21:31:47 -07:00
Brian Warner
a76d9e084f dictutil: remove unused NumDict 2017-08-12 21:21:04 -07:00
Brian Warner
3afa38adb4 NummedObj: stop using dictutil.NumDict 2017-08-12 21:02:32 -07:00
Brian Warner
3f2f7dfb05 dictutil: fix bug in str(ValueOrderedDict), and improve test coverage
It looks like str() was meant to truncate the dict, but a missing i+=1 meant
that it never actually did. I also changed the format to include a clear
"..." in case we truncate it, to avoid confusion with a non-truncated dict of
the same size.

This also improves test coverage in subtract() and
NumDict.item_with_largest_value().

refs ticket:2891
2017-08-10 10:27:02 -07:00
Brian Warner
95ac5494ff test_backupdb: tolerate newer sqlite-3.20.0 error messages 2017-08-10 10:21:39 -07:00
meejah
798bf57e28 Add 'tahoe invite' and 'tahoe create-node --join' commands
This opens a wormhole and sends appropriate JSON down
it to a tahoe-gui using a wormhole server running on
tahoe-lafs.org

The other end uses the 'tahoe create-node' command (with
new --join option) to read the configuration JSON from
a 'tahoe invite' command
2017-08-08 18:27:06 -06:00
meejah
e2a5751d02 at least use random port 2017-08-08 10:42:11 -06:00
Brian Warner
a4be2dce71 avoid variable coverage by using a defaultdict
refs ticket:2891
2017-07-27 18:19:57 -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
Brian Warner
5a895b5fb6 GridTestMixin.GET: use treq instead of HTTPClientGETFactory 2017-07-27 16:31:44 -07:00
Brian Warner
3311f9520d test.cli.test_status: replace getPage with treq 2017-07-27 16:31:44 -07:00
Brian Warner
bd1e4507ee remove unused HTTPClientHEADFactory 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
754304e4d5 Switch Root over to MultiFormatPage 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