#!/bin/sh # # Copyright (c) 2015 Maarten Everts # MIT Licensed; see the LICENSE file in this repository. # test_description="Test addition of 4031 bytes files (issue #1688)" . lib/test-lib.sh test_init_ipfs # Daemon is needed, this error only occurs when daemon is running. test_launch_ipfs_daemon # parameter: file size test_add_cat_sized_file() { test_expect_success "ipfs add and cat of $1 bytes file correct" ' INPUTFILE=testfile'"${1}"' && CATOUTPUT=${INPUTFILE}_cat && dd if=/dev/zero of=$INPUTFILE bs=1 count='"${1}"' && HASH=`ipfs add $INPUTFILE | cut -d " " -f 2` && ipfs cat $HASH > $CATOUTPUT && test_cmp $INPUTFILE $CATOUTPUT ' } # First a test that should work (to test the test) test_add_cat_sized_file 4030 test_add_cat_sized_file 4032 # And now the tests that results in an error according to issue #1688 test_add_cat_sized_file 4031 test_add_cat_sized_file 8063 test_kill_ipfs_daemon test_done