commit
a4d8aac68c
|
@ -688,7 +688,7 @@ func (ipfs *Connector) post(path string) ([]byte, error) {
|
|||
|
||||
res, err := http.Post(url, "", nil)
|
||||
if err != nil {
|
||||
logger.Error("error getting:", err)
|
||||
logger.Error("error posting:", err)
|
||||
return nil, err
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
|
|
@ -32,7 +32,7 @@ test_ipfs_init() {
|
|||
else
|
||||
docker run --name ipfs -d -p 127.0.0.1:5001:5001 ipfs/go-ipfs > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error running go-ipfs in docker."
|
||||
echo "IPFS init FAIL: Error running go-ipfs in docker."
|
||||
exit 1
|
||||
fi
|
||||
while ! curl -s "localhost:5001/api/v0/version" > /dev/null; do
|
||||
|
@ -57,17 +57,17 @@ test_cluster_init() {
|
|||
|
||||
which ipfs-cluster-service >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ipfs-cluster-service not found"
|
||||
echo "cluster init FAIL: ipfs-cluster-service not found"
|
||||
exit 1
|
||||
fi
|
||||
which ipfs-cluster-ctl >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ipfs-cluster-ctl not found"
|
||||
echo "cluster init FAIL: ipfs-cluster-ctl not found"
|
||||
exit 1
|
||||
fi
|
||||
ipfs-cluster-service -f --config "test-config" init >"$IPFS_OUTPUT" 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "error initializing ipfs cluster"
|
||||
echo "cluster init FAIL: error on ipfs cluster init"
|
||||
exit 1
|
||||
fi
|
||||
rm -rf "test-config/ipfs-cluster-data"
|
||||
|
|
|
@ -4,9 +4,7 @@ test_description="Test service startup and init functionality"
|
|||
|
||||
. lib/test-lib.sh
|
||||
test_ipfs_init
|
||||
cleanup test_clean_ipfs
|
||||
test_cluster_init
|
||||
cleanup test_clean_cluster
|
||||
|
||||
test_expect_success "prerequisites" '
|
||||
test_have_prereq IPFS &&
|
||||
|
@ -31,4 +29,7 @@ test_expect_success "starting a second cluster-service process fails" '
|
|||
test_expect_code 1 ipfs-cluster-service --config "test-config"
|
||||
'
|
||||
|
||||
test_clean_ipfs
|
||||
test_clean_cluster
|
||||
|
||||
test_done
|
||||
|
|
|
@ -5,9 +5,7 @@ test_description="Test ctl's status reporting functionality. Test errors on inc
|
|||
. lib/test-lib.sh
|
||||
|
||||
test_ipfs_init
|
||||
cleanup test_clean_ipfs
|
||||
test_cluster_init
|
||||
cleanup test_clean_cluster
|
||||
|
||||
test_expect_success IPFS,CLUSTER,JQ "cluster-ctl can read id" '
|
||||
id=`cluster_id`
|
||||
|
@ -59,4 +57,7 @@ test_expect_success IPFS,CLUSTER "pin ls on invalid CID fails" '
|
|||
test_must_fail ipfs-cluster-ctl pin ls XXXinvalid-CIDXXX
|
||||
'
|
||||
|
||||
test_clean_ipfs
|
||||
test_clean_cluster
|
||||
|
||||
test_done
|
||||
|
|
|
@ -5,9 +5,7 @@ test_description="Test cluster-ctl's pinning and unpinning functionality"
|
|||
. lib/test-lib.sh
|
||||
|
||||
test_ipfs_init
|
||||
cleanup test_clean_ipfs
|
||||
test_cluster_init
|
||||
cleanup test_clean_cluster
|
||||
|
||||
test_expect_success IPFS,CLUSTER "pin data to cluster with ctl" '
|
||||
cid=`docker exec ipfs sh -c "echo test | ipfs add -q"`
|
||||
|
@ -23,4 +21,7 @@ test_expect_success IPFS,CLUSTER "unpin data from cluster with ctl" '
|
|||
ipfs-cluster-ctl status "$cid" | grep -q -i "UNPINNED"
|
||||
'
|
||||
|
||||
test_clean_ipfs
|
||||
test_clean_cluster
|
||||
|
||||
test_done
|
||||
|
|
|
@ -7,7 +7,6 @@ ssl_config="`pwd`/config/ssl"
|
|||
. lib/test-lib.sh
|
||||
|
||||
test_ipfs_init
|
||||
cleanup test_clean_ipfs
|
||||
|
||||
test_cluster_init "$ssl_config"
|
||||
cleanup test_clean_cluster
|
||||
|
@ -21,4 +20,6 @@ test_expect_success "ssl interaction succeeds" '
|
|||
ipfs-cluster-ctl --https --no-check-certificate id | egrep -q "$id"
|
||||
'
|
||||
|
||||
test_clean_ipfs
|
||||
|
||||
test_done
|
||||
|
|
|
@ -5,9 +5,7 @@ test_description="Test failure when server not using SSL but client requests it"
|
|||
. lib/test-lib.sh
|
||||
|
||||
test_ipfs_init
|
||||
cleanup test_clean_ipfs
|
||||
test_cluster_init
|
||||
cleanup test_clean_cluster
|
||||
|
||||
test_expect_success "prerequisites" '
|
||||
test_have_prereq IPFS && test_have_prereq CLUSTER
|
||||
|
@ -18,4 +16,7 @@ test_expect_success "ssl enforced by client" '
|
|||
test_must_fail ipfs-cluster-ctl --https --no-check-certificate id
|
||||
'
|
||||
|
||||
test_clean_ipfs
|
||||
test_clean_cluster
|
||||
|
||||
test_done
|
||||
|
|
|
@ -7,9 +7,7 @@ config="`pwd`/config/basic_auth"
|
|||
. lib/test-lib.sh
|
||||
|
||||
test_ipfs_init
|
||||
cleanup test_clean_ipfs
|
||||
test_cluster_init "$config"
|
||||
cleanup test_clean_cluster
|
||||
|
||||
test_expect_success "prerequisites" '
|
||||
test_have_prereq IPFS && test_have_prereq CLUSTER
|
||||
|
@ -41,4 +39,7 @@ test_expect_success "BasicAuth succeeds with env var credentials" '
|
|||
ipfs-cluster-ctl --force-http id | egrep -q "$id"
|
||||
'
|
||||
|
||||
test_clean_ipfs
|
||||
test_clean_cluster
|
||||
|
||||
test_done
|
||||
|
|
|
@ -7,9 +7,7 @@ config="`pwd`/config/ssl-basic_auth"
|
|||
. lib/test-lib.sh
|
||||
|
||||
test_ipfs_init
|
||||
cleanup test_clean_ipfs
|
||||
test_cluster_init "$config"
|
||||
cleanup test_clean_cluster
|
||||
|
||||
test_expect_success "prerequisites" '
|
||||
test_have_prereq IPFS && test_have_prereq CLUSTER
|
||||
|
@ -26,4 +24,7 @@ test_expect_success "ssl interaction succeeds" '
|
|||
ipfs-cluster-ctl --no-check-certificate --basic-auth "testuser:testpass" id | egrep -q "$id"
|
||||
'
|
||||
|
||||
test_clean_ipfs
|
||||
test_clean_cluster
|
||||
|
||||
test_done
|
||||
|
|
|
@ -5,9 +5,7 @@ test_description="Test service state 'upgrade' from current version"
|
|||
. lib/test-lib.sh
|
||||
|
||||
test_ipfs_init
|
||||
cleanup test_clean_ipfs
|
||||
test_cluster_init
|
||||
cleanup test_clean_cluster
|
||||
|
||||
test_expect_success IPFS,CLUSTER "cluster-service state upgrade works" '
|
||||
cid=`docker exec ipfs sh -c "echo testing | ipfs add -q"` &&
|
||||
|
@ -28,4 +26,7 @@ test_expect_success IPFS,CLUSTER "state is preserved after migration" '
|
|||
ipfs-cluster-ctl status "$cid" | grep -q -i "PINNED"
|
||||
'
|
||||
|
||||
test_clean_ipfs
|
||||
test_clean_cluster
|
||||
|
||||
test_done
|
||||
|
|
|
@ -5,10 +5,8 @@ test_description="Test service state upgrade v1 -> v2 and v2 -> v2"
|
|||
. lib/test-lib.sh
|
||||
|
||||
test_ipfs_init
|
||||
cleanup test_clean_ipfs
|
||||
test_cluster_init
|
||||
test_confirm_v1State
|
||||
cleanup test_clean_cluster
|
||||
|
||||
# Make a pin and shutdown to force a snapshot. Modify snapshot files to specify
|
||||
# a snapshot of v1 state pinning "test" (it's easier than taking a new one each
|
||||
|
@ -30,4 +28,8 @@ test_expect_success IPFS,CLUSTER,V1STATE,JQ "cluster-service loads v1 state corr
|
|||
ipfs-cluster-ctl status "$cid" | grep -q -i "PINNED"
|
||||
'
|
||||
|
||||
test_clean_ipfs
|
||||
test_clean_cluster
|
||||
|
||||
|
||||
test_done
|
||||
|
|
|
@ -5,9 +5,7 @@ test_description="Test service state export"
|
|||
. lib/test-lib.sh
|
||||
|
||||
test_ipfs_init
|
||||
cleanup test_clean_ipfs
|
||||
test_cluster_init
|
||||
cleanup test_clean_cluster
|
||||
|
||||
|
||||
test_expect_success IPFS,CLUSTER "state export fails without snapshots" '
|
||||
|
@ -28,4 +26,7 @@ test_expect_success IPFS,CLUSTER,JQ "state export saves the correct state to exp
|
|||
jq ".[].cid" export.json | grep -q "$cid"
|
||||
'
|
||||
|
||||
test_clean_ipfs
|
||||
test_clean_cluster
|
||||
|
||||
test_done
|
||||
|
|
|
@ -5,9 +5,7 @@ test_description="Test service state import"
|
|||
. lib/test-lib.sh
|
||||
|
||||
test_ipfs_init
|
||||
cleanup test_clean_ipfs
|
||||
test_cluster_init
|
||||
cleanup test_clean_cluster
|
||||
test_confirm_importState
|
||||
|
||||
# Kill cluster daemon but keep data folder
|
||||
|
@ -28,4 +26,7 @@ test_expect_success IPFS,CLUSTER,IMPORTSTATE "state import succeeds on correct f
|
|||
ipfs-cluster-ctl status "$cid" | grep -q -i "PINNED"
|
||||
'
|
||||
|
||||
test_clean_ipfs
|
||||
test_clean_cluster
|
||||
|
||||
test_done
|
||||
|
|
|
@ -5,9 +5,7 @@ test_description="Test service state import"
|
|||
. lib/test-lib.sh
|
||||
|
||||
test_ipfs_init
|
||||
cleanup test_clean_ipfs
|
||||
test_cluster_init
|
||||
cleanup test_clean_cluster
|
||||
|
||||
test_expect_success IPFS,CLUSTER "state cleanup refreshes state on restart" '
|
||||
cid=`docker exec ipfs sh -c "echo test_54 | ipfs add -q"` &&
|
||||
|
@ -35,4 +33,7 @@ test_expect_success IPFS,CLUSTER "export + cleanup + import == noop" '
|
|||
[ 1 -eq "$(ipfs-cluster-ctl --enc=json status | jq ". | length")" ]
|
||||
'
|
||||
|
||||
test_clean_ipfs
|
||||
test_clean_cluster
|
||||
|
||||
test_done
|
||||
|
|
Loading…
Reference in New Issue
Block a user