micropython/tests/net_hosted
Damien George 69023622ee tests/net_hosted: Improve and simplify non-block-xfer test.
CPython changed its non-blocking socket behaviour recently and this test
would not run under CPython anymore.  So the following steps were taken to
get the test working again and then simplify it:

- Run the test against CPython 3.10.10 and capture the output into the .exp
  file for the test.

- Run this test on unix port of MicroPython and verify that the output
  matches the CPython 3.10.10 output in the new .exp file (it did).  From
  now on take unix MicroPython as the source of truth for this test when
  modifying it.

- Remove all code that was there for CPython compatibility.

- Make it print out more useful information during the test run, including
  names of the OSError errno values.

- Add polling of the socket before the send/write/recv/read to verify that
  the poll gives the correct result in non-blocking mode.

Tested on unix MicroPython, ESP32_GENERIC, PYBD_SF2 and RPI_PICO_W boards.

Signed-off-by: Damien George <damien@micropython.org>
2024-11-13 11:44:09 +11:00
..
accept_nonblock.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
accept_nonblock.py.exp tests/net_inet: Move tests which don't require full Internet to net_hosted. 2017-06-23 21:12:32 +03:00
accept_timeout.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
accept_timeout.py.exp tests/net_inet: Move tests which don't require full Internet to net_hosted. 2017-06-23 21:12:32 +03:00
asyncio_loopback.py tests/net_hosted/asyncio_loopback.py: Add loopback test. 2023-11-17 13:37:43 +11:00
asyncio_loopback.py.exp tests/net_hosted/asyncio_loopback.py: Add loopback test. 2023-11-17 13:37:43 +11:00
asyncio_start_server.py extmod/asyncio/stream.py: Fix cancellation handling of start_server. 2023-10-02 14:11:52 +11:00
asyncio_start_server.py.exp extmod/asyncio/stream.py: Fix cancellation handling of start_server. 2023-10-02 14:11:52 +11:00
connect_nonblock_xfer.py tests/net_hosted: Improve and simplify non-block-xfer test. 2024-11-13 11:44:09 +11:00
connect_nonblock_xfer.py.exp tests/net_hosted: Improve and simplify non-block-xfer test. 2024-11-13 11:44:09 +11:00
connect_nonblock.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
connect_nonblock.py.exp tests/net_inet: Move tests which don't require full Internet to net_hosted. 2017-06-23 21:12:32 +03:00
connect_poll.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
connect_poll.py.exp extmod/modlwip: Unconditionally return POLLHUP when polling new socket. 2019-10-31 12:54:37 +11:00
connect_timeout.py extmod/modlwip: Make socket.connect raise ETIMEDOUT on non-zero timeout. 2024-06-08 09:02:01 +10:00
README all: Fix spelling mistakes based on codespell check. 2023-04-27 18:03:06 +10:00
ssl_getpeercert.py extmod/modssl_mbedtls: Make SSLSocket.getpeercert() optional. 2023-12-12 21:21:54 +11:00
ssl_getpeercert.py.exp extmod/modussl_mbedtls.c: Add ussl.getpeercert() method. 2017-08-16 15:01:00 +10:00
ssl_verify_callback.py extmod/modtls_mbedtls: Implement cert verification callback for mbedtls. 2024-02-07 13:00:57 +11:00
ssl_verify_callback.py.exp tests/net_hosted/ssl_verify_callback.py: Make exp match actual output. 2024-05-27 13:56:55 +10:00

This directory contains network tests which require just "peer to peer"
network connection between test host and device under test, instead of
full Internet connection.

Note that setup for these tests and tests themselves are WIP, and may
not yet fully correspond to the functional specification above.

So far, these tests are not run as part of the main testsuite and need
to be run separately (from the main test/ directory):

    ./run-tests.py net_hosted/*.py