diff mbox series

[03/13] tests/vm: send locale environment variables over ssh

Message ID 20190508085645.11595-4-kraxel@redhat.com (mailing list archive)
State New, archived
Headers show
Series tests/vm: serial console autoinstall, misc fixes. | expand

Commit Message

Gerd Hoffmann May 8, 2019, 8:56 a.m. UTC
Needed for unicode tests.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 tests/vm/basevm.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Thomas Huth May 9, 2019, 7:35 a.m. UTC | #1
On 08/05/2019 10.56, Gerd Hoffmann wrote:
> Needed for unicode tests.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  tests/vm/basevm.py | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
> index 6b46674f4497..20eec5420dbf 100755
> --- a/tests/vm/basevm.py
> +++ b/tests/vm/basevm.py
> @@ -43,6 +43,20 @@ class BaseVM(object):
>          "http_proxy",
>          "ftp_proxy",
>          "no_proxy",
> +        "LANG",
> +        "LC_CTYPE",
> +        "LC_NUMERIC",
> +        "LC_TIME",
> +        "LC_COLLATE",
> +        "LC_MONETARY",
> +        "LC_MESSAGES",
> +        "LC_PAPER",
> +        "LC_NAME",
> +        "LC_ADDRESS",
> +        "LC_TELEPHONE",
> +        "LC_MEASUREMENT",
> +        "LC_IDENTIFICATION",
> +        "LC_ALL",
>      ]

I gave your patch series a try, but now I see a lot of these messages in
the output:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LC_ALL = (unset),
	LC_TIME = "en_DK.UTF-8",
	LANG = "en_DK.UTF-8"
    are supported and installed on your system.

Is it really a good idea to use the host locale in the guest, too? ... I
don't think so... at least you should make sure that *all* possible
locales are installed in that case.

"gmake check" then also finally failed:

--- /home/qemu/qemu-test.AOvcgx/src/tests/qapi-schema/unicode-str.err
2019-05-09 05:56:17.000000000 +0000
+++ -	2019-05-09 06:12:54.451392000 +0000
@@ -1 +1 @@
-tests/qapi-schema/unicode-str.json:2: 'command' uses invalid name 'é'
+tests/qapi-schema/unicode-str.json:2: 'command' uses invalid name '\xe9'

Note that if you just wanted to fix the python3 utf-8 problem with this
patch here, there is a separate fix available for that problem already:

 https://lists.gnu.org/archive/html/qemu-devel/2019-05/msg01247.html

 HTH,
  Thomas
Gerd Hoffmann May 9, 2019, 8:18 a.m. UTC | #2
Hi,

> "gmake check" then also finally failed:
> 
> --- /home/qemu/qemu-test.AOvcgx/src/tests/qapi-schema/unicode-str.err
> 2019-05-09 05:56:17.000000000 +0000
> +++ -	2019-05-09 06:12:54.451392000 +0000
> @@ -1 +1 @@
> -tests/qapi-schema/unicode-str.json:2: 'command' uses invalid name 'é'
> +tests/qapi-schema/unicode-str.json:2: 'command' uses invalid name '\xe9'

Well, that failure disappeared in my tests.  But that'll probably only works
in case the guest actually has support for the given locale.

> Note that if you just wanted to fix the python3 utf-8 problem with this
> patch here, there is a separate fix available for that problem already:
> 
>  https://lists.gnu.org/archive/html/qemu-devel/2019-05/msg01247.html

Ah, ok.  Guess I can drop the patch then.

cheers,
  Gerd
diff mbox series

Patch

diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 6b46674f4497..20eec5420dbf 100755
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -43,6 +43,20 @@  class BaseVM(object):
         "http_proxy",
         "ftp_proxy",
         "no_proxy",
+        "LANG",
+        "LC_CTYPE",
+        "LC_NUMERIC",
+        "LC_TIME",
+        "LC_COLLATE",
+        "LC_MONETARY",
+        "LC_MESSAGES",
+        "LC_PAPER",
+        "LC_NAME",
+        "LC_ADDRESS",
+        "LC_TELEPHONE",
+        "LC_MEASUREMENT",
+        "LC_IDENTIFICATION",
+        "LC_ALL",
     ]
 
     # The script to run in the guest that builds QEMU