Bug 37802 - ucs-test: Minus in hostname should be valid
ucs-test: Minus in hostname should be valid
Status: RESOLVED FIXED
Product: UCS@school
Classification: Unclassified
Component: ucs-test
UCS@school 4.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: Ammar Najjar
:
Depends on: 36034
Blocks: 37770 37945
  Show dependency treegraph
 
Reported: 2015-02-16 10:18 CET by Sönke Schwardt-Krummrich
Modified: 2015-03-09 12:03 CET (History)
1 user (show)

See Also:
What kind of report is it?: ---
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 Sönke Schwardt-Krummrich univentionstaff 2015-02-16 10:18:46 CET
Please write a test script, that checks valid and invalid host names against the ucs-school-lib.

Please also check if additional test scripts are possible.

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

Found at #2014092921000445:

ucs-school-lib/python/models/attributes.py overrides the valid syntax for hostnames:

regex = re.compile('^[a-zA-Z0-9](([a-zA-Z0-9_]*)([a-zA-Z0-9]$))?$')

This is wrong! "-" in hostnames is also valid.

This leads to unseen erros if a new school dc contains a "-" and the install wizard is used. It just fails without any menaingful error message.
Comment 1 Ammar Najjar univentionstaff 2015-02-18 11:10:42 CET
A new test script with the name "106_valid_hostname" is created to test hostname validity/invalidity for domaincontroller names when creating new ou via:

1- ucs-school-lib
2- ucs-school-import script
3- UMCP module

The special characters used for testing validation are hard coded, so if any new characters are allowed, this script should be modified.