提交 cacb1cc2 作者: Christian Couder

sharness: add lib/iptb-lib.sh

License: MIT
Signed-off-by: 's avatarChristian Couder <chriscool@tuxfamily.org>
上级 ba148b23
# iptb test framework
#
# Copyright (c) 2014, 2016 Jeromy Johnson, Christian Couder
# MIT Licensed; see the LICENSE file in this repository.
export IPTB_ROOT="`pwd`/.iptb"
ipfsi() {
dir="$1"
shift
IPFS_PATH="$IPTB_ROOT/$dir" ipfs $@
}
check_has_connection() {
node=$1
ipfsi $node swarm peers | grep ipfs > /dev/null
}
......@@ -53,6 +53,9 @@ fi
# source our generic test lib
. ../../ipfs-test-lib.sh
# source iptb lib
. ../lib/iptb-lib.sh
test_cmp_repeat_10_sec() {
for i in $(test_seq 1 100)
do
......
......@@ -8,25 +8,12 @@ test_description="Test ipfs repo operations"
. lib/test-lib.sh
export IPTB_ROOT="`pwd`/.iptb"
num_nodes=4
ipfsi() {
dir="$1"
shift
IPFS_PATH="$IPTB_ROOT/$dir" ipfs $@
}
test_expect_success "set up an iptb cluster" '
iptb init -n $num_nodes -p 0 -f --bootstrap=none
'
check_has_connection() {
node=$1
ipfsi $node swarm peers | grep ipfs > /dev/null
}
startup_cluster() {
bound=`expr $num_nodes - 1`
test_expect_success "start up nodes" '
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论