mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-10 05:52:20 +08:00
fix tests that check swarm port knocking
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
@ -81,9 +81,9 @@ test_expect_success "nc is available" '
|
||||
|
||||
# check transport is encrypted
|
||||
test_expect_success "transport should be encrypted" '
|
||||
nc -w 5 localhost $SWARM_PORT >swarmnc &&
|
||||
grep -q "AES-256,AES-128" swarmnc &&
|
||||
test_must_fail grep -q "/multistream/1.0.0" swarmnc ||
|
||||
printf "\x13/multistream/1.0.0\n\3ls\n" | nc -q1 localhost $SWARM_PORT > swarmnc &&
|
||||
grep -q "/secio" swarmnc &&
|
||||
test_must_fail grep -q "/plaintext/1.0.0" swarmnc ||
|
||||
test_fsh cat swarmnc
|
||||
'
|
||||
|
||||
|
@ -27,9 +27,9 @@ test_expect_success 'api gateway should be unrestricted' '
|
||||
|
||||
# Odd. this fails here, but the inverse works on t0060-daemon.
|
||||
test_expect_success 'transport should be unencrypted' '
|
||||
go-sleep 0.5s | nc localhost "$SWARM_PORT" >swarmnc &&
|
||||
test_must_fail grep -q "AES-256,AES-128" swarmnc &&
|
||||
grep -q "/multistream/1.0.0" swarmnc ||
|
||||
printf "\x13/multistream/1.0.0\n\3ls\n" | nc -q 1 localhost $SWARM_PORT > swarmnc &&
|
||||
test_must_fail grep -q "/secio" swarmnc &&
|
||||
grep -q "/plaintext" swarmnc ||
|
||||
test_fsh cat swarmnc
|
||||
'
|
||||
|
||||
|
Reference in New Issue
Block a user