提交 1c279b93 作者: Christian Couder

t0220: add 'ipfs bitswap stat' tests

License: MIT
Signed-off-by: 's avatarChristian Couder <chriscool@tuxfamily.org>
上级 6801d3f7
...@@ -18,6 +18,24 @@ test_expect_success "'ipfs block get' adds hash to wantlist" ' ...@@ -18,6 +18,24 @@ test_expect_success "'ipfs block get' adds hash to wantlist" '
grep $NONEXIST wantlist_out 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 bitswap unwant' succeeds" ' test_expect_success "'ipfs bitswap unwant' succeeds" '
ipfs bitswap unwant $NONEXIST ipfs bitswap unwant $NONEXIST
' '
...@@ -27,6 +45,23 @@ test_expect_success "hash was removed from wantlist" ' ...@@ -27,6 +45,23 @@ test_expect_success "hash was removed from wantlist" '
test_must_be_empty wantlist_out 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_kill_ipfs_daemon test_kill_ipfs_daemon
test_done test_done
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论