Skip to content

Commit

Permalink
build ipfs command from specific commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Nov 6, 2020
1 parent 9cbaa32 commit 1e2c7dd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
1 change: 1 addition & 0 deletions sharness/lib/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ GUEST_IPFS_0_TO_1="sharness/bin/ipfs-0-to-1"
GUEST_IPFS_1_TO_2="sharness/bin/ipfs-1-to-2"
GUEST_IPFS_2_TO_3="sharness/bin/ipfs-2-to-3"
GUEST_IPFS_3_TO_4="sharness/bin/ipfs-3-to-4"
GUEST_IPFS_10_TO_11="sharness/bin/ipfs-10-to-11"

GUEST_RANDOM_FILES="sharness/bin/random-files"

Expand Down
31 changes: 25 additions & 6 deletions sharness/t0140-migration-10-to-11.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,29 @@ test_expect_success "'fs-repo-migrations -y' output looks good" '
grep "Migration 10 to 11 succeeded" actual ||
test_fsh cat actual
'

test_install_version "v0.8.0"
#
# Cannot GC here until new ipfs installed (old ipfs cannot read new pins)
#

#test_install_version "v0.8.0"
# TODO: Replace this with comment above when IPFS v0.8.0 released.
test_expect_success "install ipfs v0.8.0-dev succeeds" '
mkdir xxx &&
cd xxx &&
go mod init github.com/ipfs/xxx &&
go get github.com/ipfs/go-ipfs/cmd/ipfs@5cd3ef966d5102e64100fbb8db621d407bafa765 &&
cd .. &&
docker cp "$GOPATH"/bin/ipfs "$DOCID":/usr/local/bin &&
exec_docker "$DOCID" "echo 10 > /root/.ipfs/version"
'

test_expect_success "added dir is still pinned recursively" '
exec_docker "$DOCID" "ipfs pin ls --type=recursive" > recurse_actual2 &&
grep "$HASH_DIR1" recurse_actual2 ||
test_fsh cat recurse_actual2
'

test_expect_success "list of pinned object hasn't changed" '
test_expect_success "list of pinned objects has not changed" '
exec_docker "$DOCID" "ipfs pin ls --type=all" > all_actual2 &&
test_sort_cmp all_actual1 all_actual2
'
Expand All @@ -117,7 +130,7 @@ test_expect_success "objects are still there" '
exec_docker "$DOCID" "ipfs ls $HASH_DIR1" >DIR1_b
'

test_expect_success "objects haven't changed" '
test_expect_success "objects have not changed" '
test_cmp FILE6_a FILE6_b &&
test_cmp FILE5_a FILE5_b &&
test_cmp FILE4_a FILE4_b &&
Expand All @@ -131,15 +144,21 @@ test_expect_success "objects haven't changed" '
'

test_expect_success "'ipfs repo gc' succeeds" '
exec_docker "$DOCID" "ipfs repo gc"
exec_docker "$DOCID" "ipfs pin ls --type=all" | sort > before_gc &&
exec_docker "$DOCID" "ipfs repo gc" &&
exec_docker "$DOCID" "ipfs pin ls --type=all" | sort > after_gc &&
test_cmp before_gc after_gc
'

# TODO: remove this when IPFS v0.8.0 released
exec_docker "$DOCID" "echo 11 > /root/.ipfs/version"

test_expect_success "'ipfs-10-to-11 -revert' succeeds" '
exec_docker "$DOCID" "$GUEST_IPFS_10_TO_11 -verbose -revert -path=/root/.ipfs" >actual
'

test_expect_success "'ipfs-10-to-11 -revert' output looks good" '
grep "writing keys:" actual ||
grep "exported 3 pins from datastore to dag storage" actual ||
test_fsh cat actual
'

Expand Down

0 comments on commit 1e2c7dd

Please sign in to comment.