Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
d6626a5c
Commit
d6626a5c
authored
Nov 13, 2018
by
Łukasz Magiera
Committed by
Steven Allen
Nov 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p2p: tests for report-peer-id
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
c0a1e80f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
test/sharness/t0180-p2p.sh
test/sharness/t0180-p2p.sh
+43
-0
No files found.
test/sharness/t0180-p2p.sh
View file @
d6626a5c
...
...
@@ -299,6 +299,49 @@ test_expect_success "'ipfs p2p close' closes by listen addr" '
test_must_be_empty actual
'
# Peer reporting
test_expect_success
'start p2p listener reporting peer'
'
ipfsi 0 p2p listen /x/p2p-test /ip4/127.0.0.1/tcp/10101 --report-peer-id 2>&1 > listener-stdouterr.log
'
test_expect_success
'C->S Spawn receiving server'
'
ma-pipe-unidir --listen --pidFile=listener.pid recv /ip4/127.0.0.1/tcp/10101 > server.out &
test_wait_for_file 30 100ms listener.pid &&
kill -0 $(cat listener.pid)
'
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
'
test_expect_success
'C->S Connect and receive data'
'
ma-pipe-unidir send /ip4/127.0.0.1/tcp/10102 < test1.bin
'
test_expect_success
'C->S Ensure server finished'
'
go-sleep 250ms &&
test ! -f listener.pid
'
test_expect_success
'C->S Output looks good'
'
echo ${PEERID_1} > expected &&
cat test1.bin >> expected &&
test_cmp server.out expected
'
test_expect_success
'C->S Close listeners'
'
ipfsi 1 p2p close -p /x/p2p-test &&
ipfsi 0 p2p close -p /x/p2p-test &&
ipfsi 0 p2p ls > actual &&
test_must_be_empty actual &&
ipfsi 1 p2p ls > actual &&
test_must_be_empty actual
'
test_expect_success
"non /x/ scoped protocols are not allowed"
'
test_must_fail ipfsi 0 p2p listen /its/not/a/x/path /ip4/127.0.0.1/tcp/10101 2> actual &&
echo "Error: protocol name must be within '
"'"
'/x/'
"'"
' namespace" > expected
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment