@cryptotaxi247 / kubo / commits / 98a1c4448

test swarm connect/disconnect

License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>

Steven Allen committed Jun 12, 2018 at 14:50 UTC 98a1c44489d7ffc0a4c9cd67365c6d0270ad4c19
1 file changed +22
test/sharness/t0140-swarm.sh
+22
@@ -97,4 +97,26 @@ test_expect_success "Addresses.NoAnnounce with /ipcidr affects addresses" '
97
98 test_kill_ipfs_daemon
99
100 +test_expect_success "set up tcp testbed" '
101 + iptb init -n 2 -p 0 -f --bootstrap=none
102 +'
103 +
104 +startup_cluster 2
105 +
106 +test_expect_success "disconnect work without specifying a transport address" '
107 + [ $(ipfsi 0 swarm peers | wc -l) -eq 1 ] &&
108 + ipfsi 0 swarm disconnect "/ipfs/$(iptb get id 1)" &&
109 + [ $(ipfsi 0 swarm peers | wc -l) -eq 0 ]
110 +'
111 +
112 +test_expect_success "connect work without specifying a transport address" '
113 + [ $(ipfsi 0 swarm peers | wc -l) -eq 0 ] &&
114 + ipfsi 0 swarm connect "/ipfs/$(iptb get id 1)" &&
115 + [ $(ipfsi 0 swarm peers | wc -l) -eq 1 ]
116 +'
117 +
118 +test_expect_success "stopping cluster" '
119 + iptb stop
120 +'
121 +
122 test_done