2017-09-27 12:40:55 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
####
|
|
|
|
# Attempt to start a deamon and have an api client do a object get
|
|
|
|
#
|
|
|
|
####
|
|
|
|
|
|
|
|
source ./test_helpers.sh
|
|
|
|
|
|
|
|
IPFS="../../main/ipfs --config /tmp/ipfs_1"
|
|
|
|
|
|
|
|
function pre {
|
|
|
|
post
|
|
|
|
eval "$IPFS" init;
|
2017-10-05 16:20:12 +00:00
|
|
|
check_failure_with_exit "pre" $?
|
2017-09-27 12:40:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function post {
|
|
|
|
rm -Rf /tmp/ipfs_1;
|
|
|
|
rm hello.txt;
|
|
|
|
}
|
|
|
|
|
|
|
|
function body {
|
|
|
|
create_hello_world;
|
|
|
|
eval "$IPFS" add hello.txt
|
2017-10-05 16:20:12 +00:00
|
|
|
check_failure_with_exit "add hello.txt" $?
|
2017-09-27 12:40:55 +00:00
|
|
|
|
|
|
|
#start the daemon
|
|
|
|
eval "../../main/ipfs --config /tmp/ipfs_1 daemon &"
|
|
|
|
daemon_id=$!
|
|
|
|
sleep 5
|
|
|
|
|
|
|
|
eval "$IPFS" cat QmYAXgX8ARiriupMQsbGXtKdDyGzWry1YV3sycKw1qqmgH
|
2017-10-05 16:20:12 +00:00
|
|
|
check_failure_with_exit "cat hello.txt" $?
|
2017-09-27 12:40:55 +00:00
|
|
|
|
|
|
|
kill -9 $daemon_id
|
|
|
|
}
|
|
|
|
|
|
|
|
|