Commit d4b42f8e authored by Jeromy's avatar Jeromy
Browse files

fixes for sha3

parent 8f79df77
#!/bin/sh
#
# Script to aggregate results using Sharness
#
# Copyright (c) 2014 Christian Couder
# MIT Licensed; see the LICENSE file in this repository.
#
SHARNESS_AGGREGATE="lib/sharness/aggregate-results.sh"
test -f "$SHARNESS_AGGREGATE" || {
echo >&2 "Cannot find: $SHARNESS_AGGREGATE"
echo >&2 "Please check Sharness installation."
exit 1
}
ls test-results/t*-*.sh.*.counts | "$SHARNESS_AGGREGATE"
# Test framework for go-ipfs
#
# Copyright (c) 2014 Christian Couder
# MIT Licensed; see the LICENSE file in this repository.
#
# We are using sharness (https://github.com/mlafeldt/sharness)
# which was extracted from the Git test framework.
# Use the multihash tool to test against
# Add current directory to path, for multihash tool.
PATH=$(pwd)/bin:${PATH}
# Set sharness verbosity. we set the env var directly as
# it's too late to pass in --verbose, and --verbose is harder
# to pass through in some cases.
test "$TEST_VERBOSE" = 1 && verbose=t
# assert the `multihash` we're using is the right one.
if test `which multihash` != $(pwd)/bin/multihash; then
echo >&2 "Cannot find the tests' local multihash tool."
echo >&2 "Please check test and multihash tool installation."
exit 1
fi
SHARNESS_LIB="lib/sharness/sharness.sh"
. "$SHARNESS_LIB" || {
echo >&2 "Cannot source: $SHARNESS_LIB"
echo >&2 "Please check Sharness installation."
exit 1
}
# Please put go-multihash specific shell functions below
for hashbin in sha1sum shasum; do
if type "$hashbin"; then
export SHASUMBIN="$hashbin" &&
test_set_prereq SHASUM &&
break
fi
done
#!/bin/sh
#
# Copyright (c) 2015 Christian Couder
# MIT Licensed; see the LICENSE file in this repository.
#
test_description="Basic tests"
. lib/test-lib.sh
test_expect_success "current dir is writable" '
echo "It works!" >test.txt
'
test_expect_success "multihash is available" '
type multihash
'
test_expect_success "multihash help output looks good" '
test_must_fail multihash -h 2>help.txt &&
cat help.txt | egrep -i "^usage:" >/dev/null &&
cat help.txt | egrep -i "multihash .*options.*file" >/dev/null
'
test_done
#!/bin/sh
#
# Copyright (c) 2015 Christian Couder
# MIT Licensed; see the LICENSE file in this repository.
#
test_description="sha1 tests"
. lib/test-lib.sh
test_expect_success "setup sha1 tests" '
echo "Hash me!" >hash_me.txt &&
SHA1=bc6f2c3cd945bc754789e50b2f68deee2f421810 &&
echo "1114$SHA1" >actual
'
test_expect_success "'multihash -a=sha1 -e=hex' works" '
multihash -a=sha1 -e=hex hash_me.txt >expected
'
test_expect_success "'multihash -a=sha1 -e=hex' output looks good" '
test_cmp expected actual
'
test_expect_success SHASUM "check hash using shasum" '
echo "$SHA1 hash_me.txt" >actual &&
$SHASUMBIN hash_me.txt >expected &&
test_cmp expected actual
'
test_done
...@@ -9,7 +9,7 @@ package loggables ...@@ -9,7 +9,7 @@ package loggables
import ( import (
"net" "net"
ma "QmaA6aDzeHjZiuqBtgYRz8ZXb1qMCoyMHgyDjBEYQniUKF/go-multiaddr" ma "QmbWxL1aXQhBjc1XGjGF1f2KGBMCBYSuT2ThA8YXnXJK83/go-multiaddr"
logging "QmWRypnfEwrgH4k93KEHN5hng7VjKYkWmzDYRuTZeh2Mgh/go-log" logging "QmWRypnfEwrgH4k93KEHN5hng7VjKYkWmzDYRuTZeh2Mgh/go-log"
......
...@@ -12,7 +12,7 @@ import ( ...@@ -12,7 +12,7 @@ import (
peer "github.com/ipfs/go-libp2p/p2p/peer" peer "github.com/ipfs/go-libp2p/p2p/peer"
u "util" u "util"
ma "QmaA6aDzeHjZiuqBtgYRz8ZXb1qMCoyMHgyDjBEYQniUKF/go-multiaddr" ma "QmbWxL1aXQhBjc1XGjGF1f2KGBMCBYSuT2ThA8YXnXJK83/go-multiaddr"
) )
// ZeroLocalTCPAddress is the "zero" tcp local multiaddr. This means: // ZeroLocalTCPAddress is the "zero" tcp local multiaddr. This means:
......
...@@ -3,7 +3,7 @@ package testutil ...@@ -3,7 +3,7 @@ package testutil
import ( import (
"testing" "testing"
ma "QmaA6aDzeHjZiuqBtgYRz8ZXb1qMCoyMHgyDjBEYQniUKF/go-multiaddr" ma "QmbWxL1aXQhBjc1XGjGF1f2KGBMCBYSuT2ThA8YXnXJK83/go-multiaddr"
ci "github.com/ipfs/go-libp2p/p2p/crypto" ci "github.com/ipfs/go-libp2p/p2p/crypto"
peer "github.com/ipfs/go-libp2p/p2p/peer" peer "github.com/ipfs/go-libp2p/p2p/peer"
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment