Bug 31739 - ucs-test should use a UTF-8 locale
ucs-test should use a UTF-8 locale
Status: RESOLVED INVALID
Product: UCS Test
Classification: Unclassified
Component: Framework
unspecified
Other Linux
: P5 normal (vote)
: ---
Assigned To: Philipp Hahn
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-14 07:37 CEST by Stefan Gohmann
Modified: 2023-07-26 14:58 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2013-06-14 07:37:20 CEST
############## Starting with LC_ALL

stefan@leka:~$ LC_ALL=C ssh root@10.210.3.57 ucs-test -s samba4-test
Starting 1 ucs-test at 2013-06-14 01:33:23 to /var/log/univention/test_1371188001.log
============================ Section 'samba4-test' =============================
Display samba Groups as normal user......... Test failed

############## Logfile
stefan@leka:~$ LC_ALL=C ssh root@10.210.3.57 cat /var/log/univention/test_1371188001.log
*** BEGIN *** ['/bin/bash', '20grouplist'] ***
debug 2013-06-14 01:33:23        Locale is de_DE.UTF-8:UTF-8
debug 2013-06-14 01:33:23        locale: LANG=de_DE.UTF-8
LANGUAGE=
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C
info 2013-06-14 01:33:24         create user �l�s��k�
E: Invalid Syntax: User name: Username must only contain numbers, letters and dots, and may not be 'admin'!
error 2013-06-14 01:33:24        Failed to create user
error 2013-06-14 01:33:24        **************** Test failed above this line (1) ****************
info 2013-06-14 01:33:24         remove user �l�s��k�
E: object not found
error 2013-06-14 01:33:24        univention-directory-manager return error �l�s��k�
*** END *** 1 ***
############## Starting with UTF-8 locale
stefan@leka:~$ LC_ALL=de_DE.UTF-8 ssh root@10.210.3.57 ucs-test -s samba4-test
Starting 1 ucs-test at 2013-06-14 01:33:55 to /var/log/univention/test_1371188033.log
============================ Section 'samba4-test' =============================
Display samba Groups as normal user......... Test passed
############## Logfile
stefan@leka:~$ LC_ALL=C ssh root@10.210.3.57 cat /var/log/univention/test_1371188033.log
*** BEGIN *** ['/bin/bash', '20grouplist'] ***
debug 2013-06-14 01:33:56        Locale is de_DE.UTF-8:UTF-8
debug 2013-06-14 01:33:56        locale: LANG=de_DE.UTF-8
LANGUAGE=
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=de_DE.UTF-8
info 2013-06-14 01:33:57         create user üö8üöäf9
Object created: uid=üö8üöäf9,cn=users,dc=deadlock90,dc=local
waiting for user replication
----print samba groups as a user
info 2013-06-14 01:34:05         remove user üö8üöäf9
Object removed: uid=üö8üöäf9,cn=users,dc=deadlock90,dc=local
debug 2013-06-14 01:34:06        user üö8üöäf9 removed
info 2013-06-14 01:34:06         checking whether the user üö8üöäf9 is really removed
debug 2013-06-14 01:34:06        user üö8üöäf9 does not exist
*** END *** 100 ***
stefan@leka:~$ 
##############
Comment 1 Philipp Hahn univentionstaff 2013-06-14 11:13:22 CEST
Hard-coding a locale in a program is evil, because it would break running ucs-test in other locales.
I'd recommend to fix the invocation instead to use a sane environment.

(That is why ucs-test-cloud runs ucs-test using "rungetty" and not from /etc/init.d/: The later has a very primitive environment, where even HOME and LOGIN/USER are unset. The other reason was that no getty is started until all init-scripts have finished, which prevents login to system without network during development.)
Comment 2 Philipp Hahn univentionstaff 2023-07-26 14:58:36 CEST
(In reply to Stefan Gohmann from comment #0)
> stefan@leka:~$ LC_ALL=C ssh root@10.210.3.57 ucs-test -s samba4-test

You explicitly asked for a 7-bit ASCII locale by using just `C`; if you want UTF-8 you have to specify `C.UTF-8` available since a long time (UCS 4.3 / Debian-9-Stretch).

Since Python 3.7 (UCS 5.0) UTF-8 is also the default for Python.