-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I cannot test these-- i dont have docker in osx. I would spend more time but can't. Here's as far as i will get in the near future.
- Loading branch information
Showing
2 changed files
with
84 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh | ||
|
||
test_description="Migration to many different versions" | ||
|
||
. lib/test-lib.sh | ||
|
||
test_expect_success "start a docker container" ' | ||
DOCID=$(start_docker) | ||
' | ||
|
||
test_install_version "v0.4.5" | ||
|
||
test_expect_success "'ipfs init' succeeds" ' | ||
export IPFS_PATH=/root/.ipfs && | ||
exec_docker "$DOCID" "IPFS_PATH=$IPFS_PATH BITS=2048 ipfs init" >actual 2>&1 || | ||
test_fsh cat actual | ||
' | ||
|
||
test_expect_success ".ipfs/ has been created" ' | ||
exec_docker "$DOCID" "test -d /root/.ipfs && test -f /root/.ipfs/config" | ||
exec_docker "$DOCID" "test -d /root/.ipfs/datastore && test -d /root/.ipfs/blocks" | ||
' | ||
|
||
test_install_version "v0.4.0" | ||
test_repo_version "0.4.0" | ||
|
||
# ipfs-update should allow migrating back | ||
test_install_version "v0.3.10" | ||
test_repo_version "0.3.10" | ||
|
||
test_expect_success "stop docker container" ' | ||
stop_docker "$DOCID" | ||
' | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
|
||
test_description="Simple fs-repo-migrations backwards tests" | ||
|
||
. lib/test-lib.sh | ||
|
||
test_expect_success "start a docker container" ' | ||
DOCID=$(start_docker) | ||
' | ||
|
||
test_expect_success "fs-repo-migrations binary is on the container" ' | ||
exec_docker "$DOCID" "test -f $GUEST_FS_REPO_MIG" | ||
' | ||
|
||
test_install_version "v0.4.5" | ||
|
||
test_expect_success "'ipfs init' succeeds" ' | ||
exec_docker "$DOCID" "IPFS_PATH=/root/.ipfs BITS=2048 ipfs init" >actual 2>&1 || | ||
test_fsh cat actual | ||
' | ||
|
||
test_expect_success ".ipfs/ has been created" ' | ||
exec_docker "$DOCID" "test -d /root/.ipfs && test -f /root/.ipfs/config" | ||
exec_docker "$DOCID" "test -d /root/.ipfs/datastore && test -d /root/.ipfs/blocks" | ||
' | ||
|
||
test_expect_failure "'fs-repo-migrations -y' fails (no --revert-ok) flag" ' | ||
exec_docker "$DOCID" "$GUEST_FS_REPO_MIG -y -to=3" 2>actual | ||
' | ||
|
||
test_expect_success "'fs-repo-migrations -y' failure output looks good" ' | ||
grep "attempt to run backward migration" actual && | ||
grep "--revert-ok" actual | ||
' | ||
|
||
test_expect_success "'fs-repo-migrations -y --revert-ok' works" ' | ||
exec_docker "$DOCID" "$GUEST_FS_REPO_MIG -y -to=3 --revert-ok" >actual | ||
' | ||
|
||
test_expect_success "'fs-repo-migrations -y' output looks good" ' | ||
grep "Migration 5 to 4 succeeded" actual && | ||
grep "Migration 4 to 3 succeeded" actual | ||
' | ||
|
||
test_expect_success "stop docker container" ' | ||
stop_docker "$DOCID" | ||
' | ||
|
||
test_done |