Bug 45524 - (ucs-test) Cut username generation at first double-barrelled lastname
(ucs-test) Cut username generation at first double-barrelled lastname
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: ucs-test
UCS@school 4.1 R2
Other Linux
: P5 normal (vote)
: ---
Assigned To: Daniel Tröder
Florian Best
:
Depends on: 42144
Blocks:
  Show dependency treegraph
 
Reported: 2017-10-12 22:32 CEST by Sönke Schwardt-Krummrich
Modified: 2021-05-25 10:13 CEST (History)
2 users (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: 0.103
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 Sönke Schwardt-Krummrich univentionstaff 2017-10-12 22:32:43 CEST
We need a ucs-test script, that checks this new API.

+++ This bug was initially created as a clone of Bug #42144 +++

According to Feedback on Ticket#2016082421000167 related to the Import-Interface.

Use case from the customer:
Import user with double-barrelled name (e.g. Nadine Mueller-Meier)

Configuration:
"username": {"default": "<:umlauts><firstname>[0]<lastname><:lower>[COUNTER2]"}

Result:
username = nmueller-mei3

The customer would like to have the possibility (e.g. via schema option) to cut the name at the hyphen and don't use the second lastname in the username generation.
username = nmueller3

This requirement was requested and implemented in a project specific import tool for the customer 09711 as well. So, I guess it is not a customer specific requirement.
Comment 1 Daniel Tröder univentionstaff 2017-10-18 14:11:10 CEST
The new test 90_ucsschool/224_import-users_test_format_hook installs a FormatPyHook in /usr/share/ucs-school-import/pyhooks/ which modifies attributes used by format_from_scheme() to create the 'email' and 'birthday' attributes of the imported users. After the import it verifies the result.

A few tests had the initialization wrong, which resulted in a lot of unnecessary OU creation.

[4.2 786ba67a] Bug #45524: create 14 fewer OUs
[4.2 347532d3] Bug #45524: add test for FormatPyHook

ucs-test-ucsschool 4.0.4-36
Comment 2 Florian Best univentionstaff 2017-11-22 15:13:13 CET
OK: test script is working
Comment 3 Daniel Tröder univentionstaff 2018-01-03 12:16:26 CET
Adapted test 90_ucsschool/224_import-users_test_format_hook to changes from Bug #45679.