c-ipfs/test/scripts/test_6.sh

41 lines
701 B
Bash
Raw Permalink Normal View History

2017-09-28 18:21:34 +00:00
#!/bin/bash
####
# Attempt to start a deamon and have an api client do a name publish
#
####
source ./test_helpers.sh
IPFS="../../main/ipfs --config /tmp/ipfs_1"
function pre {
post
eval "$IPFS" init;
check_failure_with_exit "pre" $?
2017-09-28 18:21:34 +00:00
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_with_exit "add hello.txt" $?
2017-09-28 18:21:34 +00:00
#start the daemon
eval "../../main/ipfs --config /tmp/ipfs_1 daemon &"
daemon_id=$!
sleep 5
eval "$IPFS" name publish QmYAXgX8ARiriupMQsbGXtKdDyGzWry1YV3sycKw1qqmgH
check_failure_with_exit "name publish" $?
2017-09-28 18:21:34 +00:00
kill -9 $daemon_id
}