mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tests/socket_zep: enable test on Murdock
Murdock does not support IPv6, so use IPv4 for the automated test.
This commit is contained in:
parent
e7be547920
commit
79891e9318
@ -2,10 +2,6 @@ include ../Makefile.tests_common
|
|||||||
|
|
||||||
BOARD_WHITELIST = native # socket_zep is only available on native
|
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 += od
|
||||||
USEMODULE += socket_zep
|
USEMODULE += socket_zep
|
||||||
USEMODULE += netdev
|
USEMODULE += netdev
|
||||||
|
@ -17,9 +17,9 @@ ZEP_DATA_HEADER_SIZE = 32
|
|||||||
FCS_LEN = 2
|
FCS_LEN = 2
|
||||||
RCVBUF_LEN = IEEE802154_FRAME_LEN_MAX + ZEP_DATA_HEADER_SIZE + FCS_LEN
|
RCVBUF_LEN = IEEE802154_FRAME_LEN_MAX + ZEP_DATA_HEADER_SIZE + FCS_LEN
|
||||||
zep_params = {
|
zep_params = {
|
||||||
"local_addr": "::",
|
"local_addr": "127.0.0.1",
|
||||||
"local_port": 12345,
|
"local_port": 12345,
|
||||||
"remote_addr": "::1",
|
"remote_addr": "127.0.0.1",
|
||||||
"remote_port": 17754,
|
"remote_port": 17754,
|
||||||
}
|
}
|
||||||
s = None
|
s = None
|
||||||
@ -28,8 +28,8 @@ s = None
|
|||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact("Socket ZEP device driver test")
|
child.expect_exact("Socket ZEP device driver test")
|
||||||
child.expect(r"Initializing socket ZEP with " +
|
child.expect(r"Initializing socket ZEP with " +
|
||||||
r"\(local: \[(?P<local_addr>[:0-9a-f]+)\]:(?P<local_port>\d+), " +
|
r"\(local: \[(?P<local_addr>[.0-9a-f]+)\]:(?P<local_port>\d+), " +
|
||||||
r"remote: \[(?P<remote_addr>[:0-9a-f]+)\]:(?P<remote_port>\d+)\)")
|
r"remote: \[(?P<remote_addr>[.0-9a-f]+)\]:(?P<remote_port>\d+)\)")
|
||||||
assert(child.match.group('local_addr') == zep_params['local_addr'])
|
assert(child.match.group('local_addr') == zep_params['local_addr'])
|
||||||
assert(int(child.match.group('local_port')) == zep_params['local_port'])
|
assert(int(child.match.group('local_port')) == zep_params['local_port'])
|
||||||
assert(child.match.group('remote_addr') == zep_params['remote_addr'])
|
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"\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"\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",
|
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(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"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")
|
child.expect_exact(r"00000010 0A 50 45 5A 00 48 65 6C 6C 6F 20 57 6F 72 6C 64")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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['local_addr'], zep_params['local_port'],
|
||||||
zep_params['remote_addr'], zep_params['remote_port'])
|
zep_params['remote_addr'], zep_params['remote_port'])
|
||||||
s = socket.socket(family=socket.AF_INET6, type=socket.SOCK_DGRAM)
|
s = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)
|
||||||
s.bind(("::", zep_params['remote_port']))
|
s.bind(("127.0.0.1", zep_params['remote_port']))
|
||||||
res = run(testfunc, timeout=1, echo=True, traceback=True)
|
res = run(testfunc, timeout=1, echo=True, traceback=True)
|
||||||
s.close()
|
s.close()
|
||||||
if (res == 0):
|
if (res == 0):
|
||||||
|
Loading…
Reference in New Issue
Block a user