@cryptotaxi247 / kubo / commits / 1c279b936

t0220: add 'ipfs bitswap stat' tests

License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>

Christian Couder committed Oct 29, 2015 at 14:35 UTC 1c279b936e8f825afa85889cf6a752185e8075e1
1 file changed +35
test/sharness/t0220-bitswap.sh
+35
@@ -18,6 +18,24 @@ test_expect_success "'ipfs block get' adds hash to wantlist" '
18 grep $NONEXIST wantlist_out
19 '
20
21 +test_expect_success "'ipfs bitswap stat' succeeds" '
22 + ipfs bitswap stat >stat_out
23 +'
24 +
25 +test_expect_success "'ipfs bitswap stat' output looks good" '
26 + cat >expected <<EOF &&
27 +bitswap status
28 + provides buffer: 0 / 256
29 + blocks received: 0
30 + dup blocks received: 0
31 + dup data received: 0B
32 + wantlist [1 keys]
33 + $NONEXIST
34 + partners [0]
35 +EOF
36 + test_cmp expected stat_out
37 +'
38 +
39 test_expect_success "'ipfs bitswap unwant' succeeds" '
40 ipfs bitswap unwant $NONEXIST
41 '
@@ -27,6 +45,23 @@ test_expect_success "hash was removed from wantlist" '
45 test_must_be_empty wantlist_out
46 '
47
48 +test_expect_success "'ipfs bitswap stat' succeeds" '
49 + ipfs bitswap stat >stat_out
50 +'
51 +
52 +test_expect_success "'ipfs bitswap stat' output looks good" '
53 + cat >expected <<EOF &&
54 +bitswap status
55 + provides buffer: 0 / 256
56 + blocks received: 0
57 + dup blocks received: 0
58 + dup data received: 0B
59 + wantlist [0 keys]
60 + partners [0]
61 +EOF
62 + test_cmp expected stat_out
63 +'
64 +
65 test_kill_ipfs_daemon
66
67 test_done