Univention Bugzilla – Bug 46571
4.2/school-import: checks are not executed in dry-run
Last modified: 2018-06-04 15:34:08 CEST
Because of Bug #46317, the method ImportUser.run_checks() is not executed in a dry-run anymore. Add explicit run_checks() calls to UserImport in the dry-run branches.
The checks are run after pre_{create,modify,move}() and before and modification to the underlying UDM object. A test was added to verify that: 231_import-users_checks_in_dry-run [4.2] 80bb5bc3 Bug #46572: do checks in dry-run, run them after pre-hooks and before changes to the underlying UDM object [4.2] c707fac2 Bug #46572: handle TypeError [4.2] 0b644fc7 Bug #46572: add test to verify checks are executed in dry-run [4.2] 8de42ff5 Bug #46572: trigger early check for move(), not late for modfiy() [4.2] ecd8e80b Bug #46572: cleanup: test lib learned to handle birthday property itself [4.2] e4a43867 Bug #46572: changelog [4.2] e74e0f47 Bug #46571: advisory 8de42ff5 should have been labeled for Bug #46462. ucs-school-import (15.0.3-27) ucs-test-ucsschool (4.0.4-75)
[4.2] f1fbe0e9 Bug #46572: do not run checks from within hook [4.2] 590c0421 Bug #46572: handle different names [4.2] c1e95ec8 Bug #46571: changelog [4.2] c443ab76 Bug #46571: advisory ucs-school-import (15.0.3-28) ucs-test-ucsschool (4.0.4-77)
Test runs successfully -> OK YAML -> OK -> Verified
(In reply to Jürn Brodersen from comment #3) > Test runs successfully -> OK > YAML -> OK > > -> Verified Sorry the test does not fully work -> Reopen
The 4.1 and 4.2 parts of the "fail" for the wrong reason. Not because of the "bad" brithday format but because the fake_ou doesn't exists. I tried setting fake_ou = self.ou_B.name but then the 4.1 part of the test fails in "person.verify()" because the person was actually moved. Should the school move be reverted on errors? (Not in the scope of this bug I guess) If possible check that the import failed for the "right" reason. Or check that the import is successful with the birthday in a "good" format.
Fixed test revealed the missing update of the uniqueness storage. [4.2] 2f294cd3 Bug #46571: change DN in uniqueness store also in dry-run [4.2] bc76ab9c Bug #46571: modify classes in school change [4.2] 6baed155 Bug #46571: use real OU in move() test [4.2] 7104f815 Bug #46571: changelog [4.2] 40e69744 Bug #46571: advisory update ucs-school-import (15.0.3-30) ucs-test-ucsschool (4.0.4-79)
Looks good now :) Test runs successfully -> OK YAML -> OK -> Verified
UCS@school 4.2 v9 has been released. https://docs.software-univention.de/changelog-ucsschool-4.2v9-de.html If this error occurs again, please clone this bug.