From 3f1df4bacb2aa8f9018011c6a61eff9247248e1b Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 29 Apr 2025 10:24:52 +1000 Subject: [PATCH] tests/net_hosted: Only run network loopback test on supported targets. Only a few ports have TCP/IP loopback enabled in their network stack, and this test will only pass on those ports. There's not really any good way to do a feature check for loopback mode without actually running the test and seeing if it passes/fails, so add an explicit check that the test is running on a port known to support loopback. (Enabling loopback on lwIP, eg RPI_PICO_W, costs +568 code and +272 bss and is a rarely used feature, so not worth unconditionally enabling.) Signed-off-by: Damien George --- tests/net_hosted/asyncio_loopback.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/net_hosted/asyncio_loopback.py b/tests/net_hosted/asyncio_loopback.py index fd4674544..03513ae62 100644 --- a/tests/net_hosted/asyncio_loopback.py +++ b/tests/net_hosted/asyncio_loopback.py @@ -1,5 +1,12 @@ # Test network loopback behaviour +import sys + +# Only certain platforms can do TCP/IP loopback. +if sys.platform not in ("darwin", "esp32", "linux"): + print("SKIP") + raise SystemExit + try: import asyncio except ImportError: