diff --git a/test/sharness/t0180-pubsub-gossipsub.sh b/test/sharness/t0180-pubsub-gossipsub.sh index 8c0686efd1e1..c89c8d1ae921 100755 --- a/test/sharness/t0180-pubsub-gossipsub.sh +++ b/test/sharness/t0180-pubsub-gossipsub.sh @@ -25,7 +25,7 @@ test_expect_success 'peer ids' ' ' test_expect_success 'pubsub' ' - echo -n "testOK" | ipfs multibase encode -b base64url > expected && + echo -n -e "test\nOK" | ipfs multibase encode -b base64url > expected && touch empty && mkfifo wait || test_fsh echo init fail @@ -53,8 +53,9 @@ test_expect_success "output looks good" ' test_cmp peers_exp peers_out ' -test_expect_success "publish something" ' - ipfsi 1 pubsub pub testTopic "testOK" &> pubErr +test_expect_success "publish something from a file" ' + echo -n -e "test\nOK" > payload-file && + ipfsi 1 pubsub pub testTopic payload-file &> pubErr ' test_expect_success "wait until echo > wait executed" ' @@ -64,7 +65,7 @@ test_expect_success "wait until echo > wait executed" ' ' test_expect_success "wait for another pubsub message" ' - echo -n "testOK2" | ipfs multibase encode -b base64url > expected && + echo -n -e "test\nOK2" | ipfs multibase encode -b base64url > expected && mkfifo wait2 || test_fsh echo init fail @@ -83,7 +84,7 @@ test_expect_success "wait until ipfs pubsub sub is ready to do work" ' ' test_expect_success "publish something" ' - echo -n "testOK2" | ipfsi 1 pubsub pub testTopic &> pubErr + echo -n -e "test\nOK2" | ipfsi 1 pubsub pub testTopic &> pubErr ' test_expect_success "wait until echo > wait executed" ' diff --git a/test/sharness/t0180-pubsub.sh b/test/sharness/t0180-pubsub.sh index 08e05ec9c869..04b120c3e210 100755 --- a/test/sharness/t0180-pubsub.sh +++ b/test/sharness/t0180-pubsub.sh @@ -22,7 +22,7 @@ run_pubsub_tests() { # ipfs pubsub sub test_expect_success 'pubsub' ' - echo -n "testOK" | ipfs multibase encode -b base64url > expected && + echo -n -e "test\nOK" | ipfs multibase encode -b base64url > expected && touch empty && mkfifo wait || test_fsh echo init fail @@ -51,7 +51,7 @@ run_pubsub_tests() { ' test_expect_success "publish something from file" ' - echo -n "testOK" > payload-file && + echo -n -e "test\nOK" > payload-file && ipfsi 1 pubsub pub testTopic payload-file &> pubErr ' @@ -62,7 +62,7 @@ run_pubsub_tests() { ' test_expect_success "wait for another pubsub message" ' - echo -n "testOK2" | ipfs multibase encode -b base64url > expected && + echo -n -e "test\nOK\r\n2" | ipfs multibase encode -b base64url > expected && mkfifo wait2 || test_fsh echo init fail @@ -81,7 +81,7 @@ run_pubsub_tests() { ' test_expect_success "publish something from stdin" ' - echo -n "testOK2" | ipfsi 3 pubsub pub testTopic &> pubErr + echo -n -e "test\nOK\r\n2" | ipfsi 3 pubsub pub testTopic &> pubErr ' test_expect_success "wait until echo > wait executed" '