diff mbox series

[1/1] tests/acceptance: set VM socket encoding to UTF-8

Message ID 20200721125522.20511-2-dbuono@linux.vnet.ibm.com
State New
Headers show
Series [1/1] tests/acceptance: set VM socket encoding to UTF-8 | expand

Commit Message

Daniele Buono July 21, 2020, 12:55 p.m. UTC
The OS of some VM used by acceptance tests sends messages in UTF-8
encoding.

The socket used to communicate between the VM and the host by the
AVOCADO framework uses the default host encoding. This is not generally
a problem since most distributions default to UTF. However, if for some
reason the host is using a plain ASCII encoding, the VM test will fail
with an error. This patch explicitly sets the encoding to be UTF-8.

Signed-off-by: Daniele Buono <dbuono@linux.vnet.ibm.com>
---
 tests/acceptance/avocado_qemu/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index 77d1c1d9ff..5f7ef0a2f2 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -73,7 +73,7 @@  def _console_interaction(test, success_message, failure_message,
     assert not keep_sending or send_string
     if vm is None:
         vm = test.vm
-    console = vm.console_socket.makefile()
+    console = vm.console_socket.makefile(encoding='UTF-8')
     console_logger = logging.getLogger('console')
     while True:
         if send_string: