mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-02 23:08:07 +08:00
pubsub sharness tests after chriscool feedback
License: MIT Signed-off-by: Jan Winkelmann <j-winkelmann@tuhh.de>
This commit is contained in:
parent
1b3158f860
commit
993e7816f8
@ -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" '
|
||||
|
||||
@ -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 &&
|
||||
|
||||
Loading…
Reference in New Issue
Block a user