2017-11-28 22:45:10 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
test_description="Test service state 'upgrade' from current version"
|
|
|
|
|
|
|
|
. lib/test-lib.sh
|
|
|
|
|
|
|
|
test_ipfs_init
|
|
|
|
test_cluster_init
|
|
|
|
|
|
|
|
test_expect_success IPFS,CLUSTER "cluster-service state upgrade works" '
|
|
|
|
cid=`docker exec ipfs sh -c "echo testing | ipfs add -q"` &&
|
|
|
|
ipfs-cluster-ctl pin add "$cid" &&
|
|
|
|
sleep 5 &&
|
|
|
|
cluster_kill &&
|
2017-12-05 03:46:52 +00:00
|
|
|
sleep 5 &&
|
|
|
|
ipfs-cluster-service --debug --config "test-config" state upgrade
|
2017-11-28 22:45:10 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
# previous test kills the cluster, we need to re-start
|
|
|
|
# if done inside the test, we lose debugging output
|
|
|
|
cluster_start
|
|
|
|
|
|
|
|
test_expect_success IPFS,CLUSTER "state is preserved after migration" '
|
|
|
|
cid=`docker exec ipfs sh -c "echo testing | ipfs add -q"` &&
|
|
|
|
ipfs-cluster-ctl pin ls "$cid" | grep -q "$cid" &&
|
|
|
|
ipfs-cluster-ctl status "$cid" | grep -q -i "PINNED"
|
|
|
|
'
|
|
|
|
|
2018-01-09 19:17:21 +00:00
|
|
|
test_clean_ipfs
|
|
|
|
test_clean_cluster
|
|
|
|
|
2017-11-28 22:45:10 +00:00
|
|
|
test_done
|