pubsub sharness tests after chriscool feedback

License: MIT
Signed-off-by: Jan Winkelmann <j-winkelmann@tuhh.de>
This commit is contained in:
Jan Winkelmann 2016-11-30 15:04:37 +01:00
parent 1b3158f860
commit 993e7816f8
2 changed files with 12 additions and 11 deletions

View File

@ -19,11 +19,13 @@ check_has_connection() {
startup_cluster() {
num_nodes="$1"
shift
other_args="$@"
bound=$(expr "$num_nodes" - 1)
if [ "$2" = "--enable-pubsub-experiment" ]; then
test_expect_success "start up nodes with pubsub enabled" '
iptb start --args --enable-pubsub-experiment
if test -n "$other_args"; then
test_expect_success "start up nodes with additional args" '
iptb start --args $other_args
'
else
test_expect_success "start up nodes" '

View File

@ -24,18 +24,17 @@ test_expect_success 'pubsub' '
mkfifo wait ||
test_fsh echo init fail
# ipfs pubsub sub is long-running so we need to start it in the background and
# wait put its output somewhere where we can access it
(
ipfsi 0 pubsub sub --enc=ndpayload testTopic |
while read line; do
ipfsi 0 pubsub sub --enc=ndpayload testTopic | if read line; then
echo $line > actual &&
echo > done
exit
done
echo > wait
fi
) &
ipfspid=$!
sleep 1
# wait until ipfs pubsub sub is ready to do work
sleep 1 &&
# publish something
ipfsi 1 pubsub pub testTopic "testOK" &> pubErr &&