mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-28 05:47:51 +08:00
Merge pull request #764 from jbenet/use_multihash_not_shasum
Use multihash not shasum
This commit is contained in:
commit
931cff2c70
@ -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)
|
||||
|
||||
|
||||
@ -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 = ../..
|
||||
|
||||
|
||||
@ -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" '
|
||||
|
||||
Loading…
Reference in New Issue
Block a user