Skip to content

Commit

Permalink
Corenet API: Drop 'exp' namespace
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Łukasz Magiera <[email protected]>
  • Loading branch information
magik6k committed May 30, 2017
1 parent 473ae5b commit 24d5f04
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 34 deletions.
15 changes: 0 additions & 15 deletions core/commands/experimental.go

This file was deleted.

2 changes: 1 addition & 1 deletion core/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ var rootSubcommands = map[string]*cmds.Command{
"cat": CatCmd,
"commands": CommandsDaemonCmd,
"config": ConfigCmd,
"corenet": CorenetCmd,
"dag": dag.DagCmd,
"dht": DhtCmd,
"diag": DiagCmd,
"dns": DNSCmd,
"exp": ExpCmd,
"files": files.FilesCmd,
"get": GetCmd,
"id": IDCmd,
Expand Down
36 changes: 18 additions & 18 deletions test/sharness/t0180-corenet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ test_expect_success "enable filestore config setting" '
'

test_expect_success 'start corenet listener' '
ipfsi 0 exp corenet listen corenet-test /ip4/127.0.0.1/tcp/10101 2>&1 > listener-stdouterr.log
ipfsi 0 corenet listen corenet-test /ip4/127.0.0.1/tcp/10101 2>&1 > listener-stdouterr.log
'

test_expect_success 'Test server to client communications' '
ma-pipe-unidir --listen send /ip4/127.0.0.1/tcp/10101 < corenet0.bin &
SERVER_PID=$!
ipfsi 1 exp corenet dial $PEERID_0 corenet-test /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log &&
ipfsi 1 corenet dial $PEERID_0 corenet-test /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log &&
ma-pipe-unidir recv /ip4/127.0.0.1/tcp/10102 > client.out &&
wait $SERVER_PID
'
Expand All @@ -52,7 +52,7 @@ test_expect_success 'Test client to server communications' '
ma-pipe-unidir --listen recv /ip4/127.0.0.1/tcp/10101 > server.out &
SERVER_PID=$!
ipfsi 1 exp corenet dial $PEERID_0 corenet-test /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log &&
ipfsi 1 corenet dial $PEERID_0 corenet-test /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log &&
ma-pipe-unidir send /ip4/127.0.0.1/tcp/10102 < corenet1.bin
wait $SERVER_PID
'
Expand All @@ -67,26 +67,26 @@ test_expect_success 'client to server output looks good' '

test_expect_success "'ipfs corenet ls' succeeds" '
echo "/ip4/127.0.0.1/tcp/10101 /app/corenet-test" > expected &&
ipfsi 0 exp corenet ls > actual
ipfsi 0 corenet ls > actual
'

test_expect_success "'ipfs corenet ls' output looks good" '
test_cmp expected actual
'

test_expect_success "Cannot re-register app handler" '
(! ipfsi 0 exp corenet listen corenet-test /ip4/127.0.0.1/tcp/10101)
(! ipfsi 0 corenet listen corenet-test /ip4/127.0.0.1/tcp/10101)
'

test_expect_success "'ipfs corenet streams' output is empty" '
ipfsi 0 exp corenet streams > actual &&
ipfsi 0 corenet streams > actual &&
test_must_be_empty actual
'

test_expect_success "Setup: Idle stream" '
ma-pipe-unidir --listen --pidFile=listener.pid recv /ip4/127.0.0.1/tcp/10101 &
ipfsi 1 exp corenet dial $PEERID_0 corenet-test /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log &&
ipfsi 1 corenet dial $PEERID_0 corenet-test /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log &&
ma-pipe-unidir --pidFile=client.pid recv /ip4/127.0.0.1/tcp/10102 &
go-sleep 500ms &&
Expand All @@ -95,31 +95,31 @@ test_expect_success "Setup: Idle stream" '

test_expect_success "'ipfs corenet streams' succeeds" '
echo "2 /app/corenet-test /ip4/127.0.0.1/tcp/10101 $PEERID_1" > expected
ipfsi 0 exp corenet streams > actual
ipfsi 0 corenet streams > actual
'

test_expect_success "'ipfs corenet streams' output looks good" '
test_cmp expected actual
'

test_expect_success "'ipfs corenet close' closes stream" '
ipfsi 0 exp corenet close 2 &&
ipfsi 0 exp corenet streams > actual &&
ipfsi 0 corenet close 2 &&
ipfsi 0 corenet streams > actual &&
[ ! -f listener.pid ] && [ ! -f client.pid ] &&
test_must_be_empty actual
'

test_expect_success "'ipfs corenet close' closes app handler" '
ipfsi 0 exp corenet close corenet-test &&
ipfsi 0 exp corenet ls > actual &&
ipfsi 0 corenet close corenet-test &&
ipfsi 0 corenet ls > actual &&
test_must_be_empty actual
'

test_expect_success "Setup: Idle stream(2)" '
ma-pipe-unidir --listen --pidFile=listener.pid recv /ip4/127.0.0.1/tcp/10101 &
ipfsi 0 exp corenet listen corenet-test2 /ip4/127.0.0.1/tcp/10101 2>&1 > listener-stdouterr.log &&
ipfsi 1 exp corenet dial $PEERID_0 corenet-test2 /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log &&
ipfsi 0 corenet listen corenet-test2 /ip4/127.0.0.1/tcp/10101 2>&1 > listener-stdouterr.log &&
ipfsi 1 corenet dial $PEERID_0 corenet-test2 /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log &&
ma-pipe-unidir --pidFile=client.pid recv /ip4/127.0.0.1/tcp/10102 &
go-sleep 500ms &&
Expand All @@ -128,16 +128,16 @@ test_expect_success "Setup: Idle stream(2)" '

test_expect_success "'ipfs corenet streams' succeeds(2)" '
echo "3 /app/corenet-test2 /ip4/127.0.0.1/tcp/10101 $PEERID_1" > expected
ipfsi 0 exp corenet streams > actual
ipfsi 0 corenet streams > actual
test_cmp expected actual
'

test_expect_success "'ipfs corenet close -a' closes streams and app handlers" '
ipfsi 0 exp corenet close -a &&
ipfsi 0 exp corenet streams > actual &&
ipfsi 0 corenet close -a &&
ipfsi 0 corenet streams > actual &&
[ ! -f listener.pid ] && [ ! -f client.pid ] &&
test_must_be_empty actual &&
ipfsi 0 exp corenet ls > actual &&
ipfsi 0 corenet ls > actual &&
test_must_be_empty actual
'

Expand Down

0 comments on commit 24d5f04

Please sign in to comment.