Commit c8e7a956 authored by Christian Couder's avatar Christian Couder

Add an EXPENSIVE prereq and use it in t0040

We add this prereq to tests with a 100MB file
as they are slow on Travis CI.

License: MIT
Signed-off-by: default avatarChristian Couder <chriscool@tuxfamily.org>
parent f06b9ca1
......@@ -29,6 +29,7 @@ SHARNESS_LIB="lib/sharness/sharness.sh"
# Please put go-ipfs specific shell functions below
test "$TEST_NO_FUSE" != 1 && test_set_prereq FUSE
test "$TEST_EXPENSIVE" = 1 && test_set_prereq EXPENSIVE
test_cmp_repeat_10_sec() {
for i in 1 2 3 4 5 6 7 8 9 10
......
......@@ -42,47 +42,45 @@ test_expect_success "go-random is installed" '
type random
'
test_expect_success "generate 100MB file using go-random" '
test_expect_success EXPENSIVE "generate 100MB file using go-random" '
random 104857600 42 >mountdir/bigfile
'
test_expect_success "sha1 of the file looks ok" '
test_expect_success EXPENSIVE "sha1 of the file looks ok" '
echo "885b197b01e0f7ff584458dc236cb9477d2e736d mountdir/bigfile" >sha1_expected &&
shasum mountdir/bigfile >sha1_actual &&
test_cmp sha1_expected sha1_actual
'
test_expect_success "ipfs add bigfile succeeds" '
test_expect_success EXPENSIVE "ipfs add bigfile succeeds" '
ipfs add mountdir/bigfile >actual
'
test_expect_success "ipfs add bigfile output looks good" '
test_expect_success EXPENSIVE "ipfs add bigfile output looks good" '
HASH="QmWXysX1oysyjTqd5xGM2T1maBaVXnk5svQv4GKo5PsGPo" &&
echo "added $HASH mountdir/bigfile" >expected &&
test_cmp expected actual
'
test_expect_success "ipfs cat succeeds" '
test_expect_success EXPENSIVE "ipfs cat succeeds" '
ipfs cat $HASH | shasum >sha1_actual
'
# this test commented out to run faster.
# uncomment to produce and examine output
# test_expect_success "ipfs cat output looks good" '
# ipfs cat $HASH >actual &&
# test_cmp mountdir/bigfile actual
# '
test_expect_success EXPENSIVE "ipfs cat output looks good" '
ipfs cat $HASH >actual &&
test_cmp mountdir/bigfile actual
'
test_expect_success "ipfs cat output shasum looks good" '
test_expect_success EXPENSIVE "ipfs cat output shasum looks good" '
echo "885b197b01e0f7ff584458dc236cb9477d2e736d -" >sha1_expected &&
test_cmp sha1_expected sha1_actual
'
test_expect_success FUSE "cat ipfs/bigfile succeeds" '
test_expect_success FUSE,EXPENSIVE "cat ipfs/bigfile succeeds" '
cat ipfs/$HASH | shasum >sha1_actual
'
test_expect_success FUSE "cat ipfs/bigfile looks good" '
test_expect_success FUSE,EXPENSIVE "cat ipfs/bigfile looks good" '
test_cmp sha1_expected sha1_actual
'
......
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