qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Daniele Buono <dbuono@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Daniele Buono" <dbuono@linux.vnet.ibm.com>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Cleber Rosa" <crosa@redhat.com>
Subject: [PATCH 1/1] tests/acceptance: set VM socket encoding to UTF-8
Date: Tue, 21 Jul 2020 08:55:22 -0400	[thread overview]
Message-ID: <20200721125522.20511-2-dbuono@linux.vnet.ibm.com> (raw)
In-Reply-To: <20200721125522.20511-1-dbuono@linux.vnet.ibm.com>

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 --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:
-- 
2.26.2



      reply	other threads:[~2020-07-21 12:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21 12:55 [PATCH 0/1] tests/acceptance: set VM socket encoding to UTF-8 Daniele Buono
2020-07-21 12:55 ` Daniele Buono [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200721125522.20511-2-dbuono@linux.vnet.ibm.com \
    --to=dbuono@linux.vnet.ibm.com \
    --cc=crosa@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wainersm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).