diff --git a/test/Makefile b/test/Makefile index f35aeb3eb..52f18d210 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,8 +1,9 @@ -BINS = bin/random bin/ipfs +BINS = bin/random bin/multihash bin/ipfs IPFS_ROOT = ../ IPFS_CMD = ../cmd/ipfs RANDOM_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-random +MULTIHASH_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-multihash all: deps @@ -16,6 +17,9 @@ bins: $(BINS) bin/random: $(RANDOM_SRC)/**/*.go go build -o bin/random $(RANDOM_SRC)/random +bin/multihash: $(MULTIHASH_SRC)/**/*.go + go build -o bin/multihash $(MULTIHASH_SRC)/multihash + bin/ipfs: $(IPFS_ROOT)/**/*.go go build -o bin/ipfs $(IPFS_CMD) diff --git a/test/sharness/Makefile b/test/sharness/Makefile index 665484757..392826632 100644 --- a/test/sharness/Makefile +++ b/test/sharness/Makefile @@ -7,7 +7,7 @@ # NOTE: run with TEST_VERBOSE=1 for verbose sharness tests. T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)) -BINS = bin/random bin/ipfs +BINS = bin/random bin/multihash bin/ipfs SHARNESS = lib/sharness/sharness.sh IPFS_ROOT = ../.. diff --git a/test/sharness/t0040-add-and-cat.sh b/test/sharness/t0040-add-and-cat.sh index 5f7e99118..a6e8efb6a 100755 --- a/test/sharness/t0040-add-and-cat.sh +++ b/test/sharness/t0040-add-and-cat.sh @@ -93,8 +93,8 @@ test_expect_success "generate 5MB file using go-random" ' ' test_expect_success "sha1 of the file looks ok" ' - echo "5620fb92eb5a49c9986b5c6844efda37e471660e mountdir/bigfile" >sha1_expected && - shasum mountdir/bigfile >sha1_actual && + echo "11145620fb92eb5a49c9986b5c6844efda37e471660e" >sha1_expected && + multihash -a=sha1 -e=hex mountdir/bigfile >sha1_actual && test_cmp sha1_expected sha1_actual ' @@ -128,8 +128,8 @@ test_expect_success EXPENSIVE "generate 100MB file using go-random" ' ' test_expect_success EXPENSIVE "sha1 of the file looks ok" ' - echo "885b197b01e0f7ff584458dc236cb9477d2e736d mountdir/bigfile" >sha1_expected && - shasum mountdir/bigfile >sha1_actual && + echo "1114885b197b01e0f7ff584458dc236cb9477d2e736d" >sha1_expected && + multihash -a=sha1 -e=hex mountdir/bigfile >sha1_actual && test_cmp sha1_expected sha1_actual ' @@ -144,7 +144,7 @@ test_expect_success EXPENSIVE "ipfs add bigfile output looks good" ' ' test_expect_success EXPENSIVE "ipfs cat succeeds" ' - ipfs cat $HASH | shasum >sha1_actual + ipfs cat $HASH | multihash -a=sha1 -e=hex >sha1_actual ' test_expect_success EXPENSIVE "ipfs cat output looks good" ' @@ -152,13 +152,13 @@ test_expect_success EXPENSIVE "ipfs cat output looks good" ' test_cmp mountdir/bigfile actual ' -test_expect_success EXPENSIVE "ipfs cat output shasum looks good" ' - echo "885b197b01e0f7ff584458dc236cb9477d2e736d -" >sha1_expected && +test_expect_success EXPENSIVE "ipfs cat output hashed looks good" ' + echo "1114885b197b01e0f7ff584458dc236cb9477d2e736d" >sha1_expected && test_cmp sha1_expected sha1_actual ' test_expect_success FUSE,EXPENSIVE "cat ipfs/bigfile succeeds" ' - cat ipfs/$HASH | shasum >sha1_actual + cat ipfs/$HASH | multihash -a=sha1 -e=hex >sha1_actual ' test_expect_success FUSE,EXPENSIVE "cat ipfs/bigfile looks good" '