mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-29 09:34:03 +08:00
fix t0061-daemon-opts.sh nc wait
fix the nc wait. the issue was that stdin needs to remain _open_ but not receive any input for some time. If stdin receives (invalid) input or closes, the other side terminates the connection before writing out the muxer frames + identify handshake. This commit also changes the use of `!` for `test_must_fail` License: MIT Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
This commit is contained in:
@ -102,10 +102,9 @@ test_expect_success "ipfs help output looks good" '
|
|||||||
# check transport is encrypted
|
# check transport is encrypted
|
||||||
|
|
||||||
test_expect_success 'transport should be encrypted' '
|
test_expect_success 'transport should be encrypted' '
|
||||||
nc localhost 4001 >swarmnc &
|
nc -w 5 localhost 4001 >swarmnc &&
|
||||||
go-sleep 0.1s &&
|
|
||||||
grep -q "AES-256,AES-128" swarmnc &&
|
grep -q "AES-256,AES-128" swarmnc &&
|
||||||
! grep -q "/ipfs/identify" swarmnc ||
|
test_must_fail grep -q "/ipfs/identify" swarmnc ||
|
||||||
test_fsh cat swarmnc
|
test_fsh cat swarmnc
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -26,10 +26,9 @@ test_expect_success 'api gateway should be unrestricted' '
|
|||||||
'
|
'
|
||||||
|
|
||||||
# Odd. this fails here, but the inverse works on t0060-daemon.
|
# Odd. this fails here, but the inverse works on t0060-daemon.
|
||||||
test_expect_failure 'transport should be unencrypted' '
|
test_expect_success 'transport should be unencrypted' '
|
||||||
nc 127.0.0.1 "$PORT_SWARM" >swarmnc &
|
go-sleep 0.5s | nc localhost "$PORT_SWARM" >swarmnc &&
|
||||||
go-sleep 0.1s &&
|
test_must_fail grep -q "AES-256,AES-128" swarmnc &&
|
||||||
! grep -q "AES-256,AES-128" swarmnc &&
|
|
||||||
grep -q "/ipfs/identify" swarmnc ||
|
grep -q "/ipfs/identify" swarmnc ||
|
||||||
test_fsh cat swarmnc
|
test_fsh cat swarmnc
|
||||||
'
|
'
|
||||||
|
Reference in New Issue
Block a user