Added test for name publish and name resolve
This commit is contained in:
parent
3418ee5435
commit
f0a53f2753
2 changed files with 45 additions and 1 deletions
|
@ -2,4 +2,5 @@
|
||||||
|
|
||||||
./run_test.sh test_1.sh
|
./run_test.sh test_1.sh
|
||||||
./run_test.sh test_2.sh
|
./run_test.sh test_2.sh
|
||||||
|
./run_test.sh test_3.sh
|
||||||
|
./run_test.sh test_4.sh
|
||||||
|
|
43
test/scripts/test_4.sh
Executable file
43
test/scripts/test_4.sh
Executable file
|
@ -0,0 +1,43 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
####
|
||||||
|
# Attempt to start a deamon and have an api client do a name resolve
|
||||||
|
#
|
||||||
|
####
|
||||||
|
|
||||||
|
source ./test_helpers.sh
|
||||||
|
|
||||||
|
IPFS="../../main/ipfs --config /tmp/ipfs_1"
|
||||||
|
|
||||||
|
function pre {
|
||||||
|
post
|
||||||
|
eval "$IPFS" init;
|
||||||
|
check_failure "pre" $?
|
||||||
|
cp ../config.test1.wo_journal /tmp/ipfs_1/config
|
||||||
|
}
|
||||||
|
|
||||||
|
function post {
|
||||||
|
rm -Rf /tmp/ipfs_1;
|
||||||
|
rm hello.txt;
|
||||||
|
}
|
||||||
|
|
||||||
|
function body {
|
||||||
|
create_hello_world;
|
||||||
|
eval "$IPFS" add hello.txt
|
||||||
|
check_failure "add hello.txt" $?
|
||||||
|
|
||||||
|
#start the daemon
|
||||||
|
eval "../../main/ipfs --config /tmp/ipfs_1 daemon &"
|
||||||
|
daemon_id=$!
|
||||||
|
sleep 5
|
||||||
|
|
||||||
|
eval "$IPFS" name publish QmYAXgX8ARiriupMQsbGXtKdDyGzWry1YV3sycKw1qqmgH
|
||||||
|
check_failure "name publish" $?
|
||||||
|
|
||||||
|
eval "$IPFS" name resolve /ipns/QmZVoAZGFfinB7MQQiDzB84kWaDPQ95GLuXdemJFM2r9b4
|
||||||
|
check_failure "name resolve" $?
|
||||||
|
|
||||||
|
kill -9 $daemon_id
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue