All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] tests/avocado: apply a band aid to aspeed-evb login
@ 2022-08-11 11:43 Alex Bennée
  2022-08-11 11:55 ` Cédric Le Goater
  2022-08-11 14:08 ` John Snow
  0 siblings, 2 replies; 6+ messages in thread
From: Alex Bennée @ 2022-08-11 11:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alex Bennée, Cédric Le Goater, John Snow, Cleber Rosa,
	Philippe Mathieu-Daudé,
	Wainer dos Santos Moschetta, Beraldo Leal

This is really a limitation of the underlying console code which
doesn't allow us to detect the login: and following "#" prompts
because it reads input line wise. By adding a small delay we ensure
that the login prompt has appeared so we don't accidentally spaff the
shell commands to a confused getty in the guest.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Cédric Le Goater <clg@kaod.org>
Cc: John Snow <jsnow@redhat.com>
---
 tests/avocado/machine_aspeed.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed.py
index c54da0fd8f..65d38f4efa 100644
--- a/tests/avocado/machine_aspeed.py
+++ b/tests/avocado/machine_aspeed.py
@@ -101,7 +101,9 @@ def do_test_arm_aspeed_buidroot_start(self, image, cpu_id):
         self.wait_for_console_pattern('Starting kernel ...')
         self.wait_for_console_pattern('Booting Linux on physical CPU ' + cpu_id)
         self.wait_for_console_pattern('lease of 10.0.2.15')
+        # the line before login:
         self.wait_for_console_pattern('Aspeed EVB')
+        time.sleep(0.1)
         exec_command(self, 'root')
         time.sleep(0.1)
 
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [RFC PATCH] tests/avocado: apply a band aid to aspeed-evb login
  2022-08-11 11:43 [RFC PATCH] tests/avocado: apply a band aid to aspeed-evb login Alex Bennée
@ 2022-08-11 11:55 ` Cédric Le Goater
  2022-08-11 13:27   ` Alex Bennée
  2022-08-11 14:08 ` John Snow
  1 sibling, 1 reply; 6+ messages in thread
From: Cédric Le Goater @ 2022-08-11 11:55 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: John Snow, Cleber Rosa, Philippe Mathieu-Daudé,
	Wainer dos Santos Moschetta, Beraldo Leal

On 8/11/22 13:43, Alex Bennée wrote:
> This is really a limitation of the underlying console code which
> doesn't allow us to detect the login: and following "#" prompts
> because it reads input line wise. By adding a small delay we ensure
> that the login prompt has appeared so we don't accidentally spaff the
> shell commands to a confused getty in the guest.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Cc: Cédric Le Goater <clg@kaod.org>
> Cc: John Snow <jsnow@redhat.com>


May be you should also add the missing timeout setting ?

Anyhow,

Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.

> ---
>   tests/avocado/machine_aspeed.py | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed.py
> index c54da0fd8f..65d38f4efa 100644
> --- a/tests/avocado/machine_aspeed.py
> +++ b/tests/avocado/machine_aspeed.py
> @@ -101,7 +101,9 @@ def do_test_arm_aspeed_buidroot_start(self, image, cpu_id):
>           self.wait_for_console_pattern('Starting kernel ...')
>           self.wait_for_console_pattern('Booting Linux on physical CPU ' + cpu_id)
>           self.wait_for_console_pattern('lease of 10.0.2.15')
> +        # the line before login:
>           self.wait_for_console_pattern('Aspeed EVB')
> +        time.sleep(0.1)
>           exec_command(self, 'root')
>           time.sleep(0.1)
>   



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC PATCH] tests/avocado: apply a band aid to aspeed-evb login
  2022-08-11 11:55 ` Cédric Le Goater
