Bug 41910 - If users are moved from school A to school B, workinggroup memberships should be adjusted.
If users are moved from school A to school B, workinggroup memberships should...
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 4.1 R2
Other Linux
: P5 normal (vote)
: UCS@school 4.1 R2 v10
Assigned To: Daniel Tröder
Sönke Schwardt-Krummrich
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-03 17:30 CEST by Sönke Schwardt-Krummrich
Modified: 2017-03-21 12:35 CET (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.069
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
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 2016-08-03 17:30:15 CEST
If users are moved from school A to school B, workinggroup memberships should be adjusted/removed.
Comment 1 Daniel Tröder univentionstaff 2016-11-21 15:52:00 CET
Workroups of the previous school are already removed from a user after moving it to another school.

r74646: the test 90_ucsschool/80_move_users_into_another_ou was adapted to test this
Comment 2 Florian Best univentionstaff 2016-12-12 16:05:16 CET
There are 6 code branches here:

* user with one school (schoolA) get moved to schoolB
OK: Via schoolwizards
OK: Via import script

* users with 2 schools (schoolA, schoolB) located in SchoolA, removing from schoolA
~OK: Via schoolwizards (works after fixing Bug #43170)
OK: Via import script

* users with 2 schools (schoolA, schoolB) located in SchoolA, removing from schoolB
OK: Via schoolwizards
Fail: Via import script

I adjusted the test script 207_import-users_school_change to test and reveil this explicitly. When fixing this bug the test script should change the 'print Fail" into a proper assertion which lets the test script fail.

ucs-test-ucsschool (3.0.17-32):
r75217 | Bug #41910: adjust test case to test workgroup membership when removing user from schools
Comment 3 Florian Best univentionstaff 2016-12-12 16:20:51 CET
(In reply to Daniel Tröder from comment #1)
> Workroups of the previous school are already removed from a user after
> moving it to another school.
> 
> r74646: the test 90_ucsschool/80_move_users_into_another_ou was adapted to
> test this
Adjusting this test doesn't test the original way the UMC wizard and the Importer uses. That's why it didn't fail. The test is more a unit test for the school-lib. The test case also covers only 1 of the 3 ways.
Comment 4 Daniel Tröder univentionstaff 2017-02-12 19:44:49 CET
r76612: * fix ucs-test not checking school(s) attribute(s)
        * fix setting of school and schools attributes in same update() call
Comment 5 Daniel Tröder univentionstaff 2017-02-15 11:49:21 CET
r76682: support automatic removal of secondary schools from User objects, including removal of groups from removed school

r76683: modify 207_import-users_school_change to check group membership when adding and removing schools to/from a user

Package: ucs-school-lib
Version: 9.0.31-1.275.201702151147
Branch: ucs_4.1-0
Scope: ucs-school-4.1r2

Package: ucs-test-ucsschool
Version: 3.0.17-59.379.201702151148
Branch: ucs_4.1-0
Scope: ucs-school-4.1r2
Comment 6 Daniel Tröder univentionstaff 2017-02-16 16:12:54 CET
This must be release together with ucs-school-umc-wizards 8.0.0-15, as it contains the adaption to the change in User.remove_from_school().
Comment 7 Sönke Schwardt-Krummrich univentionstaff 2017-03-04 22:44:19 CET
# univention-ldapsearch -LLL uid=eanton1 dn ucsschoolSchool
dn: uid=eanton1,cn=schueler,cn=users,ou=100,dc=nstx,dc=local
ucsschoolSchool: 100
ucsschoolSchool: gsmitte

# univention-ldapsearch -LLL memberUid=eanton1 dn | grep ^dn
dn: cn=schueler-gsmitte,cn=groups,ou=gsmitte,dc=nstx,dc=local
dn: cn=Domain Users gsmitte,cn=groups,ou=gsmitte,dc=nstx,dc=local
dn: cn=gsmitte-1A,cn=klassen,cn=schueler,cn=groups,ou=gsmitte,dc=nstx,dc=local
dn: cn=schueler-100,cn=groups,ou=100,dc=nstx,dc=local
dn: cn=Domain Users 100,cn=groups,ou=100,dc=nstx,dc=local
dn: cn=100-1A,cn=klassen,cn=schueler,cn=groups,ou=100,dc=nstx,dc=local
dn: cn=100-Work100,cn=schueler,cn=groups,ou=100,dc=nstx,dc=local
dn: cn=gsmitte-MitteWG,cn=schueler,cn=groups,ou=gsmitte,dc=nstx,dc=local

Removing user "uid=eanton1" from OU "gsmitte" via UMC module "users (schools)" with fixed #43170 but unfixed #41910:

 dn: cn=schueler-gsmitte,cn=groups,ou=gsmitte,dc=nstx,dc=local
-uniqueMember: uid=eanton1,cn=schueler,cn=users,ou=100,dc=nstx,dc=local
-memberUid: eanton1

 dn: cn=gsmitte-1A,cn=klassen,cn=schueler,cn=groups,ou=gsmitte,dc=nstx,dc=local
-uniqueMember: uid=eanton1,cn=schueler,cn=users,ou=100,dc=nstx,dc=local
-memberUid: eanton1

 dn: cn=gsmitte-MitteWG,cn=schueler,cn=groups,ou=gsmitte,dc=nstx,dc=local
-uniqueMember: uid=eanton1,cn=schueler,cn=users,ou=100,dc=nstx,dc=local
-memberUid: eanton1

 dn: cn=Domain Users gsmitte,cn=groups,ou=gsmitte,dc=nstx,dc=local
-uniqueMember: uid=eanton1,cn=schueler,cn=users,ou=100,dc=nstx,dc=local
-memberUid: eanton1

 dn: uid=eanton1,cn=schueler,cn=users,ou=100,dc=nstx,dc=local
-ucsschoolSchool: gsmitte

→ looks good so far, but 207_import-users_school_change fails

If #41910 is fixed, the removal via UMC shows the same LDAP changes, and the test script 207_import-users_school_change does not fail any longer.

OK: code change
OK: functional test
OK: YAML
Comment 8 Sönke Schwardt-Krummrich univentionstaff 2017-03-21 12:35:53 CET
UCS@school 4.1 R2 v10 has been released.

http://docs.software-univention.de/changelog-ucsschool-4.1R2v10-de.html

If this error occurs again, please clone this bug.