Issue #532 -f init
should clean up state
Fix sharness tests by using commands with local flags License: MIT Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
This commit is contained in:
parent
7fd42cff44
commit
f77bb9dbcc
|
@ -14,13 +14,13 @@ cluster_kill
|
|||
test_expect_success IPFS,CLUSTER "state import fails on incorrect format" '
|
||||
sleep 5 &&
|
||||
echo "not exactly json" > badImportFile &&
|
||||
test_expect_code 1 ipfs-cluster-service -f --config "test-config" state import badImportFile
|
||||
test_expect_code 1 ipfs-cluster-service --config "test-config" state import -f badImportFile
|
||||
'
|
||||
|
||||
test_expect_success IPFS,CLUSTER,IMPORTSTATE "state import succeeds on correct format" '
|
||||
sleep 5
|
||||
cid=`docker exec ipfs sh -c "echo test_53 | ipfs add -q"` &&
|
||||
ipfs-cluster-service -f --debug --config "test-config" state import importState &&
|
||||
ipfs-cluster-service --debug --config "test-config" state import -f importState &&
|
||||
cluster_start &&
|
||||
sleep 5 &&
|
||||
ipfs-cluster-ctl pin ls "$cid" | grep -q "$cid" &&
|
||||
|
|
|
@ -14,7 +14,7 @@ test_expect_success IPFS,CLUSTER "state cleanup refreshes state on restart" '
|
|||
ipfs-cluster-ctl status "$cid" | grep -q -i "PINNED" &&
|
||||
[ 1 -eq "$(ipfs-cluster-ctl --enc=json status | jq ". | length")" ] &&
|
||||
cluster_kill && sleep 5 &&
|
||||
ipfs-cluster-service -f --debug --config "test-config" state cleanup &&
|
||||
ipfs-cluster-service --debug --config "test-config" state cleanup -f &&
|
||||
cluster_start && sleep 5 &&
|
||||
[ 0 -eq "$(ipfs-cluster-ctl --enc=json status | jq ". | length")" ]
|
||||
'
|
||||
|
@ -25,8 +25,8 @@ test_expect_success IPFS,CLUSTER "export + cleanup + import == noop" '
|
|||
[ 1 -eq "$(ipfs-cluster-ctl --enc=json status | jq ". | length")" ] &&
|
||||
cluster_kill && sleep 5 &&
|
||||
ipfs-cluster-service --debug --config "test-config" state export -f import.json &&
|
||||
ipfs-cluster-service -f --debug --config "test-config" state cleanup &&
|
||||
ipfs-cluster-service -f --debug --config "test-config" state import import.json &&
|
||||
ipfs-cluster-service --debug --config "test-config" state cleanup -f &&
|
||||
ipfs-cluster-service --debug --config "test-config" state import -f import.json &&
|
||||
cluster_start && sleep 5 &&
|
||||
ipfs-cluster-ctl pin ls "$cid" | grep -q "$cid" &&
|
||||
ipfs-cluster-ctl status "$cid" | grep -q -i "PINNED" &&
|
||||
|
|
Loading…
Reference in New Issue
Block a user