diff options
| author | Damien George <damien@micropython.org> | 2025-07-31 12:24:51 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-10-20 12:06:39 +1100 |
| commit | a3867590f917176c5276042a9edc2f400b665d4f (patch) | |
| tree | fafb0dd8ac5a3a3d5bf03d0b650ef256ca6f03b5 | |
| parent | 6fef4eb55ce0ea02ecedc7788ff5a7a042e352d5 (diff) | |
tests/net_inet: Skip tests on axTLS when necessary.
These tests cannot run with axTLS, eg on esp8266.
Signed-off-by: Damien George <damien@micropython.org>
| -rw-r--r-- | tests/net_inet/asyncio_tls_open_connection_readline.py | 4 | ||||
| -rw-r--r-- | tests/net_inet/ssl_cert.py | 3 | ||||
| -rw-r--r-- | tests/net_inet/ssl_errors.py | 4 | ||||
| -rw-r--r-- | tests/net_inet/test_sslcontext_client.py | 4 | ||||
| -rw-r--r-- | tests/net_inet/test_tls_nonblock.py | 7 |
5 files changed, 22 insertions, 0 deletions
diff --git a/tests/net_inet/asyncio_tls_open_connection_readline.py b/tests/net_inet/asyncio_tls_open_connection_readline.py index a0df88be4..492b85a5d 100644 --- a/tests/net_inet/asyncio_tls_open_connection_readline.py +++ b/tests/net_inet/asyncio_tls_open_connection_readline.py @@ -2,6 +2,10 @@ import ssl import os import asyncio +if not hasattr(ssl, "CERT_REQUIRED"): + print("SKIP") + raise SystemExit + # This certificate was obtained from micropython.org using openssl: # $ openssl s_client -showcerts -connect micropython.org:443 </dev/null 2>/dev/null # The certificate is from Let's Encrypt: diff --git a/tests/net_inet/ssl_cert.py b/tests/net_inet/ssl_cert.py index 7bb270d5f..4f065c565 100644 --- a/tests/net_inet/ssl_cert.py +++ b/tests/net_inet/ssl_cert.py @@ -1,6 +1,9 @@ import socket import ssl +if not hasattr(ssl, "CERT_REQUIRED"): + print("SKIP") + raise SystemExit # This certificate was obtained from micropython.org using openssl: # $ openssl s_client -showcerts -connect micropython.org:443 </dev/null 2>/dev/null diff --git a/tests/net_inet/ssl_errors.py b/tests/net_inet/ssl_errors.py index bc4e5910b..c23f736b0 100644 --- a/tests/net_inet/ssl_errors.py +++ b/tests/net_inet/ssl_errors.py @@ -3,6 +3,10 @@ import sys, errno, select, socket, ssl +if not hasattr(ssl, "CERT_REQUIRED"): + print("SKIP") + raise SystemExit + def test(addr, hostname, block=True): print("---", hostname) diff --git a/tests/net_inet/test_sslcontext_client.py b/tests/net_inet/test_sslcontext_client.py index 77f68da49..bc06dc3c5 100644 --- a/tests/net_inet/test_sslcontext_client.py +++ b/tests/net_inet/test_sslcontext_client.py @@ -2,6 +2,10 @@ import os import socket import ssl +if not hasattr(ssl, "CERT_REQUIRED"): + print("SKIP") + raise SystemExit + # This certificate was obtained from micropython.org using openssl: # $ openssl s_client -showcerts -connect micropython.org:443 </dev/null 2>/dev/null # The certificate is from Let's Encrypt: diff --git a/tests/net_inet/test_tls_nonblock.py b/tests/net_inet/test_tls_nonblock.py index 60af858b1..3f9a61413 100644 --- a/tests/net_inet/test_tls_nonblock.py +++ b/tests/net_inet/test_tls_nonblock.py @@ -1,5 +1,12 @@ import socket, ssl, errno, sys, time, select +# Although this test doesn't need ssl.CERT_REQUIRED, it does require the ssl module +# to support modern ciphers. So exclude the test on axTLS which doesn't have +# CERT_REQUIRED. +if not hasattr(ssl, "CERT_REQUIRED"): + print("SKIP") + raise SystemExit + def test_one(site, opts): ai = socket.getaddrinfo(site, 443, socket.AF_INET) |
