1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 14:34:24 +08:00

fix tests that check swarm port knocking

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
Jeromy
2016-04-06 22:44:14 -07:00
parent 8f3a51ac42
commit 3148f4c34f
2 changed files with 6 additions and 6 deletions

View File

@ -81,9 +81,9 @@ test_expect_success "nc is available" '
# check transport is encrypted # check transport is encrypted
test_expect_success "transport should be encrypted" ' test_expect_success "transport should be encrypted" '
nc -w 5 localhost $SWARM_PORT >swarmnc && printf "\x13/multistream/1.0.0\n\3ls\n" | nc -q1 localhost $SWARM_PORT > swarmnc &&
grep -q "AES-256,AES-128" swarmnc && grep -q "/secio" swarmnc &&
test_must_fail grep -q "/multistream/1.0.0" swarmnc || test_must_fail grep -q "/plaintext/1.0.0" swarmnc ||
test_fsh cat swarmnc test_fsh cat swarmnc
' '

View File

@ -27,9 +27,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_success 'transport should be unencrypted' ' test_expect_success 'transport should be unencrypted' '
go-sleep 0.5s | nc localhost "$SWARM_PORT" >swarmnc && printf "\x13/multistream/1.0.0\n\3ls\n" | nc -q 1 localhost $SWARM_PORT > swarmnc &&
test_must_fail grep -q "AES-256,AES-128" swarmnc && test_must_fail grep -q "/secio" swarmnc &&
grep -q "/multistream/1.0.0" swarmnc || grep -q "/plaintext" swarmnc ||
test_fsh cat swarmnc test_fsh cat swarmnc
' '