Bug 53783 - 239_import-users_sisopi.py fails because S4-Connector reverts changes
Summary: 239_import-users_sisopi.py fails because S4-Connector reverts changes
Status: CLOSED FIXED
Alias: None
Product: UCS@school
Classification: Unclassified
Component: ucs-test
Version: UCS@school 5.0
Hardware: Other Linux
: P5 normal
Target Milestone: UCS@school 5.0 v1
Assignee: Felix Botner
QA Contact: Florian Best
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-13 17:12 CEST by Florian Best
Modified: 2021-11-29 17:19 CET (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):
Customer ID:
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2021-09-13 17:12:57 CEST
The test case 90_ucsschool.239_import-users_sisopi fails.

Traceback (most recent call last):
  File "239_import-users_sisopi.py", line 188, in <module>
    Test().run()
  File "/usr/lib/python3/dist-packages/univention/testing/ucsschool/importusers_cli_v2.py", line 315, in run 
    self.test()
  File "239_import-users_sisopi.py", line 164, in test
    self._import_and_verify(config, person, delete=True)
  File "239_import-users_sisopi.py", line 29, in _import_and_verify
    person.verify()
  File "/usr/lib/python3/dist-packages/univention/testing/ucsschool/importusers.py", line 388, in verify
    self.dn, expected_attr=self.expected_attributes(), strict=True, should_exist=True
  File "/usr/lib/python3/dist-packages/univention/testing/decorators.py", line 49, in __call__
    self.func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/univention/testing/utils.py", line 225, in verify_ldap_object
    delay)
  File "/usr/lib/python3/dist-packages/univention/testing/utils.py", line 175, in retry_on_error
    six.reraise(*exc_info)
  File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/univention/testing/utils.py", line 166, in retry_on_error
    return func()
  File "/usr/lib/python3/dist-packages/univention/testing/utils.py", line 279, in __verify_ldap_object
    raise LDAPObjectValueMissing(msg)
univention.testing.utils.LDAPObjectValueMissing: DN: uid=ifmcir1spl,cn=schueler,cn=users,ou=testou1632,dc=autotest201,dc=local
departmentNumber: [b'testou8152'], missing   : 'testou1632'
homeDirectory: [b'/home/testou8152/schueler/ifmcir1spl'], missing   : '/home/testou1632/schueler/ifmcir1spl'
departmentNumber: [b'testou8152'], unexpected: 'testou8152'
homeDirectory: [b'/home/testou8152/schueler/ifmcir1spl'], unexpected: '/home/testou8152/schueler/ifmcir1spl'

ucs-test-ucsschool/90_ucsschool/239_import-users_sisopi.py:
157             self.log.info(
158                 "***  (%d/4) - 8. Deleting (move) %r in (last) school %r...", num, role, self.ou_C.name
159             )
160             config.update_entry("school", self.ou_C.name)
161             person.update(school=self.limbo_ou_name, schools=[self.limbo_ou_name])
162             person.update(school=self.limbo_ou_name, schools=[self.limbo_ou_name], school_classes={})
163             person.set_inactive()
164             self._import_and_verify(config, person, delete=True)
165             self.log.info("OK: deletion (C -> limbo) succeeded.")

It fails at test case 8 when removing a user by moving it into the limbo school.
The school change of the user causes that a new home directory is set, this seem to work well.

But the S4-Connector seem to re-set it to the previous value.
At least, when I run the test with S4-Connector disabled it passes:

# systemctl stop univention-s4-connector.service 
# systemctl mask univention-s4-connector.service 
Created symlink /etc/systemd/system/univention-s4-connector.service → /dev/null.

diff --git test/ucs-test/univention/testing/ucs_samba.py test/ucs-test/univention/testing/ucs_samba.py
index 1c266a5a90..75157a19e3 100644
--- test/ucs-test/univention/testing/ucs_samba.py
+++ test/ucs-test/univention/testing/ucs_samba.py
@@ -79,6 +79,7 @@ except ldb.LdbError as exc:
 
 def _wait_for_drs_replication(ldap_filter, attrs=None, base=None, scope=ldb.SCOPE_SUBTREE, lp=None, timeout=360, delta_t=1, verbose=True, should_exist=True, controls=None):
        # type: (str, Union[List[str], None, str], Optional[str], int, Optional[LoadParm], int, int, bool, bool, Optional[List[str]]) -> None
+       return
        if not package_installed('univention-samba4'):
                if package_installed('univention-samba'):
                        time.sleep(15)
@@ -209,6 +210,7 @@ def _ldap_replication_complete(verbose=True):
 
 def wait_for_s4connector(timeout=360, delta_t=1, s4cooldown_t=5):
        # type: (int, int, int) -> int
+       return
        ucr = config_registry.ConfigRegistry()
        ucr.load()
 


https://jenkins.knut.univention.de:8181/job/UCSschool-5.0/job/Install%20Singleserver/lastCompletedBuild/Config=s4,TestGroup=import1,UCSRelease=testing/testReport/90_ucsschool/239_import-users_sisopi/master201/

https://jenkins.knut.univention.de:8181/job/UCSschool-5.0/job/Install%20Singleserver/lastCompletedBuild/Config=s4,TestGroup=import1,UCSRelease=public/testReport/90_ucsschool/239_import-users_sisopi/master201/

https://jenkins.knut.univention.de:8181/job/UCSschool-5.0/job/Upgrade%20Singleserver/lastCompletedBuild/Config=s4,TestGroup=import1/testReport/90_ucsschool/239_import-users_sisopi/master206/
Comment 2 Felix Botner univentionstaff 2021-09-17 08:57:45 CEST
Added wait_for_s4connector() during the test.

Seems that the delayed s4 sync (u-d-n is stoppend during the test/import) from a test sometimes messed with the next test.
Comment 3 Florian Best univentionstaff 2021-09-17 15:45:15 CEST
great!
Comment 4 Jürn Brodersen univentionstaff 2021-11-29 17:19:53 CET
UCS@school 5.0 v1 has been released.

https://docs.software-univention.de/release-notes-ucsschool-5.0v1-de.html

If this error occurs again, please clone this bug.