diff --git a/tests/core/msg_queue_print/tests/01-run.py b/tests/core/msg_queue_print/tests/01-run.py index a03118d268..21ae8441a1 100755 --- a/tests/core/msg_queue_print/tests/01-run.py +++ b/tests/core/msg_queue_print/tests/01-run.py @@ -46,7 +46,7 @@ def expect_content(child, counter): else: child.expect(r'type: 0x0000, content: 0 \((0x)?0+\)') else: - child.expect_exact(f'type: 0x{counter:04x}, content: {counter} (0x{counter:x})') + child.expect(f'type: 0x{counter:04x}, content: {counter} \((0x)?0*{counter:x}\)') def testfunc(child): diff --git a/tests/net/gnrc_ipv6_fwd_w_sub/tests/01-run.py b/tests/net/gnrc_ipv6_fwd_w_sub/tests/01-run.py index be26456e31..a30698236b 100755 --- a/tests/net/gnrc_ipv6_fwd_w_sub/tests/01-run.py +++ b/tests/net/gnrc_ipv6_fwd_w_sub/tests/01-run.py @@ -31,10 +31,11 @@ def testfunc(child): child.expect(r"00000020 55 44 33 FF FE 22 11 00 54 B8 59 AF 3A B4 5C 85") child.expect(r"00000030 1E CE E2 EB 05 4E A3 85") child.sendline("pktbuf") - child.expect(r"packet buffer: first byte: (0x[0-9a-fA-F]+), " - r"last byte: 0x[0-9a-fA-F]+ \(size: (\d+)\)") + child.expect(r"packet buffer: first byte: ((0x)?[0-9a-fA-F]+), " + r"last byte: (0x)?[0-9a-fA-F]+ \(size: (\d+)\)") start_addr = child.match.group(1) - size = child.match.group(2) + size = child.match.group(4) + print(start_addr, size) child.expect(r" position of last byte used: \d+") child.expect(r"~ unused: {} \(next: (\(nil\)|0(x0+)?), size: +{}\) ~" .format(start_addr, size)) diff --git a/tests/riotboot/tests/01-run.py b/tests/riotboot/tests/01-run.py index a4bba6be03..f2c820b120 100755 --- a/tests/riotboot/tests/01-run.py +++ b/tests/riotboot/tests/01-run.py @@ -66,9 +66,9 @@ class RiotbootDevice: # Ask for data of all slots child.expect_exact('>') child.sendline("dumpaddrs") - child.expect(r"slot 0: metadata: 0x[0-9a-fA-F]{1,8} " + child.expect(r"slot 0: metadata: (0x)?[0-9a-fA-F]{1,8} " r"image: 0x[0-9a-fA-F]{8}\r\n") - child.expect(r"slot 1: metadata: 0x[0-9a-fA-F]{1,8} " + child.expect(r"slot 1: metadata: (0x)?[0-9a-fA-F]{1,8} " r"image: 0x[0-9a-fA-F]{8}\r\n") child.expect_exact('>') diff --git a/tests/sys/heap_cmd/tests/01-run.py b/tests/sys/heap_cmd/tests/01-run.py index 92010ccd40..6f058b0c5e 100755 --- a/tests/sys/heap_cmd/tests/01-run.py +++ b/tests/sys/heap_cmd/tests/01-run.py @@ -17,14 +17,14 @@ def testfunc(child): if ret == 1: return child.sendline('malloc 100') - child.expect('allocated 0x') + child.expect('allocated (0x)?') addr = child.readline() addr = addr[:-2] child.expect_exact('> ') child.sendline('heap') child.expect(r'heap: \d+ \(used \d+, free \d+\) \[bytes\]') child.sendline('free 0x' + addr) - child.expect('freeing 0x' + addr) + child.expect('freeing (0x)?' + addr) child.expect_exact('>') child.sendline('heap') child.expect(r'heap: \d+ \(used \d+, free \d+\) \[bytes\]') diff --git a/tests/sys/malloc/tests/01-run.py b/tests/sys/malloc/tests/01-run.py index 622d59a028..ae81657f77 100755 --- a/tests/sys/malloc/tests/01-run.py +++ b/tests/sys/malloc/tests/01-run.py @@ -22,7 +22,7 @@ def testfunc(child): number_of_tests = int(child.match.group(1)) initial_allocations = 0 for _ in range(number_of_tests): - child.expect(r"Allocated {} Bytes at 0x[a-z0-9]+, total [a-z0-9]+\r\n" + child.expect(r"Allocated {} Bytes at (0x)?[a-z0-9]+, total [a-z0-9]+\r\n" .format(chunk_size)) child.expect(r'Allocations count: (\d+)\r\n', timeout=ALLOCATION_TIMEOUT) @@ -31,7 +31,7 @@ def testfunc(child): if initial_allocations == 0: initial_allocations = allocations assert initial_allocations == allocations - child.expect(r"Free {} Bytes at 0x[a-z0-9]+, total [a-z0-9]+\r\n" + child.expect(r"Free {} Bytes at (0x)?[a-z0-9]+, total [a-z0-9]+\r\n" .format(chunk_size)) child.expect(r'Free count: (\d+)\r\n', timeout=FREE_TIMEOUT) freed = int(child.match.group(1)) diff --git a/tests/sys/memarray/tests/01-run.py b/tests/sys/memarray/tests/01-run.py index 68de6a6848..cb7f51f9eb 100755 --- a/tests/sys/memarray/tests/01-run.py +++ b/tests/sys/memarray/tests/01-run.py @@ -22,10 +22,10 @@ def testfunc(child): for test in range(number_of_tests): child.expect_exact("TEST #{}:".format(test + 1)) for i in range(max_number_blocks): - child.expect(r'\({}, @@@@@@@\) Allocated \d+ Bytes at 0x[a-z0-9]+,' + child.expect(r'\({}, @@@@@@@\) Allocated \d+ Bytes at (0x)?[a-zA-Z0-9]+,' r' total [0-9]+\r\n'.format(i)) for i in range(max_number_blocks): - child.expect(r'Free \({}\) \d+ Bytes at 0x[a-z0-9]+,' + child.expect(r'Free \({}\) \d+ Bytes at (0x)?[a-zA-Z0-9]+,' ' total [0-9]+\r\n'.format(i)) child.expect_exact("Extend and reduce tests")