From 3148f4c34fc6c7dadd8e2fe8d02f46354e5ce207 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Wed, 6 Apr 2016 22:44:14 -0700 Subject: [PATCH] fix tests that check swarm port knocking License: MIT Signed-off-by: Jeromy --- test/sharness/t0060-daemon.sh | 6 +++--- test/sharness/t0061-daemon-opts.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/sharness/t0060-daemon.sh b/test/sharness/t0060-daemon.sh index 7da901749..95df8a48e 100755 --- a/test/sharness/t0060-daemon.sh +++ b/test/sharness/t0060-daemon.sh @@ -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 ' diff --git a/test/sharness/t0061-daemon-opts.sh b/test/sharness/t0061-daemon-opts.sh index c961a8651..f273844db 100755 --- a/test/sharness/t0061-daemon-opts.sh +++ b/test/sharness/t0061-daemon-opts.sh @@ -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 '