tests: factor out discarded packet regex in test-packet-seq-num.sh
authorSimon Marchi <simon.marchi@efficios.com>
Sat, 5 Oct 2024 01:08:40 +0000 (21:08 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 9 Oct 2024 02:56:57 +0000 (22:56 -0400)
commitc755b631564a45aa270ad8c4735dde19dd87544b
tree081f21e4a53185f259d19312a0526501b9bc52a5
parent2b98bf4b5e58eea9d46472512224d55fdb017597
tests: factor out discarded packet regex in test-packet-seq-num.sh

The regex used in `test_no_lost()` is outdated, which means that if
Babeltrace were to emit an unexpected discarded packets message, the
test would not catch it.  Fix it by factoring the regex used to look for
discarded packets messages.  At least now, we can have the confidence
that we're looking for the right thing, otherwise the `test_lost()`
tests wouldn't pass.

In general, it's fragile to check for the absence of something, since a
typo or change in what to look can easily make the test uneffective.  I
initially re-wrote this test in Python (the test is in the `cli`
directory, but its intent is more to validate the source's behavior than
to validate the CLI's behavior), but this simple change seems good
enough for now.

Change-Id: I9f8c30a567fa6f5036cadcc4691c3bd6f953ca3d
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/13309
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
tests/cli/test-packet-seq-num.sh
This page took 0.024382 seconds and 4 git commands to generate.