Commit Graph

255 Commits

Author SHA1 Message Date
Brian Tiger Chow
a85aa9b5da refactor: rename testutil func 2014-12-24 09:31:17 -05:00
Juan Batiz-Benet
99636b571c net/id: handle error case 2014-12-24 04:22:51 -08:00
Juan Batiz-Benet
e630ca6078 dht: removing extra newlines 2014-12-24 03:42:43 -08:00
Juan Batiz-Benet
900c1fbfa2 net/id: when dup id, wait on it. 2014-12-24 03:38:44 -08:00
Juan Batiz-Benet
ccf6f79aa0 respect don contexteone 2014-12-24 03:24:28 -08:00
Juan Batiz-Benet
0013415db8 net/interface: move more to Dialer 2014-12-24 02:10:56 -08:00
Juan Batiz-Benet
fd2875f2ed fixing race in swarm 2014-12-23 17:59:24 -08:00
Juan Batiz-Benet
a5018fcc0b net/mock: interface addresses 2014-12-23 09:23:32 -08:00
Juan Batiz-Benet
64a4abcd6c listen addresses: add Interface addresses
network.ListenAddresses() are general.
Interface addresses are specific.
2014-12-23 09:01:54 -08:00
Juan Batiz-Benet
0dbd86c4f8 connectedness test timing 2014-12-23 09:00:43 -08:00
Brian Tiger Chow
06d4df23f1 misc naming
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-23 08:58:31 -08:00
Juan Batiz-Benet
b61b281eae net/conns better printing of connections 2014-12-23 08:53:28 -08:00
Juan Batiz-Benet
4d9f1f0fdf net: Connectedness bugfix
Connectedness was totally incorrect. added a test case.
2014-12-23 08:50:24 -08:00
Juan Batiz-Benet
7952d95bbf added bootstrap logging 2014-12-23 08:48:58 -08:00
Juan Batiz-Benet
497297b243 net/mocknet: fixed listenaddrs (misrepresenting)
some dht tests signaled "sending peer empty addresses"
which would then cause a failure. this was a misrepresentation
on the part of mocknet. it has been corrected.
2014-12-23 08:42:12 -08:00
Juan Batiz-Benet
4fe1dd9b62 net: have an explicit IdentifyConn on dial
- Make sure we call IdentifyConn on dialed out conns
- we wait until the identify is **done** before return
- on listening case, we can also wait.
- tests now make sure dial does wait.
- tests now make sure we can wait on listening case.
2014-12-23 08:40:52 -08:00
Juan Batiz-Benet
d9961893a2 net/id_test: refactor tests into own func 2014-12-23 08:39:32 -08:00
Juan Batiz-Benet
c84a714b16 peer change: peer.Peer -> peer.ID
this is a major refactor of the entire codebase
it changes the monolithic peer.Peer into using
a peer.ID and a peer.Peerstore.

Other changes:
- removed handshake3.
-	testutil vastly simplified peer
-	secio bugfix + debugging logs
-	testutil: RandKeyPair
-	backpressure bugfix: w.o.w.
-	peer: added hex enc/dec
-	peer: added a PeerInfo struct
  PeerInfo is a small struct used to pass around a peer with
 	a set of addresses and keys. This is not meant to be a
 	complete view of the system, but rather to model updates to
 	the peerstore. It is used by things like the routing system.
-	updated peer/queue + peerset
-	latency metrics
-	testutil: use crand for PeerID gen
 	RandPeerID generates random "valid" peer IDs. it does not
 	NEED to generate keys because it is as if we lost the key
 	right away. fine to read some randomness and hash it. to
 	generate proper keys and an ID, use:
 	  sk, pk, _ := testutil.RandKeyPair()
 	  id, _ := peer.IDFromPublicKey(pk)
 	Also added RandPeerIDFatal helper
- removed old spipe
- updated seccat
- core: cleanup initIdentity
- removed old getFromPeerList
2014-12-23 08:33:32 -08:00
Juan Batiz-Benet
c4a935c3e3 go complains about lack of buildable file 2014-12-17 23:44:39 -08:00
Juan Batiz-Benet
4da261001f mocknet printer for printing 2014-12-17 23:25:41 -08:00
Juan Batiz-Benet
6acc152f0c backpressure: explanation + more rounds 2014-12-17 23:25:41 -08:00
Juan Batiz-Benet
db7d7ae891 net: sending backpressure test 2014-12-17 23:25:41 -08:00
Juan Batiz-Benet
ccc17d2740 net: cool test for new stream backpressure
Sadly, as cool as this test is, it doesn't work
Because spdystream doesnt handle stream open backpressure
well. I'll see about rewriting that part when it becomes
a problem. More backpressure tests comming.
2014-12-17 23:25:41 -08:00
Juan Batiz-Benet
358b8a9984 net: testing protocol 2014-12-17 23:25:41 -08:00
Juan Batiz-Benet
b573d66208 mocknet: internals test
Found bugs with it :)
2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
f354fa849e mocknet: FullMesh connects to self too.
@maybebtc thoughts on this? dialing self should be
**possible**, so we should in general test that we do
consider that case, but not sure if this is good to expose
to clients. thoughts?

Btw, on why dialing self should be possible, we may create
little protocols which we may have a node connect to self,
say across its interfaces to test connectivity, etc...
think of it like:

> server localhost:1234 &
> curl localhost:1234
2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
b0a36aabcb mocknet: bugfix on opening conns + printer 2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
f1fc09ccee mocknet: printing internal mocknet state 2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
2ae9b27859 moved net/swarm2 -> swarm 2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
5d019ad300 mocknet add test 2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
de6eef9178 mv net/mock2 -> net/mock 2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
58510640fa rm old mock 2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
e6a7179a8a mock2: removed list to fix bugs
container/lists suck
2014-12-17 23:25:39 -08:00
Juan Batiz-Benet
444f47d7f5 mock2: link map fixes 2014-12-17 23:25:39 -08:00
Juan Batiz-Benet
59d1426cf5 mock2/ missing ctxgroup 2014-12-17 23:25:39 -08:00
Juan Batiz-Benet
2f9d398d66 mock2/ connections 2014-12-17 23:25:39 -08:00
Juan Batiz-Benet
3c9be87704 mock2: ConnectAll 2014-12-17 23:25:39 -08:00
Juan Batiz-Benet
5a2a8c62f3 unlinkPeers fix 2014-12-17 23:25:39 -08:00
Juan Batiz-Benet
ac42cbe9f9 mock2 2014-12-17 23:25:39 -08:00
Brian Tiger Chow
6884c9ddd2 trivial change to trigger build 2014-12-17 23:25:38 -08:00
Juan Batiz-Benet
78c0802f97 connect swarm context to network 2014-12-17 23:25:38 -08:00
Juan Batiz-Benet
ba323c3e48 make vendor 2014-12-17 23:25:38 -08:00
Juan Batiz-Benet
7648a8b55c swarm tests: dont send to self 2014-12-17 23:25:38 -08:00
Juan Batiz-Benet
bc2d35fd4d Lots of fixes. DHT tests pass 2014-12-17 23:25:38 -08:00
Juan Batiz-Benet
7fdafaf1e5 stress test 2014-12-16 14:47:30 -08:00
Juan Batiz-Benet
fd3cd399e5 mock network 2014-12-16 14:47:29 -08:00
Juan Batiz-Benet
41751b4938 Integrated new network into ipfs 2014-12-16 14:47:29 -08:00
Juan Batiz-Benet
061e1ab861 net: better protocol headers 2014-12-16 14:47:29 -08:00
Juan Batiz-Benet
c150668a1c net: threadsafe mux handler add 2014-12-16 14:47:29 -08:00
Juan Batiz-Benet
f18bbde344 net: StreamHandlerMap + protocol ids 2014-12-16 14:47:29 -08:00