Skip to content

Commit

Permalink
add a failing test case for calling dht put with a bad key
Browse files Browse the repository at this point in the history
see #5113

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
  • Loading branch information
Stebalien committed Jun 14, 2018
1 parent 6c424bc commit aea0034
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/sharness/t0170-dht.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,15 @@ test_expect_success 'get with good keys' '
ipfsi 1 dht get "/ipns/$PEERID_2" | grep -aq "/ipfs/$HASH"
'

test_expect_failure 'put with bad keys (issue #4611)' '
test_expect_failure 'put with bad keys fails (issue #5113)' '
ipfsi 0 dht put "foo" "bar" >putted
ipfsi 0 dht put "/pk/foo" "bar" >>putted
ipfsi 0 dht put "/ipns/foo" "bar" >>putted
[ ! -s putted ] ||
test_fsh cat putted
'

test_expect_failure 'put with bad keys returns error (issue #4611)' '
! ipfsi 0 dht put "foo" "bar" &&
! ipfsi 0 dht put "/pk/foo" "bar" &&
! ipfsi 0 dht put "/ipns/foo" "bar"
Expand Down

0 comments on commit aea0034

Please sign in to comment.