Pin tests fixed, cleanup issue resolved. Build tweaking remaining

This commit is contained in:
Wyatt 2017-04-20 11:55:54 -07:00 committed by Wyatt
parent bf228d9f4c
commit 65eaaa83c2
3 changed files with 18 additions and 43 deletions

View File

@ -11,20 +11,15 @@ test_expect_success "ipfs is installed on this machine" '
egrep -i "^Usage" ipfs_help.txt >/dev/null
'
# For now launching ipfs daemon externally, later will
# get this working automatically through tests
test_expect_success "launch ipfs daemon" '
mkdir -p ../.test_ipfs &&
[ -d ../.test_ipfs ] &&
IPFS_PATH="../.test_ipfs" eval ''ipfs init'' &&
IPFS_PATH="../.test_ipfs" eval ''ipfs daemon & echo $! >../dPID.txt'' &&
sleep 3
mkdir -p ../.test_ipfs &&
IPFS_PATH="../.test_ipfs" eval '"'"'ipfs init'"'"' &&
IPFS_PATH="../.test_ipfs" eval '"'"'ipfs daemon & echo $! >../dPID.txt'"'"' &&
sleep 3
'
test_expect_success "test config folder exists" '
mkdir -p ../.test_config &&
[ -d ../.test_config ]
mkdir -p ../.test_config
'
test_expect_success "init cluster-service" '
@ -41,20 +36,4 @@ test_expect_success "run cluster-service" '
rm service_start.txt
'
#test_expect_success "ipfs daemon launch and tear down" '
# ipfs daemon >daemon_out.txt 2>daemon_err &
# IPFS_PID=$!
# sleep 2 &&
# if ! kill -0 $IPFS_PID; then cat daemon_err; return 1; fi
#'
#test_expect_success "ipfs daemon launced successfully" '
# return 1 &&
# ipfs daemon >daemon_out.txt 2>daemon_err &
# sleep 5 &&
# egrep -i "Initializing daemon" daemon_out.txt >/dev/null &&
# egrep -i "API server listening" daemon_out.txt >/dev/null &&
# egrep -i "Daemon is ready" daemon_out.txt > /dev/null
#'
test_done

View File

@ -5,18 +5,19 @@ test_description="Test cluster-ctl's pinning and unpinning functionality"
test_expect_success "pin data to cluster with ctl" '
IPFS_PATH="../.test_ipfs" eval ''ipfs add ../lib/sharness/sharness.sh >add_output.txt'' &&
IPFS_PATH="../.test_ipfs" eval '"'"'ipfs add ../lib/sharness/sharness.sh >add_output.txt'"'"' &&
grep "added" add_output.txt &&
awk "{print$2}" add_output.txt > CID.txt &&
ipfs-cluster-ctl pin add $(< CID.txt) >pin_output.txt &&
grep " PINNING" pin_output.txt >/dev/null &&
awk '"'"'{print $2}'"'"' add_output.txt > CID.txt &&
ipfs-cluster-ctl pin add $(< CID.txt) >pin_output.txt
grep " PINNED" pin_output.txt >/dev/null &&
rm add_output.txt pin_output.txt
'
test_expect_success "unpin data from cluster with ctl" '
IPFS_PATH="../.test_ipfs" eval ''ipfs-cluster-ctl pin rm $(< CID.txt) >unpin_output.txt'' &&
grep "UNPINNING" unpin_output.txt >/dev/null &&
IPFS_PATH="../.test_ipfs" eval '"'"'ipfs-cluster-ctl pin rm $(< CID.txt) >unpin_output.txt'"'"' &&
grep "UNPINNED" unpin_output.txt >/dev/null &&
rm unpin_output.txt CID.txt
'
test_done

View File

@ -7,24 +7,19 @@ test_description="Cleanup state from tests (kill ipfs daemon)"
. lib/test-lib.sh
#test_expect_success "Kill ipfs daemon" '
# ps | grep "ipfs daemon" | grep -v "grep" > daemon_ps.txt &&
# sed -i '''' ''s/^ *//'' daemon_ps.txt &&
# awk ''{print$1}'' daemon_ps.txt > daemon_pid.txt &&
# kill -9 $(< daemon_pid.txt)
#'
test_expect_success "Kill cluster-service " '
kill -1 $(< ../sPID.txt)
kill -1 $(< ../sPID.txt) &&
rm ../sPID.txt
'
test_expect_success "Kill ipfs dameon " '
kill -1 $(< ../dPID.txt)
kill -1 $(< ../dPID.txt) &&
rm ../dPID.txt
'
test_expect_success "Remove config directories" '
rm -rf ../test_ipfs &&
rm -rf ../test_config
rm -rf ../.test_ipfs &&
rm -rf ../.test_config
'