Bug 57279 - 60_old_schema_registration.py: broken LDAP schema registration
Summary: 60_old_schema_registration.py: broken LDAP schema registration
Status: CLOSED FIXED
Alias: None
Product: UCS
Classification: Unclassified
Component: UMC - System services
Version: UCS 5.0
Hardware: Other Linux
: P5 normal
Target Milestone: UCS 5.0-8-errata
Assignee: Philipp Hahn
QA Contact: Christian Castens
URL: https://git.knut.univention.de/univen...
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-13 14:24 CEST by Philipp Hahn
Modified: 2024-06-19 18:38 CEST (History)
0 users

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.029
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): bitesize
Customer ID:
Max CVSS v3 score:
hahn: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2024-05-13 14:24:18 CEST
tests/60_umc/35_umc_diagnostics_old_schema_registration.py tests LDAP schema registration, which fails. It installs a fake "/var/lib/univention-ldap/local-schema/univention-corporate-client.schema" and runs the diagnostic module "60_old_schema_registration", which then should "move" it LDAP by registering it as an "LDAP Schema Extension" (UDM module "settings/ldapschema").

Running the diagnostics module manually shows the following error (which is ignored by the test!):

> Die Registrierung schlug fehl:
> Command '['sh', '-c', '. /usr/share/univention-lib/ldap.sh && ucs_registerLDAPExtension --packagename "$1" --packageversion "$2" --schema "$3"', 'ucc', '3.0', '/var/lib/univention-ldap/local-schema/univention-corporate-client.schema']' returned non-zero exit status 2.

Patch: "$[123]" are wrong and should be "$[0123]"

```diff
--- management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/60_old_schema_registration.py
+++ management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/60_old_schema_registration.py
@@ -95,1 +95,1 @@
-    subprocess.check_call(['sh', '-c', '. /usr/share/univention-lib/ldap.sh && ucs_registerLDAPExtension --packagename "$1" --packageversion "$2" --schema "$3"', pname, pversion, fname])
-    subprocess.check_call(['sh', '-c', '. /usr/share/univention-lib/ldap.sh && ucs_registerLDAPExtension --packagename "$0" --packageversion "$1" --schema "$2"', pname, pversion, fname])
```
Comment 2 Philipp Hahn univentionstaff 2024-06-11 16:04:21 CEST
[5.0-8] fa72343a71 fix(umc-diagnostics): Fix LDAP schema registration
 .../univention-management-console-module-diagnostic.yaml        |  12 +++
 .../debian/changelog                                            |   5 +-
 .../umc/python/diagnostic/plugins/60_old_schema_registration.py |   2 +-
 test/ucs-test/debian/changelog                                  |   6 ++
 .../tests/60_umc/35_umc_diagnostics_old_schema_registration.py  | 118 +++++++++++++---------------
 5 files changed, 76 insertions(+), 67 deletions(-)

Package: univention-management-console-module-diagnostic
Version: 6.0.9-1
Branch: ucs_5.0-0-errata5.0-8
Scope: errata5.0-8

Package: ucs-test
Version: 10.0.22-2
Branch: ucs_5.0-0-errata5.0-8
Scope: errata5.0-8


[5.2-0] 6db4ad0e0a fix(umc-diagnostics): Fix LDAP schema registration
 .../debian/changelog                                            |   6 ++
 .../umc/python/diagnostic/plugins/60_old_schema_registration.py |   2 +-
 test/ucs-test/debian/changelog                                  |   6 ++
 .../tests/60_umc/35_umc_diagnostics_old_schema_registration.py  | 118 +++++++++++++---------------
 4 files changed, 67 insertions(+), 65 deletions(-)

Package: univention-management-console-module-diagnostic
Version: 8.0.13
Branch: 5.2-0

Package: ucs-test
Version: 12.0.100
Branch: ucs_5.2-0
Comment 3 Christian Castens univentionstaff 2024-06-12 20:33:08 CEST
QA:

I changed target milestone to 5.0-8-errata

OK: code review
OK: manual test*
OK: advisories
OK: changes applied to and built for 5.0 and 5.2


manual test:

OK: log output during test run: /usr/share/ucs-test/60_umc/35_umc_diagnostics_old_schema_registration.py -vf
OK: LDAP schema registration during test run
OK: clean-up after test run

OK: fixed test `35_umc_diagnostics_old_schema_registration.py` fails with old version of diagnostic check `60_old_schema_registration.py`
    -> test now detects failure of schema registration

OK: fixed test `35_umc_diagnostics_old_schema_registration.py` passes with new version of diagnostic check `60_old_schema_registration.py`
Comment 4 Iván.Delgado univentionstaff 2024-06-19 18:38:16 CEST
<https://errata.software-univention.de/#/?erratum=5.0x1068>