diff mbox

[KVM_AUTOTEST] set English environment

Message ID 4A55CB8B.4010907@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lukáš Doktor July 9, 2009, 10:50 a.m. UTC
Set English environment before test executions.
This is critical because we are parsing outputs of commands, which are 
localized!

Tested by: ldoktor@redhat.com on RHEL5.4 with kvm-83-72.el5

Comments

Lucas Meneghel Rodrigues July 20, 2009, 1:16 p.m. UTC | #1
2009/7/9 Lukáš Doktor <ldoktor@redhat.com>:
> Set English environment before test executions.
> This is critical because we are parsing outputs of commands, which are
> localized!
>
> Tested by: ldoktor@redhat.com on RHEL5.4 with kvm-83-72.el5

Ok, fair enough to have this extra security. Thanks, applied.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arnd Bergmann July 21, 2009, 12:09 a.m. UTC | #2
On Thursday 09 July 2009, Lukáš Doktor wrote:
>   --- orig/client/tests/kvm/control       2009-07-08 13:18:07.000000000 +0200
> +++ new/client/tests/kvm/control        2009-07-09 12:32:32.000000000 +0200
> @@ -45,6 +45,8 @@ Each test is appropriately documented on
>  
>  import sys, os
>  
> +# set English environment
> +os.environ['LANG'] = 'en_US.UTF-8'
>  # enable modules import from current directory (tests/kvm)
>  pwd = os.path.join(os.environ['AUTODIR'],'tests/kvm')
>  sys.path.append(pwd)

LANG can still be overridden with LC_ALL. For a well-defined environment,
best set LC_ALL='C'. This will also set other i18n settings and works
on systems that don't come with UTF-8 enabled.

	Arnd <><
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- orig/client/tests/kvm/control	2009-07-08 13:18:07.000000000 +0200
+++ new/client/tests/kvm/control	2009-07-09 12:32:32.000000000 +0200
@@ -45,6 +45,8 @@  Each test is appropriately documented on
 
 import sys, os
 
+# set English environment
+os.environ['LANG'] = 'en_US.UTF-8'
 # enable modules import from current directory (tests/kvm)
 pwd = os.path.join(os.environ['AUTODIR'],'tests/kvm')
 sys.path.append(pwd)