ipfs-cluster/sharness/t0052-service-state-export.sh
Hector Sanjuan 6188d6ff52 service: Make --consensus a mandatory flag
It has a few implications to launch a raft peer when you wanted to do crdt and vice-versa.

Same when exporting and exporting states.

Users starting cluster peers should be explicit about their consensus choice.

Also, if we ever want to make `crdt` the default, we can't do that before
making `raft` non-default first. I don't like to break things but otherwise
the experience for new users wanting to try crdts might be aweful.
2019-07-26 18:15:41 +02:00

24 lines
592 B
Bash
Executable File

#!/bin/bash
test_description="Test service state export"
. lib/test-lib.sh
test_ipfs_init
test_cluster_init
test_expect_success IPFS,CLUSTER,JQ "state export saves the correct state to expected file" '
cid=`docker exec ipfs sh -c "echo test_52 | ipfs add -q"` &&
ipfs-cluster-ctl pin add "$cid" &&
sleep 5 &&
cluster_kill && sleep 5 &&
ipfs-cluster-service --debug --config "test-config" state export --consensus crdt -f export.json &&
[ -f export.json ] &&
jq -r ".cid | .[\"/\"]" export.json | grep -q "$cid"
'
test_clean_ipfs
test_clean_cluster
test_done