Brian Warner
bf25dc68cf
connector: use disconnect(), not loseConnection()
2019-02-10 15:57:55 -08:00
Brian Warner
0c9d2c927a
fix hashability of dilation objects
2019-02-10 15:57:39 -08:00
Brian Warner
e4264971d7
add dilate/test_full, still failing
2019-02-10 11:51:54 -08:00
Brian Warner
a2a149946b
test_connect: skip integration test when Noise is unavailable
2019-02-10 11:51:54 -08:00
Brian Warner
7f03adda3a
dilate.test_connect: basic integration test
...
This mocks out the mailbox connection, and makes sure that endpoints are
constructed.
2019-02-10 11:51:54 -08:00
Brian Warner
059338a257
Add Dilator.stop(), fix delivery of connection made/lost messages
...
Dilator.stop() now shuts everything down, and returns a Deferred when it all
stops moving. This needed some Manager state machine changes (to notify
Dilator when it enters the STOPPED state). This also revealed problems in the
delivery of connector_connection_made() (which was misnamed) and
connector_connection_lost() (which wasn't being called at all).
2019-02-10 11:51:54 -08:00
Brian Warner
39fed50071
add no_listen=False to Manager and Dilator
...
This is only used by tests so far (and will simplify the integration test
that hasn't landed yet), but is not yet wired up to Boss, so there's no way
for applications to enable it yet.
2019-02-10 11:51:54 -08:00
Brian Warner
64618bcb64
manager: tidy up repr, leave out keys and some other fields
2019-02-10 11:51:54 -08:00
Brian Warner
b538dd6758
dilation.outbound: registerProducer goes on transport, not Protocol
2019-02-10 11:51:54 -08:00
Brian Warner
53ffbe1632
fix Noise handshake ordering
...
I mistakenly believed that Noise handshakes are simultaneous. In fact, the
Responder waits until it sees the Initiator's handshake before sending its
own. I had to update the Connection state machines to work this way (the
Record machine now has set_role_leader and set_role_follower), and update the
tests to match.
For debugging I added a `_role` property to Record, but it should probably be
removed.
2019-02-10 11:51:54 -08:00
Brian Warner
d1ff97f988
make some dilation objects hashable
...
necessary to include them in a set like _pending_connectors
2019-02-10 11:51:54 -08:00
Brian Warner
be2dc01a94
wormhole.py: add debug switch to enable dilation (for tests)
2019-02-10 11:47:28 -08:00
Brian Warner
6bd7e85a53
test_transit sometimes fails with EADDRINUSE on travis
2019-02-10 11:22:04 -08:00
Brian Warner
4083beeb6c
wormhole.py: disable dilate() API until ready
...
more importantly, turn off the "we can do Dilation" advertisement for now,
since we really can't
2018-12-24 14:34:02 -05:00
Brian Warner
29c269ac8d
get tests to work on py2.7
...
only install 'noiseprotocol' (which is necessary for dilation to work) if the
"dilate" feature is requested (e.g. `pip install magic-wormhole[dilate]`)
2018-12-24 00:07:06 -05:00
Brian Warner
a458fe9ab9
finish test coverage/fixes for connector.py
2018-12-23 15:23:27 -05:00
Brian Warner
6ad6f8f40f
test and fix half of connector.py
...
still to do:
* relay delays
* connection race
* cancellation of losing connections
* shutdown of all connections when abandoned
2018-12-23 15:23:27 -05:00
Brian Warner
e7cb1df785
factor out HKDF
2018-12-23 15:23:27 -05:00
Brian Warner
b4c90b40a2
move parse_hint/encode_hint into _hints.py, add tests
2018-12-23 15:23:27 -05:00
Brian Warner
d64c94a1dc
test_hints: finish coverage of hints.py
2018-12-23 15:23:27 -05:00
Brian Warner
1bb5634d0e
factor Hints tests out of test_transit into a new file
2018-12-23 15:23:27 -05:00
Brian Warner
7720312c8f
factor out parse_tcp_v1_hint
2018-12-23 15:23:27 -05:00
Brian Warner
2f4e4d3031
factor out describe_hint_obj and endpoint_from_hint_obj
2018-12-23 15:23:27 -05:00
Brian Warner
bd1a199f3e
start factoring Hints out to separate file
...
shared between old transit.py and new _dilation/connector.py
2018-12-23 15:23:27 -05:00
Brian Warner
3b7c9831f6
appease flake8 somewhat
2018-12-23 15:23:27 -05:00
Brian Warner
40dadfeb71
finish fixing/testing manager.py
2018-12-23 15:23:27 -05:00
Brian Warner
e55787c693
get most of Manager working and tested
...
still need to test the subchannel interfaces, and ping/pong/kcm
2018-12-23 15:23:27 -05:00
Brian Warner
78358358bc
manager: hush flake8
2018-12-23 15:23:27 -05:00
Brian Warner
7084cbcb6f
test_manager: fix
2018-12-23 15:23:27 -05:00
Brian Warner
a4234cdecf
test_machines: fix for change to got_wormhole_versions
2018-12-23 15:23:27 -05:00
Brian Warner
8a1a8b1f9c
manager: factor out make_side for testing and override
2018-12-23 15:23:27 -05:00
Brian Warner
7e168b819e
manager: clean up versions, merge state machines
2018-12-23 15:23:27 -05:00
Brian Warner
d4a551c6b8
boss: remove sides from call to D.got_wormhole_versions()
2018-12-23 15:23:27 -05:00
Brian Warner
74e5d9948b
move old-follower.py out of src, kept for temporary reference
2018-12-23 15:23:27 -05:00
Brian Warner
a594a85427
Revert "Boss/Receive: add 'side' to got_message"
...
This reverts commit 1fece5701c9de5e470526d2e7e9cfd7b461977e0.
2018-12-23 15:23:27 -05:00
Brian Warner
d65fcaa1a6
more flake8 fixes
2018-12-23 15:22:57 -05:00
Brian Warner
5f61531445
more flake8 fixes, in wormhole.py and _interfaces.py
2018-12-23 15:22:57 -05:00
Brian Warner
bf0c93eddc
more flake8 fixes
2018-12-23 15:22:57 -05:00
Brian Warner
05900bd08b
fix some flake8 complaints
2018-12-23 15:22:57 -05:00
Brian Warner
34686a346a
add dilation code
...
(this compresses several months of false starts and rearchitecting)
2018-12-23 15:21:08 -05:00
Brian Warner
cd6ae6390f
_rendezvous: add note to use EventualQueue
2018-12-23 15:20:25 -05:00
Brian Warner
6cfabba31a
add reactor/cooperator to Wormhole and Boss calls
2018-12-23 15:20:25 -05:00
Brian Warner
a693b1fc48
Boss/Receive: add 'side' to got_message
...
this will be used later by Dilation
2018-12-23 15:20:25 -05:00
Brian Warner
e260369be1
__main__.py: stop breaking automat-visualize
2018-12-23 15:20:24 -05:00
Brian Warner
eb7c04e366
observer.py: add EmptyableSet
2018-12-23 15:18:38 -05:00
Brian Warner
e6b4ccb565
Merge branch 'pr318'
2018-12-09 14:28:56 -08:00
Edward Betts
010d1843c0
Correct spelling mistakes
2018-11-23 07:38:21 +00:00
Mario Rodas
504ddb0d91
Add inlineCallbacks decorator to test_wormholes testcase
2018-11-19 23:38:29 -05:00
Brian Warner
4e97bb041a
fix/hush some flake8 warnings
...
test_ipaddrs.py had an invalid regexp, caught by the latest version of flake8
The new flake8 complains about both W503 (line break inside a conditional
before a binary operator) and W504 (line break *after* the operator). I think
break-before is the new preferred style, but for now I'm just going to ignore
them both and leave the code alone.
2018-11-13 10:21:41 -08:00
Brian Warner
74da87bec2
change __main__.py
to use relative imports
...
This should fix `python -m wormhole` on py2. Closes #315 .
2018-11-13 09:59:36 -08:00