-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add iptb sharness test for multi-ipns name resolution
- Loading branch information
1 parent
c308b6b
commit 9bfd329
Showing
4 changed files
with
103 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
42 changes: 28 additions & 14 deletions
42
Godeps/_workspace/src/github.com/whyrusleeping/iptb/README.md
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
31 changes: 29 additions & 2 deletions
31
Godeps/_workspace/src/github.com/whyrusleeping/iptb/main.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright (c) 2014 Jeromy Johnson | ||
# MIT Licensed; see the LICENSE file in this repository. | ||
# | ||
|
||
test_description="Test ipfs repo operations" | ||
|
||
. lib/test-lib.sh | ||
|
||
export IPTB_ROOT="`pwd`/.iptb" | ||
|
||
test_expect_success "set up an iptb cluster" ' | ||
iptb -n=4 init && | ||
iptb -wait start | ||
' | ||
|
||
test_expect_success "add an obect on one node" ' | ||
export IPFS_PATH="$IPTB_ROOT/1" | ||
echo "ipns is super fun" > file && | ||
HASH_FILE=`ipfs add -q file` | ||
' | ||
|
||
test_expect_success "publish that object as an ipns entry" ' | ||
ipfs name publish $HASH_FILE | ||
' | ||
|
||
test_expect_success "add an entry on another node pointing to that one" ' | ||
export IPFS_PATH="$IPTB_ROOT/2" | ||
NODE1_ID=`iptb get id 1` && | ||
ipfs name publish /ipns/$NODE1_ID | ||
' | ||
|
||
test_expect_success "cat that entry on a third node" ' | ||
export IPFS_PATH="$IPTB_ROOT/3" | ||
NODE2_ID=`iptb get id 2` && | ||
ipfs cat /ipns/$NODE2_ID > output | ||
' | ||
|
||
test_expect_success "ensure output was the same" ' | ||
test_cmp file output | ||
' | ||
|
||
|
||
test_done |