Skip to content

Commit db98e77

Browse files
committedJun 3, 2015
add a test for issue repro
1 parent 546415b commit db98e77

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
 

‎test/sharness/x0045-add-cat-iptb.sh

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/sh
2+
#
3+
# Copyright (c) 2015 Jeromy Johnson
4+
# MIT Licensed; see the LICENSE file in this repository.
5+
#
6+
7+
test_description="test two nodes transferring a large file"
8+
9+
. lib/test-lib.sh
10+
11+
export IPTB_ROOT="`pwd`/.iptb"
12+
13+
test_expect_success "set up two nodes" '
14+
IPTB_PORT=$((RANDOM % 10000 + 22000)) &&
15+
iptb -n=2 "-p=$IPTB_PORT" init &&
16+
iptb -wait start
17+
'
18+
19+
test_expect_success "add a file on node1" '
20+
export IPFS_PATH="$IPTB_ROOT/0" &&
21+
random 400000000 > filea &&
22+
FILEA_HASH=$(ipfs add -q filea)
23+
'
24+
25+
test_expect_success "cat that file on node2" '
26+
export IPFS_PATH="$IPTB_ROOT/1" &&
27+
ipfs cat $FILEA_HASH >fileb
28+
'
29+
30+
test_expect_success "verify files match" '
31+
multihash filea > expected1 &&
32+
multihash fileb > actual1 &&
33+
test_cmp actual1 expected1
34+
'
35+
36+
test_expect_success "shut down nodes" '
37+
iptb stop
38+
'
39+
40+
test_done

0 commit comments

Comments
 (0)
Please sign in to comment.