-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
203 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#! /bin/sh | ||
|
||
test_description="Test service migration v1 -> v2 and v2 -> v2" | ||
|
||
. lib/test-lib.sh | ||
|
||
test_ipfs_init | ||
cleanup test_clean_ipfs | ||
test_cluster_init | ||
test_create_v1State | ||
cleanup test_clean_cluster | ||
|
||
test_expect_success IPFS,CLUSTER "cluster-service state preserved by migration" ' | ||
cid=`docker exec ipfs sh -c "echo test | ipfs add -q"` | ||
ipfs-cluster-ctl pin add "$cid" &> test4 && sleep 2 && | ||
kill -1 CLUSTER_D_PID && sleep 2 && | ||
backup-file=$( ls test-config/backups/ | head -n 1) | ||
ipfs-cluster-service migration "test-config/backups/"$(backup-file) "test-config/ipfs-cluster-data" | ||
ipfs-cluster-service --config "test-config" >"$IPFS_OUTPUT" 2>&1 & | ||
ipfs-cluster-ctl pin ls "$cid" | grep -q "$cid" && | ||
ipfs-cluster-ctl status "$cid" | grep -q -i "PINNED" | ||
' | ||
|
||
test_expect_success IPFS,CLUSTER,V1STATE "cluster-service loads v1 state correctly" ' | ||
cid=`docker exec ipfs sh -c "echo test | ipfs add -q"` | ||
kill -1 CLUSTER_D_PID && | ||
ipfs-cluster-service migration "test-config/v1State" "test-config/ipfs-cluster-data" | ||
ipfs-cluster-service --config "test-config" >"$IPFS_OUTPUT" 2>&1 & | ||
ipfs-cluster-ctl pin ls "$cid" | grep -q "$cid" && | ||
ipfs-cluster-ctl status "$cid" | grep -q -i "PINNED" | ||
' | ||
|
||
test_done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters