diff mbox series

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

Message ID 20191010122128.29000-2-f4bug@amsat.org
State New
Headers show
Series tests/acceptance: Add tests for the PA-RISC machine | expand

Commit Message

Philippe Mathieu-Daudé Oct. 10, 2019, 12:21 p.m. UTC
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(-)

Comments

Wainer dos Santos Moschetta Jan. 29, 2020, 6:20 p.m. UTC | #1
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>
diff mbox series

Patch

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)