Commit db98e77 1 parent 546415b commit db98e77 Copy full SHA for db98e77
File tree 1 file changed +40
-0
lines changed
1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments