Created
November 12, 2014 07:20
-
-
Save chriscool/5790af7a8a55dc244356 to your computer and use it in GitHub Desktop.
Test for ipfs name resolution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Copyright (c) 2014 Jeromy Johnson | |
# MIT Licensed; see the LICENSE file in this repository. | |
# | |
test_description="test ipns name resolution" | |
. lib/test-lib.sh | |
test_expect_success "ipfs init succeeds" ' | |
export IPFS_DIR="$(pwd)/.go-ipfs" && | |
ipfs init -b 1024 | |
' | |
test_expect_success "'ipns name publish' succeeds" ' | |
HASH="QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o" && | |
echo $HASH > hash && | |
ipfs name publish $HASH > actual | |
' | |
test_expect_success "'ipns name publish' output looks good" ' | |
egrep "published name .* to $HASH" actual | |
' | |
test_expect_success "'ipns name resolve' succeeds" ' | |
HASH2=$(cut -d \ -f 3 actual) && | |
ipfs name resolve $HASH2 >published | |
' | |
test_expect_success "'ipns name resolve' output looks good" ' | |
test_cmp published hash | |
' | |
test_done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment