c-ipfs/test/scripts/test_1.sh

39 lines
664 B
Bash
Raw Normal View History

2017-09-27 10:52:53 +00:00
#!/bin/bash
2017-10-04 11:34:37 +00:00
####
# Attempt to retrieve binary file from running daemon
#
####
source ./test_helpers.sh
IPFS="../../main/ipfs --config /tmp/ipfs_1"
2017-09-27 10:52:53 +00:00
function pre {
2017-10-04 11:34:37 +00:00
rm -Rf /tmp/ipfs_1
eval "$IPFS" init;
check_failure "pre" $?
cp ../config.test1.wo_journal /tmp/ipfs_1/config
2017-09-27 10:52:53 +00:00
}
function post {
2017-10-04 11:34:37 +00:00
rm -Rf /tmp/ipfs_1;
# rm hello.bin;
2017-09-27 10:52:53 +00:00
}
function body {
2017-10-04 11:34:37 +00:00
create_binary_file;
eval "$IPFS" add hello.bin
check_failure "add hello.bin" $?
#start the daemon
eval "../../main/ipfs --config /tmp/ipfs_1 daemon &"
daemon_id=$!
sleep 5
eval "$IPFS" cat QmSsV5T26CnCk3Yt7gtf6Bgyqwe4UtiaLiPbe9uUyr1nHd > hello2.bin
check_failure "cat" $?
kill -9 $daemon_id
2017-09-27 10:52:53 +00:00
}