Skip to content

PYTHON-5415 - Unskip tests that rely on server hostname #2398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .evergreen/scripts/setup-system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,14 @@ if [ "$(uname -s)" = "Darwin" ]; then
fi
fi

if [ -w /etc/hosts ]; then
SUDO=""
else
SUDO="sudo"
fi

# Add 'server' and 'hostname_not_in_cert' as a hostnames
echo "127.0.0.1 server" | $SUDO tee -a /etc/hosts
echo "127.0.0.1 hostname_not_in_cert" | $SUDO tee -a /etc/hosts

echo "Setting up system... done."
10 changes: 10 additions & 0 deletions test/asynchronous/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,13 @@ async def test_cert_ssl_uri_support(self):
client = self.simple_client(uri_fmt % (CLIENT_PEM, "true", CA_PEM))
await self.assertClientWorks(client)

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

@unittest.skipIf(
"PyPy" in sys.version and not _IS_SYNC,
"https://github.com/pypy/pypy/issues/5131 flaky on async PyPy due to SSL EOF",
)
@async_client_context.require_tlsCertificateKeyFile
@async_client_context.require_server_resolvable
@async_client_context.require_no_api_version
@ignore_deprecations
async def test_validation_with_system_ca_certs(self):
# Expects the server to be running with server.pem and ca.pem.
Expand Down
10 changes: 10 additions & 0 deletions test/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,13 @@ def test_cert_ssl_uri_support(self):
client = self.simple_client(uri_fmt % (CLIENT_PEM, "true", CA_PEM))
self.assertClientWorks(client)

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

@unittest.skipIf(
"PyPy" in sys.version and not _IS_SYNC,
"https://github.com/pypy/pypy/issues/5131 flaky on async PyPy due to SSL EOF",
)
@client_context.require_tlsCertificateKeyFile
@client_context.require_server_resolvable
@client_context.require_no_api_version
@ignore_deprecations
def test_validation_with_system_ca_certs(self):
# Expects the server to be running with server.pem and ca.pem.
Expand Down
Loading