From 79891e93181dca6fc2f2086dce0e49fec2566499 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Tue, 21 Dec 2021 16:53:27 +0100 Subject: [PATCH] tests/socket_zep: enable test on Murdock Murdock does not support IPv6, so use IPv4 for the automated test. --- tests/socket_zep/Makefile | 4 ---- tests/socket_zep/tests/01-run.py | 16 ++++++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/tests/socket_zep/Makefile b/tests/socket_zep/Makefile index 0073b01ed6..b3131fa859 100644 --- a/tests/socket_zep/Makefile +++ b/tests/socket_zep/Makefile @@ -2,10 +2,6 @@ include ../Makefile.tests_common BOARD_WHITELIST = native # socket_zep is only available on native -# Cannot run the test on `murdock` -# ZEP: Unable to connect socket: Cannot assign requested address -TEST_ON_CI_BLACKLIST += native - USEMODULE += od USEMODULE += socket_zep USEMODULE += netdev diff --git a/tests/socket_zep/tests/01-run.py b/tests/socket_zep/tests/01-run.py index 400f0cd095..b72f66137b 100755 --- a/tests/socket_zep/tests/01-run.py +++ b/tests/socket_zep/tests/01-run.py @@ -17,9 +17,9 @@ ZEP_DATA_HEADER_SIZE = 32 FCS_LEN = 2 RCVBUF_LEN = IEEE802154_FRAME_LEN_MAX + ZEP_DATA_HEADER_SIZE + FCS_LEN zep_params = { - "local_addr": "::", + "local_addr": "127.0.0.1", "local_port": 12345, - "remote_addr": "::1", + "remote_addr": "127.0.0.1", "remote_port": 17754, } s = None @@ -28,8 +28,8 @@ s = None def testfunc(child): child.expect_exact("Socket ZEP device driver test") child.expect(r"Initializing socket ZEP with " + - r"\(local: \[(?P[:0-9a-f]+)\]:(?P\d+), " + - r"remote: \[(?P[:0-9a-f]+)\]:(?P\d+)\)") + r"\(local: \[(?P[.0-9a-f]+)\]:(?P\d+), " + + r"remote: \[(?P[.0-9a-f]+)\]:(?P\d+)\)") assert(child.match.group('local_addr') == zep_params['local_addr']) assert(int(child.match.group('local_port')) == zep_params['local_port']) assert(child.match.group('remote_addr') == zep_params['remote_addr']) @@ -44,18 +44,18 @@ def testfunc(child): b"\xfd\xae\x60\xd3\x21\xf1\x00\x00\x00\x00\x00\x00\x00\x00\x00" + b"\x00\x22\x41\xdc\x02\x23\x00\x38\x30\x00\x0a\x50\x45\x5a\x00" + b"\x5b\x45\x00\x0a\x50\x45\x5a\x00Hello World\x3a\xf2", - ("::1", zep_params['local_port'])) + ("127.0.0.1", zep_params['local_port'])) child.expect(r"RSSI: \d+, LQI: \d+, Data:") child.expect_exact(r"00000000 41 DC 02 23 00 38 30 00 0A 50 45 5A 00 5B 45 00") child.expect_exact(r"00000010 0A 50 45 5A 00 48 65 6C 6C 6F 20 57 6F 72 6C 64") if __name__ == "__main__": - os.environ['TERMFLAGS'] = "-z [%s]:%d,[%s]:%d" % ( + os.environ['TERMFLAGS'] = "--eui64=00:5a:45:50:0a:00:30:38 -z [%s]:%d,[%s]:%d" % ( zep_params['local_addr'], zep_params['local_port'], zep_params['remote_addr'], zep_params['remote_port']) - s = socket.socket(family=socket.AF_INET6, type=socket.SOCK_DGRAM) - s.bind(("::", zep_params['remote_port'])) + s = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM) + s.bind(("127.0.0.1", zep_params['remote_port'])) res = run(testfunc, timeout=1, echo=True, traceback=True) s.close() if (res == 0):