tests/avocado: apply a band aid to aspeed-evb login
RFC PATCH 1/1 tests/avocado: apply a band aid to aspeed-evb login
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.
--- tests/avocado/machine_aspeed.py | 2 ++ 1 file changed, 2 insertions(+)
tests/avocado/machine_aspeed.py +2 -0
@@ -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)
Signature · 1 line
2.30.2
Quoted 9 lines · Alex Bennée
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 <[email protected]>Cc Cédric Le Goater <[email protected]>Cc John Snow <[email protected]>
May be you should also add the missing timeout setting ?
Anyhow,
Thanks,
C.
Quoted 18 lines
--- tests/avocado/machine_aspeed.py | 2 ++ 1 file changed, 2 insertions(+)tests/avocado/machine_aspeed.py +2
-0@@ -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)
Quoted 11 lines · Cédric Le Goater
Quoted 8 lines · Alex Bennée
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 <[email protected]>Cc Cédric Le Goater <[email protected]>Cc John Snow <[email protected]>
Quoted 1 line
May be you should also add the missing timeout setting ?
That's in another patch - I'll post the whole series now.
Quoted 27 lines
Anyhow,
Reviewed-by Cédric Le Goater <[email protected]>Thanks,
C.
Quoted 18 lines
--- tests/avocado/machine_aspeed.py | 2 ++ 1 file changed, 2 insertions(+)tests/avocado/machine_aspeed.py +2
-0@@ -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)
Signature · 1 line
Alex Bennée
Quoted 29 lines · Alex Bennée
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 <[email protected]>Cc Cédric Le Goater <[email protected]>Cc John Snow <[email protected]>--- tests/avocado/machine_aspeed.py | 2 ++ 1 file changed, 2 insertions(+)tests/avocado/machine_aspeed.py +2
-1@@ -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) --
Quoted 2 lines
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.
Quoted 35 lines · John Snow
Quoted 29 lines · Alex Bennée
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 <[email protected]>Cc Cédric Le Goater <[email protected]>Cc John Snow <[email protected]>--- tests/avocado/machine_aspeed.py | 2 ++ 1 file changed, 2 insertions(+)tests/avocado/machine_aspeed.py +2
-1@@ -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) --Quoted 2 lines
2.30.2
Augh. Sorry my hunch was wrong. I wasn't aware of this problem.
Quoted 3 lines
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.
Quoted 35 lines · John Snow
Quoted 29 lines · Alex Bennée
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 <[email protected]>Cc Cédric Le Goater <[email protected]>Cc John Snow <[email protected]>--- tests/avocado/machine_aspeed.py | 2 ++ 1 file changed, 2 insertions(+)tests/avocado/machine_aspeed.py +2
-1@@ -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) --Quoted 2 lines
2.30.2
Augh. Sorry my hunch was wrong. I wasn't aware of this problem.
Quoted 3 lines
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.
Quoted 2 lines
Acked-by John Snow <[email protected]>
Signature · 1 line
Alex Bennée