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
933b9733
Commit
933b9733
authored
Oct 30, 2015
by
Juan Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1912 from ipfs/t0220-bitswap-stat
t0220: add 'ipfs bitswap stat' tests
parents
d82ff148
3e57460c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
test/sharness/t0220-bitswap.sh
test/sharness/t0220-bitswap.sh
+56
-0
No files found.
test/sharness/t0220-bitswap.sh
View file @
933b9733
...
...
@@ -18,6 +18,37 @@ test_expect_success "'ipfs block get' adds hash to wantlist" '
grep $NONEXIST wantlist_out
'
test_expect_success
"'ipfs bitswap stat' succeeds"
'
ipfs bitswap stat >stat_out
'
test_expect_success
"'ipfs bitswap stat' output looks good"
'
cat >expected <<EOF &&
bitswap status
provides buffer: 0 / 256
blocks received: 0
dup blocks received: 0
dup data received: 0B
wantlist [1 keys]
$NONEXIST
partners [0]
EOF
test_cmp expected stat_out
'
test_expect_success
"ipfs peer id looks good"
'
PEERID=$(ipfs config Identity.PeerID) &&
test_check_peerid "$PEERID"
'
test_expect_success
"'ipfs bitswap wantlist -p' works"
'
ipfs bitswap wantlist -p "$PEERID" >wantlist_p_out
'
test_expect_failure
"'ipfs bitswap wantlist -p' output looks good"
'
test_cmp wantlist_out wantlist_p_out
'
test_expect_success
"'ipfs bitswap unwant' succeeds"
'
ipfs bitswap unwant $NONEXIST
'
...
...
@@ -27,6 +58,31 @@ test_expect_success "hash was removed from wantlist" '
test_must_be_empty wantlist_out
'
test_expect_success
"'ipfs bitswap stat' succeeds"
'
ipfs bitswap stat >stat_out
'
test_expect_success
"'ipfs bitswap stat' output looks good"
'
cat >expected <<EOF &&
bitswap status
provides buffer: 0 / 256
blocks received: 0
dup blocks received: 0
dup data received: 0B
wantlist [0 keys]
partners [0]
EOF
test_cmp expected stat_out
'
test_expect_success
"'ipfs bitswap wantlist -p' works"
'
ipfs bitswap wantlist -p "$PEERID" >wantlist_p_out
'
test_expect_success
"'ipfs bitswap wantlist -p' output looks good"
'
test_cmp wantlist_out wantlist_p_out
'
test_kill_ipfs_daemon
test_done
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