@ 2022-08-11 13:27   ` Alex Bennée
  0 siblings, 0 replies; 6+ messages in thread
From: Alex Bennée @ 2022-08-11 13:27 UTC (permalink / raw)
  To: Cédric Le Goater
  Cc: qemu-devel, John Snow, Cleber Rosa, Philippe Mathieu-Daudé,
	Wainer dos Santos Moschetta, Beraldo Leal


Cédric Le Goater <clg@kaod.org> writes:

> On 8/11/22 13:43, Alex Bennée wrote:
>> This is really a limitation of the underlying console code which
>> doesn't allow us to detect the login: and following "#" prompts
>> because it reads input line wise. By adding a small delay we ensure
>> that the login prompt has appeared so we don't accidentally spaff the
>> shell commands to a confused getty in the guest.
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> Cc: Cédric Le Goater <clg@kaod.org>
>> Cc: John Snow <jsnow@redhat.com>
>
>
> May be you should also add the missing timeout setting ?

That's in another patch - I'll post the whole series now.
>
> Anyhow,
>
> Reviewed-by: Cédric Le Goater <clg@kaod.org>
>
> Thanks,
>
> C.
>
>> ---
>>   tests/avocado/machine_aspeed.py | 2 ++
>>   1 file changed, 2 insertions(+)
>> diff --git a/tests/avocado/machine_aspeed.py
>> b/tests/avocado/machine_aspeed.py
>> index c54da0fd8f..65d38f4efa 100644
>> --- a/tests/avocado/machine_aspeed.py
>> +++ b/tests/avocado/machine_aspeed.py
>> @@ -101,7 +101,9 @@ def do_test_arm_aspeed_buidroot_start(self, image, cpu_id):
>>           self.wait_for_console_pattern('Starting kernel ...')
>>           self.wait_for_console_pattern('Booting Linux on physical CPU ' + cpu_id)
>>           self.wait_for_console_pattern('lease of 10.0.2.15')
>> +        # the line before login:
>>           self.wait_for_console_pattern('Aspeed EVB')
>> +        time.sleep(0.1)
>>           exec_command(self, 'root')
>>           time.sleep(0.1)
>>   


-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC PATCH] tests/avocado: apply a band aid to aspeed-evb login
  2022-08-11 11:43 [RFC PATCH] tests/avocado: apply a band aid to aspeed-evb login Alex Bennée
  2022-08-11 11:55 ` Cédric Le Goater
@ 2022-08-11 14:08 ` John Snow
  2022-08-11 14:18   ` Cédric Le Goater
  2022-08-11 14:30   ` Alex Bennée
  1 sibling, 2 replies; 6+ messages in thread
From: John Snow @ 2022-08-11 14:08 UTC (permalink / raw)
  To: Alex Bennée
  Cc: qemu-devel, Cédric Le Goater, Cleber Rosa,
	Philippe Mathieu-Daudé,
	Wainer dos Santos Moschetta, Beraldo Leal

On Thu, Aug 11, 2022 at 7:43 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>
> This is really a limitation of the underlying console code which
> doesn't allow us to detect the login: and following "#" prompts
> because it reads input line wise. By adding a small delay we ensure
> that the login prompt has appeared so we don't accidentally spaff the
> shell commands to a confused getty in the guest.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Cc: Cédric Le Goater <clg@kaod.org>
> Cc: John Snow <jsnow@redhat.com>
> ---
>  tests/avocado/machine_aspeed.py | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed.py
> index c54da0fd8f..65d38f4efa 100644
> --- a/tests/avocado/machine_aspeed.py
> +++ b/tests/avocado/machine_aspeed.py
> @@ -101,7 +101,9 @@ def do_test_arm_aspeed_buidroot_start(self, image, cpu_id):
>          self.wait_for_console_pattern('Starting kernel ...')
>          self.wait_for_console_pattern('Booting Linux on physical CPU ' + cpu_id)
>          self.wait_for_console_pattern('lease of 10.0.2.15')
> +        # the line before login:
>          self.wait_for_console_pattern('Aspeed EVB')
> +        time.sleep(0.1)
>          exec_command(self, 'root')
>          time.sleep(0.1)
>
> --
> 2.30.2
>

Augh. Sorry my hunch was wrong. I wasn't aware of this problem.

Is ... this 0.1 second sleep really sufficient? I guess it's better
than not having it, and I can't reasonably ask for something more
thorough.

Acked-by: John Snow <jsnow@redhat.com>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC PATCH] tests/avocado: apply a band aid to aspeed-evb login
  2022-08-11 14:08 ` John Snow
@ 2022-08-11 14:18   ` Cédric Le Goater
  2022-08-11 14:30   ` Alex Bennée
  1 sibling, 0 replies; 6+ messages in thread
From: Cédric Le Goater @ 2022-08-11 14:18 UTC (permalink / raw)
  To: John Snow, Alex Bennée
  Cc: qemu-devel, Cleber Rosa, Philippe Mathieu-Daudé,
	Wainer dos Santos Moschetta, Beraldo Leal

