[PATCH 1/2] tests/boot_console: Send <carriage return> on serial lines

Philippe Mathieu-Daudé posted 2 patches 6 years, 4 months ago
[PATCH 1/2] tests/boot_console: Send <carriage return> on serial lines
Posted by Philippe Mathieu-Daudé 6 years, 4 months ago
Some firmwares don't parse the <Newline> control character and
expect a <carriage return>.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 tests/acceptance/boot_linux_console.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 8a9a314ab4..f05452824e 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -51,7 +51,7 @@ class BootLinuxConsole(Test):
                 self.fail(fail)
 
     def exec_command_and_wait_for_pattern(self, command, success_message):
-        command += '\n'
+        command += '\r\n'
         self.vm.console_socket.sendall(command.encode())
         self.wait_for_console_pattern(success_message)
 
-- 
2.21.0


Re: [PATCH 1/2] tests/boot_console: Send <carriage return> on serial lines
Posted by Wainer dos Santos Moschetta 6 years ago
On 10/10/19 9:21 AM, Philippe Mathieu-Daudé wrote:
> Some firmwares don't parse the <Newline> control character and
> expect a <carriage return>.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   tests/acceptance/boot_linux_console.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index 8a9a314ab4..f05452824e 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -51,7 +51,7 @@ class BootLinuxConsole(Test):
>                   self.fail(fail)
>   
>       def exec_command_and_wait_for_pattern(self, command, success_message):
> -        command += '\n'
> +        command += '\r\n'
>           self.vm.console_socket.sendall(command.encode())
>           self.wait_for_console_pattern(success_message)
>   

This doesn't apply anymore since exec_command_and_wait_for_pattern() is 
now part of the avocado_qemu module.

I'm little worried about this breaking the current tests that use the 
method. Could you please run those tests before putting it on the pull 
request, Philippe?

Besides that, this change looks good to me:

Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>