[PATCH v3 1/3] dts: Improve output gathering in interactive shells

Juraj Linkeš juraj.linkes at pantheon.tech
Fri Jun 7 15:37:39 CEST 2024



On 29. 5. 2024 21:49, jspewock at iol.unh.edu wrote:
> From: Jeremy Spewock <jspewock at iol.unh.edu>
> 
> The current implementation of consuming output from interactive shells
> relies on being able to find an expected prompt somewhere within the
> output buffer after sending the command. This is useful in situations
> where the prompt does not appear in the output itself, but in some
> practical cases (such as the starting of an XML-RPC server for scapy)
> the prompt exists in one of the commands sent to the shell and this can
> cause the command to exit early and creates a race condition between the
> server starting and the first command being sent to the server.
> 
> This patch addresses this problem by searching for a line that strictly
> ends with the provided prompt, rather than one that simply contains it,
> so that the detection that a command is finished is more consistent. It
> also adds a catch to detect when a command times out before finding the
> prompt or the underlying SSH session dies so that the exception can be
> wrapped into a more explicit one and be more consistent with the
> non-interactive shells.
> 
> Bugzilla ID: 1359
> Fixes: 88489c0501af ("dts: add smoke tests")
> 
> Signed-off-by: Jeremy Spewock <jspewock at iol.unh.edu>

Reviewed-by: Juraj Linkeš <juraj.linkes at pantheon.tech>


More information about the dev mailing list