[riot-notifications] [RIOT-OS/RIOT] tests: provide testcase for issue 11398 (#11401)

Gaƫtan Harter notifications at github.com
Tue Apr 30 20:09:15 CEST 2019


cladmi commented on this pull request.



> +    global the_socket
+    assert(the_socket is not None)
+    now = int(system_to_ntp_time(time.time()))
+    payload = b"\x01\xdc\x00\x23\x00\x5a\x45\x00\x0a\x50\x45\x5a\x00"
+    packet = struct.pack(ZEP_HDR, b"EX", ZEP_V2_VERSION,
+                         ZEP_V2_TYPE_DATA, 26, 1, 1, 0xff,
+                         now, 0, 1, len(payload)) + payload
+    the_socket.sendto(packet, ("::1", 17755))
+    res = child.expect([TIMEOUT, EOF, "PKTDUMP: data received:"])
+    # we actually want the timeout here. The application either receives a
+    # bogus packet or crashes in an error case case
+    assert(res == 0)
+
+
+if __name__ == "__main__":
+    with socket.socket(socket.AF_INET6, socket.SOCK_DGRAM) as s:

It could happen if it was a tcp socket there or any other required environment.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11401#discussion_r279872669
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190430/546f82fa/attachment-0001.html>


More information about the notifications mailing list