Skip to content

Commit 2bba507

Browse files
committed
tests: Require SSL certificate file to be available for test to run.
Previously, any test needing an SSL certificate file would automatically skip if the file could not be found. But that makes it too easy to accidentally skip tests. Instead, change it so that the test fails if the certificate file doesn't exist. That matches, for example, the fact that the test fails if networking (LAN, WiFi) is not active. Signed-off-by: Damien George <damien@micropython.org>
1 parent a279c64 commit 2bba507

13 files changed

+0
-88
lines changed

tests/multi_net/asyncio_tls_server_client.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
cert = cafile = "ec_cert.der"
1515
key = "ec_key.der"
1616

17-
try:
18-
os.stat(cafile)
19-
os.stat(key)
20-
except OSError:
21-
print("SKIP")
22-
raise SystemExit
23-
2417

2518
async def handle_connection(reader, writer):
2619
data = await reader.read(100)

tests/multi_net/asyncio_tls_server_client_cert_required_error.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
cert = cafile = "ec_cert.der"
1515
key = "ec_key.der"
1616

17-
try:
18-
os.stat(cafile)
19-
os.stat(key)
20-
except OSError:
21-
print("SKIP")
22-
raise SystemExit
23-
2417

2518
async def handle_connection(reader, writer):
2619
print("handle connection")

tests/multi_net/asyncio_tls_server_client_readline.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
cert = cafile = "ec_cert.der"
1515
key = "ec_key.der"
1616

17-
try:
18-
os.stat(cafile)
19-
os.stat(key)
20-
except OSError:
21-
print("SKIP")
22-
raise SystemExit
23-
2417

2518
async def handle_connection(reader, writer):
2619
data = await reader.readline()

tests/multi_net/asyncio_tls_server_client_verify_error.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
cert = cafile = "ec_cert.der"
1515
key = "ec_key.der"
1616

17-
try:
18-
os.stat(cafile)
19-
os.stat(key)
20-
except OSError:
21-
print("SKIP")
22-
raise SystemExit
23-
2417

2518
async def handle_connection(reader, writer):
2619
print("handle connection")

tests/multi_net/ssl_cert_ec.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313
certfile = "ec_cert.der"
1414
keyfile = "ec_key.der"
1515

16-
try:
17-
os.stat(certfile)
18-
os.stat(keyfile)
19-
except OSError:
20-
print("SKIP")
21-
raise SystemExit
22-
2316
with open(certfile, "rb") as cf:
2417
cert = cadata = cf.read()
2518

tests/multi_net/ssl_cert_rsa.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313
certfile = "rsa_cert.der"
1414
keyfile = "rsa_key.der"
1515

16-
try:
17-
os.stat(certfile)
18-
os.stat(keyfile)
19-
except OSError:
20-
print("SKIP")
21-
raise SystemExit
22-
2316
with open(certfile, "rb") as cf:
2417
cert = cadata = cf.read()
2518

tests/multi_net/sslcontext_check_hostname_error.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
cert = cafile = "ec_cert.der"
1515
key = "ec_key.der"
1616

17-
try:
18-
os.stat(cafile)
19-
os.stat(key)
20-
except OSError:
21-
print("SKIP")
22-
raise SystemExit
23-
2417

2518
# Server
2619
def instance0():

tests/multi_net/sslcontext_getpeercert.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@
1515
cert = cafile = "ec_cert.der"
1616
key = "ec_key.der"
1717

18-
try:
19-
os.stat(cafile)
20-
os.stat(key)
21-
except OSError:
22-
print("SKIP")
23-
raise SystemExit
24-
2518

2619
# Server
2720
def instance0():

tests/multi_net/sslcontext_server_client_files.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
cert = cafile = "ec_cert.der"
1515
key = "ec_key.der"
1616

17-
try:
18-
os.stat(cafile)
19-
os.stat(key)
20-
except OSError:
21-
print("SKIP")
22-
raise SystemExit
23-
2417

2518
# Server
2619
def instance0():

tests/multi_net/sslcontext_verify_error.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
cert = cafile = "ec_cert.der"
1515
key = "ec_key.der"
1616

17-
try:
18-
os.stat(cafile)
19-
os.stat(key)
20-
except OSError:
21-
print("SKIP")
22-
raise SystemExit
23-
2417

2518
# Server
2619
def instance0():

0 commit comments

Comments
 (0)