Skip to content

Commit

Permalink
test: fix the socat tests after the ubuntu 24.04 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
galargh committed Jan 29, 2025
1 parent 3c9cc3f commit 12a0185
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions test/sharness/t0060-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,21 @@ test_expect_success "ipfs help output looks good" '
# check transport is encrypted by default and no plaintext is allowed

test_expect_success SOCAT "default transport should support encryption (TLS, needs socat )" '
socat - tcp:localhost:$SWARM_PORT,connect-timeout=1 > swarmnc < ../t0060-data/mss-tls &&
socat -s - tcp:localhost:$SWARM_PORT,connect-timeout=1 > swarmnc < ../t0060-data/mss-tls &&
grep -q "/tls" swarmnc &&
test_must_fail grep -q "na" swarmnc ||
test_fsh cat swarmnc
'

test_expect_success SOCAT "default transport should support encryption (Noise, needs socat )" '
socat - tcp:localhost:$SWARM_PORT,connect-timeout=1 > swarmnc < ../t0060-data/mss-noise &&
socat -s - tcp:localhost:$SWARM_PORT,connect-timeout=1 > swarmnc < ../t0060-data/mss-noise &&
grep -q "/noise" swarmnc &&
test_must_fail grep -q "na" swarmnc ||
test_fsh cat swarmnc
'

test_expect_success SOCAT "default transport should not support plaintext (needs socat )" '
socat - tcp:localhost:$SWARM_PORT,connect-timeout=1 > swarmnc < ../t0060-data/mss-plaintext &&
socat -s - tcp:localhost:$SWARM_PORT,connect-timeout=1 > swarmnc < ../t0060-data/mss-plaintext &&
grep -q "na" swarmnc &&
test_must_fail grep -q "/plaintext" swarmnc ||
test_fsh cat swarmnc
Expand Down
2 changes: 1 addition & 1 deletion test/sharness/t0061-daemon-opts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ apiaddr=$API_ADDR

# Odd. this fails here, but the inverse works on t0060-daemon.
test_expect_success SOCAT 'transport should be unencrypted ( needs socat )' '
socat - tcp:localhost:$SWARM_PORT,connect-timeout=1 > swarmnc < ../t0060-data/mss-plaintext &&
socat -s - tcp:localhost:$SWARM_PORT,connect-timeout=1 > swarmnc < ../t0060-data/mss-plaintext &&
grep -q "/plaintext" swarmnc &&
test_must_fail grep -q "na" swarmnc ||
test_fsh cat swarmnc
Expand Down

0 comments on commit 12a0185

Please sign in to comment.