Skip to content

Commit 11d3488

Browse files
authored
PYTHON-5415 - Unskip tests that rely on server hostname (#2398)
1 parent d6ab555 commit 11d3488

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

.evergreen/scripts/setup-system.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,14 @@ if [ "$(uname -s)" = "Darwin" ]; then
3838
fi
3939
fi
4040

41+
if [ -w /etc/hosts ]; then
42+
SUDO=""
43+
else
44+
SUDO="sudo"
45+
fi
46+
47+
# Add 'server' and 'hostname_not_in_cert' as a hostnames
48+
echo "127.0.0.1 server" | $SUDO tee -a /etc/hosts
49+
echo "127.0.0.1 hostname_not_in_cert" | $SUDO tee -a /etc/hosts
50+
4151
echo "Setting up system... done."

test/asynchronous/test_ssl.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,13 @@ async def test_cert_ssl_uri_support(self):
304304
client = self.simple_client(uri_fmt % (CLIENT_PEM, "true", CA_PEM))
305305
await self.assertClientWorks(client)
306306

307+
@unittest.skipIf(
308+
"PyPy" in sys.version and not _IS_SYNC,
309+
"https://github.com/pypy/pypy/issues/5131 flaky on async PyPy due to SSL EOF",
310+
)
307311
@async_client_context.require_tlsCertificateKeyFile
308312
@async_client_context.require_server_resolvable
313+
@async_client_context.require_no_api_version
309314
@ignore_deprecations
310315
async def test_cert_ssl_validation_hostname_matching(self):
311316
# Expects the server to be running with server.pem and ca.pem
@@ -430,8 +435,13 @@ async def test_tlsCRLFile_support(self):
430435
self.simple_client(uri_fmt % (CRL_PEM, CA_PEM), **self.credentials) # type: ignore[arg-type]
431436
)
432437

438+
@unittest.skipIf(
439+
"PyPy" in sys.version and not _IS_SYNC,
440+
"https://github.com/pypy/pypy/issues/5131 flaky on async PyPy due to SSL EOF",
441+
)
433442
@async_client_context.require_tlsCertificateKeyFile
434443
@async_client_context.require_server_resolvable
444+
@async_client_context.require_no_api_version
435445
@ignore_deprecations
436446
async def test_validation_with_system_ca_certs(self):
437447
# Expects the server to be running with server.pem and ca.pem.

test/test_ssl.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,13 @@ def test_cert_ssl_uri_support(self):
304304
client = self.simple_client(uri_fmt % (CLIENT_PEM, "true", CA_PEM))
305305
self.assertClientWorks(client)
306306

307+
@unittest.skipIf(
308+
"PyPy" in sys.version and not _IS_SYNC,
309+
"https://github.com/pypy/pypy/issues/5131 flaky on async PyPy due to SSL EOF",
310+
)
307311
@client_context.require_tlsCertificateKeyFile
308312
@client_context.require_server_resolvable
313+
@client_context.require_no_api_version
309314
@ignore_deprecations
310315
def test_cert_ssl_validation_hostname_matching(self):
311316
# Expects the server to be running with server.pem and ca.pem
@@ -430,8 +435,13 @@ def test_tlsCRLFile_support(self):
430435
self.simple_client(uri_fmt % (CRL_PEM, CA_PEM), **self.credentials) # type: ignore[arg-type]
431436
)
432437

438+
@unittest.skipIf(
439+
"PyPy" in sys.version and not _IS_SYNC,
440+
"https://github.com/pypy/pypy/issues/5131 flaky on async PyPy due to SSL EOF",
441+
)
433442
@client_context.require_tlsCertificateKeyFile
434443
@client_context.require_server_resolvable
444+
@client_context.require_no_api_version
435445
@ignore_deprecations
436446
def test_validation_with_system_ca_certs(self):
437447
# Expects the server to be running with server.pem and ca.pem.

0 commit comments

Comments
 (0)