refactor(expect): introduce timeout Expect script fragment
This change introduces an Expect script fragment for handling timeouts
sanely on both the on-premises CI and the OpenCI.
The two CI systems need a different mechanism for dealing with timeouts
because they both read from the UARTs in different ways. In the OpenCI,
an Expect script cannot "time out" in the conventional sense because
UART logs are generated by LAVA and merely read from the log file by
Expect. This differs from the on-premises CI, which spawns a telnet
terminal to read UART output live.
Timeouts must therefore look for both a real timeout and the stream EOF.
If either of these are encountered then the script exits with success,
otherwise it exits with failure.
Additionally, the fragment looks for common failure cases - "hung" UARTs
should neither include a crash dump nor reach the end of TFTF.
Signed-off-by: Chris Kay <chris.kay@arm.com>
Change-Id: Ic15df36fc563458734a64e61420f29bcf09ea566
(cherry picked from commit 38c68965ceafedb36cdf3eb0b64a5160db1486c0)
4 files changed