From 6f2a1666a1d73e843d390f2d3df8f95dec21f064 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 26 Sep 2024 15:20:43 +0200 Subject: [PATCH] tests: use '-4' where needed Our test servers run either on ipv4 *or* on ipv6, as requested. A test case using 'localhost' or '*.local' in the url needs to run with the specific version of the server started. Otherwise, curl's "happy eyeball"ing will connect to another server that may be running due to parallel testing or for some other reasons. Note that port reuse here depends on the OS strategy and it seems netbsd is especially likely to hit this. Closes #15060 --- tests/data/test2033 | 2 +- tests/data/test2034 | 2 +- tests/data/test2035 | 2 +- tests/data/test2037 | 2 +- tests/data/test2038 | 2 +- tests/data/test2041 | 2 +- tests/data/test2042 | 2 +- tests/data/test2048 | 2 +- tests/data/test2070 | 2 +- tests/data/test2079 | 2 +- tests/data/test2087 | 2 +- tests/data/test3000 | 2 +- tests/data/test3001 | 2 +- tests/data/test3023 | 2 +- tests/data/test3024 | 2 +- tests/data/test310 | 2 +- tests/data/test311 | 2 +- tests/data/test312 | 2 +- tests/data/test313 | 2 +- tests/data/test389 | 2 +- tests/data/test392 | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/tests/data/test2033 b/tests/data/test2033 index 6aa5e50f03..01056594d9 100644 --- a/tests/data/test2033 +++ b/tests/data/test2033 @@ -40,7 +40,7 @@ simple HTTPS GET with DER public key pinning (Schannel variant) CURL_SSL_BACKEND=schannel ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.der --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.der --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test2034 b/tests/data/test2034 index 82b205555f..68963bd5bd 100644 --- a/tests/data/test2034 +++ b/tests/data/test2034 @@ -36,7 +36,7 @@ https Server-localhost-sv.pem simple HTTPS GET with DER public key pinning ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.der https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.der https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test2035 b/tests/data/test2035 index 9680a36346..66fa5874cc 100644 --- a/tests/data/test2035 +++ b/tests/data/test2035 @@ -27,7 +27,7 @@ https Server-localhost-sv.pem HTTPS wrong DER pinnedpubkey but right CN ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.der https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.der https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test2037 b/tests/data/test2037 index f55e6b11c4..50c4c72e9d 100644 --- a/tests/data/test2037 +++ b/tests/data/test2037 @@ -36,7 +36,7 @@ https Server-localhost-sv.pem simple HTTPS GET with PEM public key pinning ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.pem https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.pem https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test2038 b/tests/data/test2038 index 36d399fa62..2ec01af659 100644 --- a/tests/data/test2038 +++ b/tests/data/test2038 @@ -27,7 +27,7 @@ https Server-localhost-sv.pem HTTPS wrong PEM pinnedpubkey but right CN ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pem https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pem https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test2041 b/tests/data/test2041 index 0b6fa9a18f..e4ee415e94 100644 --- a/tests/data/test2041 +++ b/tests/data/test2041 @@ -36,7 +36,7 @@ https Server-localhost-sv.pem simple HTTPS GET with base64-sha256 public key pinning ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey sha256//%sha256b64file[%SRCDIR/certs/Server-localhost-sv.pub.der]sha256b64file% https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey sha256//%sha256b64file[%SRCDIR/certs/Server-localhost-sv.pub.der]sha256b64file% https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test2042 b/tests/data/test2042 index f4cf340fdb..13a0fad247 100644 --- a/tests/data/test2042 +++ b/tests/data/test2042 @@ -27,7 +27,7 @@ https Server-localhost-sv.pem HTTPS wrong base64-sha256 pinnedpubkey but right CN ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey sha256//bSIggTf+ikMG0CtmDlpMVBd7yi7H1md4URogRPqerso= https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey sha256//bSIggTf+ikMG0CtmDlpMVBd7yi7H1md4URogRPqerso= https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test2048 b/tests/data/test2048 index f14c8fbe82..63da9c761b 100644 --- a/tests/data/test2048 +++ b/tests/data/test2048 @@ -26,7 +26,7 @@ https Server-localhost-sv.pem pinnedpubkey no-match must fail even when insecure ---insecure --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost.nn-sv.pub.der https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --insecure --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost.nn-sv.pub.der https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test2070 b/tests/data/test2070 index abb22fc325..e46f4588f9 100644 --- a/tests/data/test2070 +++ b/tests/data/test2070 @@ -39,7 +39,7 @@ Ignore certificate revocation "best effort" strategy CURL_SSL_BACKEND=schannel ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test2079 b/tests/data/test2079 index 13e4fe1dd7..09e36be2b2 100644 --- a/tests/data/test2079 +++ b/tests/data/test2079 @@ -40,7 +40,7 @@ simple HTTPS GET with PEM public key pinning (Schannel variant) CURL_SSL_BACKEND=schannel ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.pem --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.pem --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test2087 b/tests/data/test2087 index 8084e78ad4..5b7cce5d48 100644 --- a/tests/data/test2087 +++ b/tests/data/test2087 @@ -40,7 +40,7 @@ simple HTTPS GET with base64-sha256 public key pinning (Schannel variant) CURL_SSL_BACKEND=schannel ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey sha256//%sha256b64file[%SRCDIR/certs/Server-localhost-sv.pub.der]sha256b64file% --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey sha256//%sha256b64file[%SRCDIR/certs/Server-localhost-sv.pub.der]sha256b64file% --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test3000 b/tests/data/test3000 index 6e7f7db4f6..43c2695c98 100644 --- a/tests/data/test3000 +++ b/tests/data/test3000 @@ -35,7 +35,7 @@ https Server-localhost-firstSAN-sv.pem HTTPS GET to localhost, first subject alt name matches, CN does not match ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test3001 b/tests/data/test3001 index 2d8817f0d0..9bfeb708a5 100644 --- a/tests/data/test3001 +++ b/tests/data/test3001 @@ -35,7 +35,7 @@ https Server-localhost-lastSAN-sv.pem HTTPS GET to localhost, last subject alt name matches, CN does not match ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test3023 b/tests/data/test3023 index a5bba7683d..09e66331df 100644 --- a/tests/data/test3023 +++ b/tests/data/test3023 @@ -39,7 +39,7 @@ HTTPS GET to localhost, first subject alt name matches, CN does not match (Schan CURL_SSL_BACKEND=schannel ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test3024 b/tests/data/test3024 index af1549c62b..11c7643ff6 100644 --- a/tests/data/test3024 +++ b/tests/data/test3024 @@ -39,7 +39,7 @@ HTTPS GET to localhost, last subject alt name matches, CN does not match (Schann CURL_SSL_BACKEND=schannel ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test310 b/tests/data/test310 index f7427981cc..1baf320950 100644 --- a/tests/data/test310 +++ b/tests/data/test310 @@ -35,7 +35,7 @@ https Server-localhost-sv.pem simple HTTPS GET ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test311 b/tests/data/test311 index e163412741..61fe2e90c0 100644 --- a/tests/data/test311 +++ b/tests/data/test311 @@ -26,7 +26,7 @@ https Server-localhost0h-sv.pem HTTPS wrong subjectAltName but right CN ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test312 b/tests/data/test312 index 5466c3eaab..52fc37cbd7 100644 --- a/tests/data/test312 +++ b/tests/data/test312 @@ -26,7 +26,7 @@ https Server-localhost.nn-sv.pem HTTPS GET to localhost and null-prefixed CN cert ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test313 b/tests/data/test313 index 3d31dc6808..cff9a9b25d 100644 --- a/tests/data/test313 +++ b/tests/data/test313 @@ -22,7 +22,7 @@ https Server-localhost-sv.pem CRL test ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --crlfile %SRCDIR/certs/Server-localhost-sv.crl https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --crlfile %SRCDIR/certs/Server-localhost-sv.crl https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/tests/data/test389 b/tests/data/test389 index 2dc0731b8e..a38d70eef6 100644 --- a/tests/data/test389 +++ b/tests/data/test389 @@ -38,7 +38,7 @@ local-http *.localhost is a local host -http://curlmachine.localhost:%HTTPPORT/%TESTNUMBER +-4 http://curlmachine.localhost:%HTTPPORT/%TESTNUMBER # Ensure that we're running on localhost diff --git a/tests/data/test392 b/tests/data/test392 index d24841c616..a9f756d948 100644 --- a/tests/data/test392 +++ b/tests/data/test392 @@ -35,7 +35,7 @@ HTTP secure cookies over localhost TZ=GMT -http://localhost:%HTTPPORT/%TESTNUMBER -b none http://localhost:%HTTPPORT/%TESTNUMBER +-4 http://localhost:%HTTPPORT/%TESTNUMBER -b none http://localhost:%HTTPPORT/%TESTNUMBER cookies