Sharness fixes

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
This commit is contained in:
Hector Sanjuan 2019-02-27 21:54:09 +00:00
parent 229c4d148c
commit 8374ece8a8
4 changed files with 6 additions and 5 deletions

View File

@ -16,6 +16,7 @@ func (c *Cluster) ConnectGraph() (api.ConnectGraph, error) {
defer span.End() defer span.End()
cg := api.ConnectGraph{ cg := api.ConnectGraph{
ClusterID: c.host.ID(),
IPFSLinks: make(map[string][]peer.ID), IPFSLinks: make(map[string][]peer.ID),
ClusterLinks: make(map[string][]peer.ID), ClusterLinks: make(map[string][]peer.ID),
ClustertoIPFS: make(map[string]peer.ID), ClustertoIPFS: make(map[string]peer.ID),

View File

@ -15,7 +15,7 @@ test_expect_success IPFS,CLUSTER "pin data to cluster with ctl" '
' '
test_expect_success IPFS,CLUSTER "unpin data from cluster with ctl" ' test_expect_success IPFS,CLUSTER "unpin data from cluster with ctl" '
cid=`ipfs-cluster-ctl --enc=json pin ls | jq -r ".[] | .cid" | head -1` cid=`ipfs-cluster-ctl --enc=json pin ls | jq -r ".[] | .cid | .[\"/\"]" | head -1`
ipfs-cluster-ctl pin rm "$cid" && ipfs-cluster-ctl pin rm "$cid" &&
!(ipfs-cluster-ctl pin ls "$cid" | grep -q "$cid") && !(ipfs-cluster-ctl pin ls "$cid" | grep -q "$cid") &&
ipfs-cluster-ctl status "$cid" | grep -q -i "UNPINNED" ipfs-cluster-ctl status "$cid" | grep -q -i "UNPINNED"
@ -29,7 +29,7 @@ test_expect_success IPFS,CLUSTER "wait for data to pin to cluster with ctl" '
' '
test_expect_success IPFS,CLUSTER "wait for data to unpin from cluster with ctl" ' test_expect_success IPFS,CLUSTER "wait for data to unpin from cluster with ctl" '
cid=`ipfs-cluster-ctl --enc=json pin ls | jq -r ".[] | .cid" | head -1` cid=`ipfs-cluster-ctl --enc=json pin ls | jq -r ".[] | .cid | .[\"/\"]" | head -1`
ipfs-cluster-ctl pin rm --wait "$cid" | grep -q -i "UNPINNED" && ipfs-cluster-ctl pin rm --wait "$cid" | grep -q -i "UNPINNED" &&
!(ipfs-cluster-ctl pin ls "$cid" | grep -q "$cid") && !(ipfs-cluster-ctl pin ls "$cid" | grep -q "$cid") &&
ipfs-cluster-ctl status "$cid" | grep -q -i "UNPINNED" ipfs-cluster-ctl status "$cid" | grep -q -i "UNPINNED"
@ -43,7 +43,7 @@ test_expect_success IPFS,CLUSTER "wait for data to pin to cluster with ctl with
' '
test_expect_success IPFS,CLUSTER "wait for data to unpin from cluster with ctl with timeout" ' test_expect_success IPFS,CLUSTER "wait for data to unpin from cluster with ctl with timeout" '
cid=`ipfs-cluster-ctl --enc=json pin ls | jq -r ".[] | .cid" | head -1` cid=`ipfs-cluster-ctl --enc=json pin ls | jq -r ".[] | .cid | .[\"/\"]" | head -1`
ipfs-cluster-ctl pin rm --wait --wait-timeout 2s "$cid" | grep -q -i "UNPINNED" && ipfs-cluster-ctl pin rm --wait --wait-timeout 2s "$cid" | grep -q -i "UNPINNED" &&
!(ipfs-cluster-ctl pin ls "$cid" | grep -q "$cid") && !(ipfs-cluster-ctl pin ls "$cid" | grep -q "$cid") &&
ipfs-cluster-ctl status "$cid" | grep -q -i "UNPINNED" ipfs-cluster-ctl status "$cid" | grep -q -i "UNPINNED"

View File

@ -24,7 +24,7 @@ test_expect_success IPFS,CLUSTER,JQ "state export saves the correct state to exp
cluster_kill && sleep 5 && cluster_kill && sleep 5 &&
ipfs-cluster-service --debug --config "test-config" state export -f export.json && ipfs-cluster-service --debug --config "test-config" state export -f export.json &&
[ -f export.json ] && [ -f export.json ] &&
jq ".[].cid" export.json | grep -q "$cid" jq -r ".[] | .cid | .[\"/\"]" export.json | grep -q "$cid"
' '
test_clean_ipfs test_clean_ipfs

View File

@ -1,6 +1,6 @@
[ [
{ {
"cid": "QmbrCtydGyPeHiLURSPMqrvE5mCgMCwFYq3UD4XLCeAYw6", "cid": { "/": "QmbrCtydGyPeHiLURSPMqrvE5mCgMCwFYq3UD4XLCeAYw6"},
"name": "", "name": "",
"allocations": [], "allocations": [],
"replication_factor_min": -1, "replication_factor_min": -1,