On 8/11/22 16:08, John Snow wrote:
> On Thu, Aug 11, 2022 at 7:43 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>>
>> This is really a limitation of the underlying console code which
>> doesn't allow us to detect the login: and following "#" prompts
>> because it reads input line wise. By adding a small delay we ensure
>> that the login prompt has appeared so we don't accidentally spaff the
>> shell commands to a confused getty in the guest.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> Cc: Cédric Le Goater <clg@kaod.org>
>> Cc: John Snow <jsnow@redhat.com>
>> ---
>>   tests/avocado/machine_aspeed.py | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed.py
>> index c54da0fd8f..65d38f4efa 100644
>> --- a/tests/avocado/machine_aspeed.py
>> +++ b/tests/avocado/machine_aspeed.py
>> @@ -101,7 +101,9 @@ def do_test_arm_aspeed_buidroot_start(self, image, cpu_id):
>>           self.wait_for_console_pattern('Starting kernel ...')
>>           self.wait_for_console_pattern('Booting Linux on physical CPU ' + cpu_id)
>>           self.wait_for_console_pattern('lease of 10.0.2.15')
>> +        # the line before login:
>>           self.wait_for_console_pattern('Aspeed EVB')
>> +        time.sleep(0.1)
>>           exec_command(self, 'root')
>>           time.sleep(0.1)
>>
>> --
>> 2.30.2
>>
> 
> Augh. Sorry my hunch was wrong. I wasn't aware of this problem.
> 
> Is ... this 0.1 second sleep really sufficient? I guess it's better
> than not having it, and I can't reasonably ask for something more
> thorough.

tests/avocado/machine_aarch64_virt.py has a few of these for the same
reason I guess.

C.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC PATCH] tests/avocado: apply a band aid to aspeed-evb login
  2022-08-11 14:08 ` John Snow
  2022-08-11 14:18   ` Cédric Le Goater
@ 2022-08-11 14:30   ` Alex Bennée
  1 sibling, 0 replies; 6+ messages in thread
From: Alex Bennée @ 2022-08-11 14:30 UTC (permalink / raw)
  To: John Snow
  Cc: qemu-devel, Cédric Le Goater, Cleber Rosa,
	Philippe Mathieu-Daudé,
	Wainer dos Santos Moschetta, Beraldo Leal


John Snow <jsnow@redhat.com> writes:

> On Thu, Aug 11, 2022 at 7:43 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>>
>> This is really a limitation of the underlying console code which
>> doesn't allow us to detect the login: and following "#" prompts
>> because it reads input line wise. By adding a small delay we ensure
>> that the login prompt has appeared so we don't accidentally spaff the
>> shell commands to a confused getty in the guest.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> Cc: Cédric Le Goater <clg@kaod.org>
>> Cc: John Snow <jsnow@redhat.com>
>> ---
>>  tests/avocado/machine_aspeed.py | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed.py
>> index c54da0fd8f..65d38f4efa 100644
>> --- a/tests/avocado/machine_aspeed.py
>> +++ b/tests/avocado/machine_aspeed.py
>> @@ -101,7 +101,9 @@ def do_test_arm_aspeed_buidroot_start(self, image, cpu_id):
>>          self.wait_for_console_pattern('Starting kernel ...')
>>          self.wait_for_console_pattern('Booting Linux on physical CPU ' + cpu_id)
>>          self.wait_for_console_pattern('lease of 10.0.2.15')
>> +        # the line before login:
>>          self.wait_for_console_pattern('Aspeed EVB')
>> +        time.sleep(0.1)
>>          exec_command(self, 'root')
>>          time.sleep(0.1)
>>
>> --
>> 2.30.2
>>
>
> Augh. Sorry my hunch was wrong. I wasn't aware of this problem.
>
> Is ... this 0.1 second sleep really sufficient? I guess it's better
> than not having it, and I can't reasonably ask for something more
> thorough.

We could still do with fixing _console_interaction() so we can handle
waiting for prompts without newlines in them. I had a go but it just got
messy.

>
> Acked-by: John Snow <jsnow@redhat.com>


-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-11 14:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-11 11:43 [RFC PATCH] tests/avocado: apply a band aid to aspeed-evb login Alex Bennée
2022-08-11 11:55 ` Cédric Le Goater
2022-08-11 13:27   ` Alex Bennée
2022-08-11 14:08 ` John Snow
2022-08-11 14:18   ` Cédric Le Goater
2022-08-11 14:30   ` Alex Bennée

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.