magic-wormhole/src/wormhole/test
Brian Warner b8313b4595 dedup relays, include our own relay when connecting
* Previously, we only connected to the relay supplied by our partner, which
  meant that if our relay differed from theirs, we'd never connect
* But we must de-duplicate the relays because when our relay *is* the same as
  theirs, we'd have two copies, which means two connections. Now that we
  deliver sided handshakes, we can tolerate that (previously, our two
  connections would be matched with each other), but it's still wasteful.

This also fixes our handling of relay hints to accept multiple specific
endpoints in each RelayHint. The idea here is that we might know multiple
addresses for a single relay (maybe one IPv4, one IPv6, a Tor .onion, and an
I2P address). Any one connection is good enough, and the connections we can
try depend upon what local interfaces we discover. So a clever implementation
could refrain from making some of those connections when it knows the sibling
hints are just as good. However we might still have multiple relays entirely,
for which it is *not* sufficient to connect to just one.

The change is to create and process RelayV1Hint objects properly, and to set
the connection loop to try every endpoint inside each RelayV1Hint. This is
not "clever" (we could nominally make fewer connection attempts), but it's
plenty good for now.

refs #115

fix relay hints
2016-12-23 22:22:39 -05:00
..
__init__.py unsplit tests step 1: move files 2016-04-20 18:44:33 -07:00
common.py CLI: refactor to make testing easier 2016-07-14 22:34:10 -06:00
run_trial.py added unicode_literals import to all apropriate modules 2016-06-04 12:42:59 -07:00
test_args.py Add --appid to override the APPID, for subprocess-based wrappers. 2016-12-22 15:44:13 -05:00
test_database.py db: add v2->v3 upgrader 2016-06-24 16:19:39 -07:00
test_hkdf.py added unicode_literals import to all apropriate modules 2016-06-04 12:42:59 -07:00
test_scripts.py Add --appid to override the APPID, for subprocess-based wrappers. 2016-12-22 15:44:13 -05:00
test_server.py transit server: accept both new (sided) and old (unsided) handshakes 2016-12-22 23:54:36 -05:00
test_ssh.py update tests 2016-08-15 17:36:55 -07:00
test_transit.py dedup relays, include our own relay when connecting 2016-12-23 22:22:39 -05:00
test_util.py fix tests on windows 2016-12-15 19:52:26 -08:00
test_wormhole.py internals: ensure _API_establish_key is not called twice 2016-12-16 01:33:17 -08:00
test_xfer_util.py add some basic tests, doesn't cover everything 2016-08-15 17:35:34 -07:00