1
0
mirror of https://passt.top/passt synced 2024-11-09 14:19:56 +00:00
passt/test/lib
David Gibson d491a4099b test: Make handling of shell prompts with escapes a little more reliable
When using the old-style "pane" methods of executing commands during the
tests, we need to scan the shell output for prompts in order to tell when
commands have finished.  This is inherently unreliable because commands
could output things that look like prompts, and prompts might not look like
we expect them to.  The only way to really fix this is to use a better way
of dispatching commands, like the newer "context" system.

However, it's awkward to convert everything to "context" right at the
moment, so we're still relying on some tests that do work most of the time.
It is, however, particularly sensitive to fancy coloured prompts using
escape sequences.  Currently we try to handle this by stripping actual
ESC characters with tr, then looking for some common variants.

We can do a bit better: instead strip all escape sequences using sed before
looking for our prompt.  Or, at least, any one using [a-zA-Z] as the
terminating character. Strictly speaking ANSI escapes can be terminated by
any character in 0x40..0x7e, which isn't easily expressed in a regexp.
This should capture all common ones, though.

With this transformation we can simplify the list of patterns we then look
for as a prompt, removing some redundant variants.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-12-07 07:24:48 +01:00
..
context test: Use "nstool exec" to slightly simplify tests 2023-04-08 01:12:08 +02:00
layout passt: Relicense to GPL 2.0, or any later version 2023-04-06 18:00:33 +02:00
layout_ugly passt: Relicense to GPL 2.0, or any later version 2023-04-06 18:00:33 +02:00
perf_report test/lib/perf_report: Fix up table highlight for pasta's local flows 2023-11-10 06:35:54 +01:00
setup test: Use "nstool exec" to slightly simplify tests 2023-04-08 01:12:08 +02:00
setup_ugly passt: Relicense to GPL 2.0, or any later version 2023-04-06 18:00:33 +02:00
term test: Make handling of shell prompts with escapes a little more reliable 2023-12-07 07:24:48 +01:00
test test/perf: Start iperf3 server less often 2023-11-07 09:56:10 +01:00
util passt: Relicense to GPL 2.0, or any later version 2023-04-06 18:00:33 +02:00
video passt: Relicense to GPL 2.0, or any later version 2023-04-06 18:00:33 +02:00