kubo/test/sharness/xt0130-multinode.sh
Juan Batiz-Benet 0f7f8ead04 disable constantly failing iptb tests
the iptb tests are failing all the time on travis. It's possible
this is still a port problem, and it may be something else.
Regardless, right now they're just adding noise.
2015-05-31 16:05:31 -07:00

41 lines
803 B
Bash
Executable File

#!/bin/sh
#
# Copyright (c) 2015 Jeromy Johnson
# MIT Licensed; see the LICENSE file in this repository.
#
test_description="Test multiple ipfs nodes"
. lib/test-lib.sh
export IPTB_ROOT="`pwd`/.iptb"
test_expect_success "set up a few nodes" '
IPTB_PORT=$((RANDOM % 10000 + 22000)) &&
iptb -n=3 "-p=$IPTB_PORT" init &&
iptb -wait start
'
test_expect_success "add a file on node1" '
export IPFS_PATH="$IPTB_ROOT/1" &&
random 1000000 > filea &&
FILEA_HASH=$(ipfs add -q filea)
'
test_expect_success "cat that file on node2" '
export IPFS_PATH="$IPTB_ROOT/2" &&
ipfs cat $FILEA_HASH >fileb
'
test_expect_success "verify files match" '
multihash filea > expected1 &&
multihash fileb > actual1 &&
test_cmp actual1 expected1
'
test_expect_success "shut down nodes" '
iptb stop
'
test_done