Re: [PATCH 13/15] tests/functional: rewrite console handling to be bytewise

2024-11-20 Thread Paolo Bonzini
On 11/19/24 16:05, Daniel P. Berrangé wrote: The console interaction that waits for predicted strings uses readline(), and thus is only capable of waiting for strings that are followed by a newline. This is inconvenient when needing to match on some things, particularly login prompts, or shell p

Re: [PATCH 13/15] tests/functional: rewrite console handling to be bytewise

2024-11-19 Thread Paolo Bonzini
On 11/19/24 19:54, Daniel P. Berrangé wrote: +if success is None or success in msg: As an optimization, you could use msg.endswith(success) and msg.endswith(failure), which would avoid the most blatant cases of O(n^2) behavior. More important, I think "if success is None" should not be

Re: [PATCH 13/15] tests/functional: rewrite console handling to be bytewise

2024-11-19 Thread Daniel P . Berrangé
On Tue, Nov 19, 2024 at 06:11:10PM +0100, Paolo Bonzini wrote: > On 11/19/24 16:05, Daniel P. Berrangé wrote: > > The console interaction that waits for predicted strings uses > > readline(), and thus is only capable of waiting for strings > > that are followed by a newline. > > > > This is inconv

[PATCH 13/15] tests/functional: rewrite console handling to be bytewise

2024-11-19 Thread Daniel P . Berrangé
The console interaction that waits for predicted strings uses readline(), and thus is only capable of waiting for strings that are followed by a newline. This is inconvenient when needing to match on some things, particularly login prompts, or shell prompts, causing tests to use time.sleep(...) in