Skip to content

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

Daniele Buono qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1tests/acceptance: set VM socket encoding to UTF-8tests/acceptance/avocado_qemu/__init__.py+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] tests/acceptance: set VM socket encoding to UTF-8

Some of the acceptance tests were failing for me with an error while decoding characters coming from the VMs running for the test.

The error looked like this:

(30/36) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_nios2_10m50: ERROR: 'ascii' codec can't decode byte 0xc2 in position 36: ordinal not in range(128) (1.29 s)

The very same test is running fine on GitLab CI

An investigation of the issue shows that the socket we are using between QEMU and AVOCADO is using the default encoding of the host OS. In my case, locale was set to plain ASCII with LANG=C. Setting it to a UTF-8 locale fixed the issue, but a safer approach should be to just tell Python to always use a UTF-8 charset for the socket. This is what the patch does.

Daniele Buono (1):
tests/acceptance: set VM socket encoding to UTF-8

 tests/acceptance/avocado_qemu/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.26.2