fix tests that check swarm port knocking
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
Jeromy committed
Apr 6, 2016 at 22:44 UTC
3148f4c34fc6c7dadd8e2fe8d02f46354e5ce207
2 files changed
+6
-6
test/sharness/t0060-daemon.sh
+3
-3
@@ -81,9 +81,9 @@ test_expect_success "nc is available" '
81
82
# check transport is encrypted
83
test_expect_success "transport should be encrypted" '
84
- nc -w 5 localhost $SWARM_PORT >swarmnc &&
85
- grep -q "AES-256,AES-128" swarmnc &&
86
- test_must_fail grep -q "/multistream/1.0.0" swarmnc ||
84
+ printf "\x13/multistream/1.0.0\n\3ls\n" | nc -q1 localhost $SWARM_PORT > swarmnc &&
85
+ grep -q "/secio" swarmnc &&
86
+ test_must_fail grep -q "/plaintext/1.0.0" swarmnc ||
87
test_fsh cat swarmnc
88
'
89
test/sharness/t0061-daemon-opts.sh
+3
-3
@@ -27,9 +27,9 @@ test_expect_success 'api gateway should be unrestricted' '
27
28
# Odd. this fails here, but the inverse works on t0060-daemon.
29
test_expect_success 'transport should be unencrypted' '
30
- go-sleep 0.5s | nc localhost "$SWARM_PORT" >swarmnc &&
31
- test_must_fail grep -q "AES-256,AES-128" swarmnc &&
32
- grep -q "/multistream/1.0.0" swarmnc ||
30
+ printf "\x13/multistream/1.0.0\n\3ls\n" | nc -q 1 localhost $SWARM_PORT > swarmnc &&
31
+ test_must_fail grep -q "/secio" swarmnc &&
32
+ grep -q "/plaintext" swarmnc ||
33
test_fsh cat swarmnc
34
'
35