tests: add test with incomplete packet header
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 15 Aug 2022 18:02:39 +0000 (14:02 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 4 Sep 2024 19:05:14 +0000 (15:05 -0400)
commitebb858ae79292e5f25546c2caed66dd5195a7658
tree5528154a82e2f025aef27b24bb3e358c8639b5cb
parent909f16f5231aa93488f290dc9b14ae4c209e440e
tests: add test with incomplete packet header

During developement we hit a problem where src.ctf.fs's medium returned
less data than the `minSize` parameter, when reading a faulty trace.
The trace added in this patch reproduces the problem.  It consists of a
full packet, followed by a single byte.  When trying to read a second
packet, the ItemSeqIter instance would ask the medium for at least two
bytes, but the medium would return a buffer with a single byte (the data
available until the end of file).  The fix was to make the medium
generate an error in this case.

Change-Id: I9a79360b18091f517846ca2be94fbf10fb9af349
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12753
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
tests/data/ctf-traces/1/fail/incomplete-packet-header/metadata [new file with mode: 0644]
tests/data/ctf-traces/1/fail/incomplete-packet-header/stream [new file with mode: 0644]
tests/plugins/src.ctf.fs/fail/test-fail.sh
This page took 0.025182 seconds and 4 git commands to generate.