From d2ec12d28bdfc19184944d3214abe5d481246048 Mon Sep 17 00:00:00 2001 From: Simon Brummer Date: Wed, 14 Oct 2020 16:05:15 +0200 Subject: [PATCH] gnrc_tcp: fix test part 2 --- tests/gnrc_tcp/tests/05-garbage-pkts.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/gnrc_tcp/tests/05-garbage-pkts.py b/tests/gnrc_tcp/tests/05-garbage-pkts.py index bd7263b65b23..c20a94694a92 100755 --- a/tests/gnrc_tcp/tests/05-garbage-pkts.py +++ b/tests/gnrc_tcp/tests/05-garbage-pkts.py @@ -97,17 +97,16 @@ def test_short_header(child, src_if, src_ll, dst_if, dst_l2, dst_ll, dst_port): @testfunc def test_send_ack_instead_of_syn(child, src_if, src_ll, dst_if, dst_l2, dst_ll, dst_port): - # check if entering _event_loop in `@testfunc` decorator generates debug - # output - debug = child.expect([pexpect.TIMEOUT, 'GNRC_TCP'], timeout=1) - # with debug output the node can be overwhelmed by packets + output + # check if any debug output is generated during `@testfunc` decorator + # execution. If so, send fewer packets to prevent the target node + # from being overwhelmed by packets and output. + debug = child.expect([pexpect.TIMEOUT, + r'GNRC_TCP: Enter "\S+", File: .+(\d+)\s'], timeout=1) if debug: count = 10 else: count = 1000 - print(debug) - print(count) # see https://github.com/RIOT-OS/RIOT/pull/12001 provided_data = base64.b64decode("rwsQf2pekYLaU+exUBBwgPDKAAA=") tcp_hdr = TCP(provided_data)