Commit 22ac5997 authored by Christian Couder's avatar Christian Couder

test ipfs cat and ipfs add with a 100MB file

License: MIT
Signed-off-by: default avatarChristian Couder <chriscool@tuxfamily.org>
parent 630816c7
......@@ -38,6 +38,47 @@ test_expect_success "cat ipfs/stuff looks good" '
test_cmp expected actual
'
test_expect_success "go-random is installed" '
type random
'
test_expect_success "generate 100MB file using go-random" '
random 104857600 42 >mountdir/bigfile
'
test_expect_success "sha1 of the file looks ok" '
echo "54dc0dbbc353b2ffb745285793f89af0c9d98449 mountdir/bigfile" >sha1_expected &&
sha1sum mountdir/bigfile >sha1_actual &&
test_cmp sha1_expected sha1_actual
'
test_expect_success "ipfs add bigfile succeeds" '
ipfs add mountdir/bigfile >actual
'
test_expect_success "ipfs add bigfile output looks good" '
HASH="QmeZVkWkDu4W1vxWdDgUbqKYba9K3u45hJEdPA4Wr2sHZz" &&
echo "added $HASH $(pwd)/mountdir/bigfile" >expected &&
test_cmp expected actual
'
test_expect_success "ipfs cat succeeds" '
ipfs cat $HASH | sha1sum >sha1_actual
'
test_expect_success "ipfs cat output looks good" '
echo "54dc0dbbc353b2ffb745285793f89af0c9d98449 -" >sha1_expected &&
test_cmp sha1_expected sha1_actual
'
test_expect_success "cat ipfs/bigfile succeeds" '
cat ipfs/$HASH | sha1sum >sha1_actual
'
test_expect_success "cat ipfs/bigfile looks good" '
test_cmp sha1_expected sha1_actual
'
test_kill_ipfs_mount
test_done
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