Skip to content

Commit

Permalink
test(sharness): fix tests for /ipfs -> /p2p change
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien authored and Walter Beegle committed Jun 8, 2020
1 parent c0a4774 commit e1de07f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
32 changes: 16 additions & 16 deletions test/sharness/t0180-p2p.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ test_server_to_client() {

spawn_sending_server

test_expect_success 'S->C(/ipfs/peerID) Setup client side' '
ipfsi 1 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10102 /ipfs/${PEERID_0} 2>&1 > dialer-stdouterr.log
test_expect_success 'S->C(/p2p/peerID) Setup client side' '
ipfsi 1 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10102 /p2p/${PEERID_0} 2>&1 > dialer-stdouterr.log
'

test_expect_success 'S->C Setup(dnsaddr/addr/ipfs/peerID) client side' '
ipfsi 1 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10103 /dnsaddr/bootstrap.libp2p.io/ipfs/${PEERID_0} 2>&1 > dialer-stdouterr.log
test_expect_success 'S->C Setup(dnsaddr/addr/p2p/peerID) client side' '
ipfsi 1 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10103 /dnsaddr/bootstrap.libp2p.io/p2p/${PEERID_0} 2>&1 > dialer-stdouterr.log
'

test_expect_success 'S->C Setup(dnsaddr/addr) client side' '
Expand Down Expand Up @@ -126,7 +126,7 @@ test_expect_success 'C->S Spawn receiving server' '
'

test_expect_success 'C->S Setup client side' '
ipfsi 1 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10102 /ipfs/${PEERID_0} 2>&1 > dialer-stdouterr.log
ipfsi 1 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10102 /p2p/${PEERID_0} 2>&1 > dialer-stdouterr.log
'

test_expect_success 'C->S Connect and receive data' '
Expand Down Expand Up @@ -155,7 +155,7 @@ test_expect_success "cannot accept 0 port in 'ipfs p2p listen'" '
'

test_expect_success "'ipfs p2p forward' accept 0 port" '
ipfsi 2 p2p forward /x/p2p-test/0 /ip4/127.0.0.1/tcp/0 /ipfs/$PEERID_0
ipfsi 2 p2p forward /x/p2p-test/0 /ip4/127.0.0.1/tcp/0 /p2p/$PEERID_0
'

test_expect_success "'ipfs p2p ls' output looks good" '
Expand All @@ -168,7 +168,7 @@ test_expect_success "'ipfs p2p ls' output looks good" '
# Listing streams

test_expect_success "'ipfs p2p ls' succeeds" '
echo "/x/p2p-test /ipfs/$PEERID_0 /ip4/127.0.0.1/tcp/10101" > expected &&
echo "/x/p2p-test /p2p/$PEERID_0 /ip4/127.0.0.1/tcp/10101" > expected &&
ipfsi 0 p2p ls > actual
'

Expand All @@ -190,7 +190,7 @@ check_test_ports
test_expect_success "Setup: Idle stream" '
ma-pipe-unidir --listen --pidFile=listener.pid recv /ip4/127.0.0.1/tcp/10101 &
ipfsi 1 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10102 /ipfs/$PEERID_0 &&
ipfsi 1 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10102 /p2p/$PEERID_0 &&
ma-pipe-unidir --pidFile=client.pid recv /ip4/127.0.0.1/tcp/10102 &
test_wait_for_file 30 100ms listener.pid &&
Expand All @@ -199,7 +199,7 @@ test_expect_success "Setup: Idle stream" '
'

test_expect_success "'ipfs p2p stream ls' succeeds" '
echo "3 /x/p2p-test /ipfs/$PEERID_1 /ip4/127.0.0.1/tcp/10101" > expected
echo "3 /x/p2p-test /p2p/$PEERID_1 /ip4/127.0.0.1/tcp/10101" > expected
ipfsi 0 p2p stream ls > actual
'

Expand Down Expand Up @@ -232,7 +232,7 @@ test_expect_success "Setup: Idle stream(2)" '
ma-pipe-unidir --listen --pidFile=listener.pid recv /ip4/127.0.0.1/tcp/10101 &
ipfsi 0 p2p listen /x/p2p-test2 /ip4/127.0.0.1/tcp/10101 2>&1 > listener-stdouterr.log &&
ipfsi 1 p2p forward /x/p2p-test2 /ip4/127.0.0.1/tcp/10102 /ipfs/$PEERID_0 2>&1 > dialer-stdouterr.log &&
ipfsi 1 p2p forward /x/p2p-test2 /ip4/127.0.0.1/tcp/10102 /p2p/$PEERID_0 2>&1 > dialer-stdouterr.log &&
ma-pipe-unidir --pidFile=client.pid recv /ip4/127.0.0.1/tcp/10102 &
test_wait_for_file 30 100ms listener.pid &&
Expand All @@ -241,7 +241,7 @@ test_expect_success "Setup: Idle stream(2)" '
'

test_expect_success "'ipfs p2p stream ls' succeeds(2)" '
echo "4 /x/p2p-test2 /ipfs/$PEERID_1 /ip4/127.0.0.1/tcp/10101" > expected
echo "4 /x/p2p-test2 /p2p/$PEERID_1 /ip4/127.0.0.1/tcp/10101" > expected
ipfsi 0 p2p stream ls > actual
test_cmp expected actual
'
Expand Down Expand Up @@ -283,8 +283,8 @@ test_expect_success "'ipfs p2p close' closes by target addr" '

test_expect_success "'ipfs p2p close' closes right listeners" '
ipfsi 0 p2p listen /x/p2p-test /ip4/127.0.0.1/tcp/10101 &&
ipfsi 0 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10101 /ipfs/$PEERID_1 &&
echo "/x/p2p-test /ipfs/$PEERID_0 /ip4/127.0.0.1/tcp/10101" > expected &&
ipfsi 0 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10101 /p2p/$PEERID_1 &&
echo "/x/p2p-test /p2p/$PEERID_0 /ip4/127.0.0.1/tcp/10101" > expected &&
ipfsi 0 p2p close -l /ip4/127.0.0.1/tcp/10101 &&
ipfsi 0 p2p ls > actual &&
Expand All @@ -294,7 +294,7 @@ test_expect_success "'ipfs p2p close' closes right listeners" '
check_test_ports

test_expect_success "'ipfs p2p close' closes by listen addr" '
ipfsi 0 p2p close -l /ipfs/$PEERID_0 &&
ipfsi 0 p2p close -l /p2p/$PEERID_0 &&
ipfsi 0 p2p ls > actual &&
test_must_be_empty actual
'
Expand All @@ -313,7 +313,7 @@ test_expect_success 'C->S Spawn receiving server' '
'

test_expect_success 'C->S Setup client side' '
ipfsi 1 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10102 /ipfs/${PEERID_0} 2>&1 > dialer-stdouterr.log
ipfsi 1 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10102 /p2p/${PEERID_0} 2>&1 > dialer-stdouterr.log
'

test_expect_success 'C->S Connect and receive data' '
Expand Down Expand Up @@ -358,7 +358,7 @@ test_expect_success 'start p2p listener on custom proto' '
spawn_sending_server

test_expect_success 'S->C Setup client side (custom proto)' '
ipfsi 1 p2p forward --allow-custom-protocol /p2p-test /ip4/127.0.0.1/tcp/10102 /ipfs/${PEERID_0} 2>&1 > dialer-stdouterr.log
ipfsi 1 p2p forward --allow-custom-protocol /p2p-test /ip4/127.0.0.1/tcp/10102 /p2p/${PEERID_0} 2>&1 > dialer-stdouterr.log
'

test_server_to_client
Expand Down
6 changes: 3 additions & 3 deletions test/sharness/t0182-circuit-relay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ test_expect_success 'peer ids' '
'

test_expect_success 'connect A <-Relay-> B' '
ipfsi 0 swarm connect /p2p-circuit/ipfs/$PEERID_2 > peers_out
ipfsi 0 swarm connect /p2p-circuit/p2p/$PEERID_2 > peers_out
'

test_expect_success 'output looks good' '
Expand All @@ -54,12 +54,12 @@ test_expect_success 'output looks good' '

test_expect_success 'peers for A look good' '
ipfsi 0 swarm peers > peers_out &&
test_should_contain "/ipfs/$PEERID_1/p2p-circuit/ipfs/$PEERID_2$" peers_out
test_should_contain "/p2p/$PEERID_1/p2p-circuit/p2p/$PEERID_2$" peers_out
'

test_expect_success 'peers for B look good' '
ipfsi 2 swarm peers > peers_out &&
test_should_contain "/ipfs/$PEERID_1/p2p-circuit/ipfs/$PEERID_0$" peers_out
test_should_contain "/p2p/$PEERID_1/p2p-circuit/p2p/$PEERID_0$" peers_out
'

test_expect_success 'add an object in A' '
Expand Down

0 comments on commit e1de07f

Please sign in to comment.