Univention Bugzilla – Bug 49462
30_import-create_ou_via_cli fails
Last modified: 2021-06-18 23:58:10 CEST
http://jenkins.knut.univention.de:8080/job/UCSschool-4.4/job/Install%20Singleserver/Config=s4,TestGroup=import4/94/testReport/90_ucsschool/30_import-create_ou_via_cli/master201/ ---------------------------------------------------------------------------- (2019-05-13 00:03:09.014749) run-parts: executing /usr/share/ucs-school-import/hooks/ou_create_post.d/k2qpzi9jum /tmp/tmptU_Hrr ou=fs6wgrqmxp,ou=fs,dc=autotest201,dc=local (2019-05-13 00:03:09.014772) /usr/share/ucs-school-import/hooks/ou_create_post.d/k2qpzi9jum: (2019-05-13 00:03:09.014791) + cat /tmp/tmptU_Hrr (2019-05-13 00:03:09.014817) fs6wgrqmxp dcfs6wgrqmxp-01 (2019-05-13 00:03:09.014839) + test ou=fs6wgrqmxp,ou=fs,dc=autotest201,dc=local = ou=fs6wgrqmxp,ou=fs,dc=autotest201,dc=local (2019-05-13 00:03:09.014860) + univention-ldapsearch -b ou=fs6wgrqmxp,ou=fs,dc=autotest201,dc=local (2019-05-13 00:03:09.014907) + egrep ^fs6wgrqmxp$ /tmp/tmptU_Hrr (2019-05-13 00:03:09.014927) + exit 1 (2019-05-13 00:03:09.014947) run-parts: /usr/share/ucs-school-import/hooks/ou_create_post.d/k2qpzi9jum exited with return code 1 (2019-05-13 00:03:09.014965) 2019-05-13 00:03:09 INFO create_ou.create_ou:106 OU 'fs6wgrqmxp' created successfully. (2019-05-13 00:03:09.014984) 2019-05-13 00:03:09 INFO create_ou.main:127 Created OU: fs6wgrqmxp (2019-05-13 00:03:46.203755) Traceback (most recent call last): (2019-05-13 00:03:46.203788) File "30_import-create_ou_via_cli", line 14, in <module> (2019-05-13 00:03:46.203808) eio.import_ou_basics(use_cli_api=True, use_python_api=False) (2019-05-13 00:03:46.203828) File "/usr/lib/pymodules/python2.7/univention/testing/ucsschool/importou.py", line 601, in import_ou_basics (2019-05-13 00:03:46.203876) use_python_api=use_python_api, (2019-05-13 00:03:46.203899) File "/usr/lib/pymodules/python2.7/univention/testing/ucsschool/importou.py", line 310, in create_and_verify_ou (2019-05-13 00:03:46.203942) raise PreHookFailed() (2019-05-13 00:03:46.203965) univention.testing.ucsschool.importou.PreHookFailed ---------------------------------------------------------------------------- The pre- and post-create-OU hooks created by the test expect to find "^%(ou)s$" in the passed CSV file. But they find "^%(ou)s\t%(dc)s$" instead, with "$dc" being "dc$ou-01", because "not dc and not singlemaster" makes the create_ou script generate a name for the school server like that.
That is correct behavior by the create_ou script. The error is in the test. [4.4 0f22be8cf] Bug #49462: use "dc$ou-01" when dc-name not set and not on singlemaster ucs-test-ucsschool (6.0.0-56)
In Jenkins (4.4 singleserver) 30_import-create_ou_via_cli succeeds now, but 30_import-create_ou_via_python_api fails now: Also PreHookFailed, but here it expects "^%(ou)s\t%(dc)s$" and finds "dc$ou-01".
Very old code prevented the fallback to the default hostname for school DCs, when unset and not on a singleserver. [4.4] 0c797d742 Bug #49462: create correct hostname for school dc, when not set and not a singelserver [4.4] bf4667806 Bug #49462: use context manager, disable default hooks to speed up tests [4.4] 840fbf632 Bug #49462: advisory ucs-school-lib (12.1.1-7) ucs-test-ucsschool (6.0.0-57)
tests keep failing
Tests fail in Jenkins because they now need > 4 hours.
(In reply to Daniel Tröder from comment #5) > Tests fail in Jenkins because they now need > 4 hours. Since the last DevDay verify_ldap_object() makes additional 20 attempts in case of an exception every 10 seconds (20 retries/10 seconds → default settings). The ucs-test script was designed so that an exception was expected in some places, which now led to an extremely increased runtime. Additional parameters for verify_ldap_object() reduced the number of additional attempts to 0 to restore the old behavior. [4.4] 2a2392c00 Bug #49462: adopt libs used by 35_import-computers_via_* and 30_import-create_ou_via_*
Package: ucs-test-ucsschool Version: 6.0.32A~4.4.0.201907112158 Branch: ucs_4.4-0 Scope: ucs-school-4.4
http://jenkins.knut.univention.de:8080/job/UCSschool-4.4/job/Install%20Singleserver/Config=s4,TestGroup=import4/lastCompletedBuild/testReport/90_ucsschool/ http://jenkins.knut.univention.de:8080/job/UCSschool-4.4/job/Upgrade%20Singleserver/Config=s4,TestGroup=import4/lastCompletedBuild/testReport/90_ucsschool/ The two 30_* tests now run only ~32min. :-) http://jenkins.knut.univention.de:8080/job/UCSschool-4.4/job/Install%20Singleserver/Config=s4,TestGroup=import1/lastCompletedBuild/testReport/90_ucsschool/ http://jenkins.knut.univention.de:8080/job/UCSschool-4.4/job/Upgrade%20Singleserver/Config=s4,TestGroup=import1/lastCompletedBuild/testReport/90_ucsschool/ And also the 35_* tests now run only <1min → RESOLVED
Works now
4.4 v3 released
git:6adbb37bf42f29620678f54634a84af927acac30 introduced univention.testing.ucsschool.importou.parametrization_id_base64_decode() which is used as ids= function for pytest.mark.parametrize. This function is expected to return a string. the actual function returns anything. This breaks with newer pytest versions. Also the detection of base64 by checking if a string ends with = is not really ideal.