提交 e0a48ffc 作者: Christian Couder

iptb-lib: add startup_cluster()

While at it let's cleanup startup_cluster() too.

License: MIT
Signed-off-by: 's avatarChristian Couder <chriscool@tuxfamily.org>
上级 8b875ebe
......@@ -17,3 +17,23 @@ check_has_connection() {
grep "ipfs" "swarm_peers_$node" >/dev/null
}
startup_cluster() {
num_nodes="$1"
bound=$(expr $num_nodes - 1)
test_expect_success "start up nodes" '
iptb start
'
test_expect_success "connect nodes to eachother" '
iptb connect [1-$bound] 0
'
for i in $(test_seq 1 $bound)
do
test_expect_success "node $i is connected" '
check_has_connection "$i" ||
test_fsh cat "swarm_peers_$i"
'
done
}
......@@ -14,27 +14,6 @@ test_expect_success "set up an iptb cluster" '
iptb init -n $num_nodes -p 0 -f --bootstrap=none
'
startup_cluster() {
bound=`expr $num_nodes - 1`
test_expect_success "start up nodes" '
iptb start
'
test_expect_success "connect nodes to eachother" '
iptb connect [1-$bound] 0
'
test_expect_success "nodes are connected" '
for i in `seq $bound`
do
if ! check_has_connection $i; then
echo "oh shit guys"
return 1
fi
done
'
}
startup_cluster $num_nodes
test_expect_success "add an obect on one node" '
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论