Skip to content

Commit d4a516a

Browse files
committed
http-binary-cache-store: skip test if cannot bind to a local port
This happens in GitHub's MacOS runners
1 parent 2647fa2 commit d4a516a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/functional/substituter-ssl-client-cert.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ openssl x509 -req -days 1 -in "$TEST_ROOT/client.csr" -CA "$TEST_ROOT/ca.crt" -C
3030
-set_serial 02 -out "$TEST_ROOT/client.crt" 2>/dev/null
3131

3232
# Find a free port
33-
PORT=$(python3 -c 'import socket; s=socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()')
33+
PORT=$(python3 -c 'import socket; s=socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()') \
34+
|| skipTest "Cannot bind to a TCP port"
3435

3536
# Start the SSL cache server
3637
python3 "${_NIX_TEST_SOURCE_DIR}/nix-binary-cache-ssl-server.py" \

0 commit comments

Comments
 (0)