diff --git a/test/sharness/t0140-swarm.sh b/test/sharness/t0140-swarm.sh index 121240621..b9a215de5 100755 --- a/test/sharness/t0140-swarm.sh +++ b/test/sharness/t0140-swarm.sh @@ -97,4 +97,26 @@ test_expect_success "Addresses.NoAnnounce with /ipcidr affects addresses" ' test_kill_ipfs_daemon +test_expect_success "set up tcp testbed" ' + iptb init -n 2 -p 0 -f --bootstrap=none +' + +startup_cluster 2 + +test_expect_success "disconnect work without specifying a transport address" ' + [ $(ipfsi 0 swarm peers | wc -l) -eq 1 ] && + ipfsi 0 swarm disconnect "/ipfs/$(iptb get id 1)" && + [ $(ipfsi 0 swarm peers | wc -l) -eq 0 ] +' + +test_expect_success "connect work without specifying a transport address" ' + [ $(ipfsi 0 swarm peers | wc -l) -eq 0 ] && + ipfsi 0 swarm connect "/ipfs/$(iptb get id 1)" && + [ $(ipfsi 0 swarm peers | wc -l) -eq 1 ] +' + +test_expect_success "stopping cluster" ' + iptb stop +' + test_done