ussl_basic.py.exp test results are wrong for calling close twice?
Encountered while updating to MicroPython 1.20.0.
In tests/extmod/ussl_basic.py, we call close() twice.
https://github.com/micropython/micropython/blob/294baf52b346e400e2255c6c1e82af5b978b18f7/tests/extmod/ussl_basic.py#L54-L57
This prints TestSocket.ioctl 4 0 because of:
https://github.com/micropython/micropython/blob/294baf52b346e400e2255c6c1e82af5b978b18f7/tests/extmod/ussl_basic.py#L18-L20
However, in the .exp file, we are only expecting it to print once (and CI is passing with this):
https://github.com/micropython/micropython/blob/294baf52b346e400e2255c6c1e82af5b978b18f7/tests/extmod/ussl_basic.py.exp#L5
Using one of our Pybricks builds, we are getting the output printed twice though, which seems expected since close() was called twice.
--- /home/runner/work/pybricks-micropython/pybricks-micropython/micropython/tests/results/extmod_ussl_basic.py.exp 2023-04-26 22:57:31.882920388 +0000
+++ /home/runner/work/pybricks-micropython/pybricks-micropython/micropython/tests/results/extmod_ussl_basic.py.out 2023-04-26 22:57:31.882920388 +0000
@@ -3,5 +3,6 @@
TestSocket.setblocking(False)
TestSocket.setblocking(True)
TestSocket.ioctl 4 0
+TestSocket.ioctl 4 0
OSError: read
OSError: write
What is the difference? Our build still uses axtls instead of mbed, but since both implementations use the standard MicroPython stream implementations for close, etc. I don't see what the difference could be.
tests/extmod/ussl_basic.py fails for modussl_mbedtls
Well, subj. ussl_basic.py is coded too much relying on modussl_axtls behavior.
--- extmod_ussl_basic.py.exp 2018-12-16 22:45:07.539600906 +0300
+++ extmod_ussl_basic.py.out 2018-12-16 22:45:07.539600906 +0300
@@ -1,9 +1,7 @@
-ssl_handshake_status: -256
+mbedtls_ssl_handshake error: -7280
wrap_socket: OSError(5,)
-<_SSLSocket
-setblocking: NotImplementedError
-4
-b''
-read: OSError(-261,)
-read: OSError(9,)
-write: OSError(9,)
+mbedtls_ssl_handshake error: -7280
+Traceback (most recent call last):
+ File "extmod/ussl_basic.py", line 18, in <module>
+OSError: [Errno 5] EIO
+CRASH