Commit 62240f34 authored by Steven Allen's avatar Steven Allen

sharness: verify that we return an error when we can't lookup a peer in ping

License: MIT
Signed-off-by: default avatarSteven Allen <steven@stebalien.com>
parent b8f53556
......@@ -6,6 +6,8 @@ test_description="Test ping command"
test_init_ipfs
BAD_PEER="QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJx"
# start iptb + wait for peering
test_expect_success 'init iptb' '
iptb init -n 2 --bootstrap=none --port=0
......@@ -23,6 +25,13 @@ test_expect_success "test ping other" '
ipfsi 1 ping -n2 -- "$PEERID_0"
'
test_expect_success "test ping unreachable peer" '
printf "Looking up peer %s\n" "$BAD_PEER" > bad_ping_exp &&
printf "Peer lookup error: routing: not found\n" >> bad_ping_exp &&
ipfsi 0 ping -n2 -- "$BAD_PEER" > bad_ping_actual &&
test_cmp bad_ping_exp bad_ping_actual
'
test_expect_success "test ping self" '
! ipfsi 0 ping -n2 -- "$PEERID_0" &&
! ipfsi 1 ping -n2 -- "$PEERID_1"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment