Skip to content

Commit

Permalink
add sharness tests
Browse files Browse the repository at this point in the history
test for `ipfs name publish` using PeerID as key name

License: MIT
Signed-off-by: Kerem Gocen <keremgocen@gmail.com>
  • Loading branch information
keremgocen committed May 3, 2017
1 parent 76e227d commit fca98ae
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/sharness/t0100-name.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,20 @@ test_expect_failure "publish with our explicit node ID looks good" '
test_cmp expected_node_id_publish actual_node_id_publish
'

# publish with an explicit node ID as key name

test_expect_success "generate and verify a new key" '
NEWID=`ipfs key gen --type=rsa --size=2048 keyname` &&
test_check_peerid "${NEWID}"
'

test_expect_success "'ipfs name publish --key=<peer-id> <hash>' succeeds" '
ipfs name publish --key=${NEWID} "/ipfs/$HASH_WELCOME_DOCS" >actual_node_id_publish
'

test_expect_success "publish an explicit node ID as key name looks good" '
echo "Published to ${NEWID}: /ipfs/$HASH_WELCOME_DOCS" >expected_node_id_publish &&
test_cmp expected_node_id_publish actual_node_id_publish
'

test_done

0 comments on commit fca98ae

Please sign in to comment.