Bug 52500 - ucs-test for ucs-school-object-consistency script
Summary: ucs-test for ucs-school-object-consistency script
Status: CLOSED FIXED
Alias: None
Product: UCS@school
Classification: Unclassified
Component: ucs-test
Version: unspecified
Hardware: Other Linux
: P5 normal
Target Milestone: ---
Assignee: Toni Röhmeyer
QA Contact: Daniel Tröder
URL:
Keywords:
Depends on:
Blocks: 52147 52656
  Show dependency treegraph
 
Reported: 2020-12-15 16:21 CET by Toni Röhmeyer
Modified: 2021-06-09 12:55 CEST (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
empty function which should be implemented (2.10 KB, patch)
2020-12-15 16:21 CET, Toni Röhmeyer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Toni Röhmeyer univentionstaff 2020-12-15 16:21:54 CET
Created attachment 10578 [details]
empty function which should be implemented

This is related to bug #52147:


Please add a ucs-test that
* creates an OU
* deletes/modifies objects in it
* runs the script
* verifies in the scripts captured output, that all errors are caught


Work in Progress
Comment 1 Toni Röhmeyer univentionstaff 2021-01-06 19:28:18 CET
I implemented some working test versions on branch troehmey/bug52500_consistency-script-ucs-test:

6260834c6 Bug #52500: implemented first test versions
d90c2a058 Bug #52500: first test version (still errorneous)


However, I may add some more tests and they still require quite some time to pass.
There may be improvements to be made.
Comment 3 Toni Röhmeyer univentionstaff 2021-01-12 12:13:30 CET
* Applied the notes from comment #2
* Added a new test "test_wrong_school_role_for_each_school"

with commit 
6a6241e55 Bug #52500: added parametrization; added test


Most of the tests still run pretty slow. This is because most test require a fresh ou to be create since they become intentionally erroneous.
Comment 4 Daniel Tröder univentionstaff 2021-01-18 12:36:27 CET
Thank you for the changes. Code review is positive.
The tests all succeeded on my VM.
The tests complete in 2m30s on my VM, that's not to long for isolated integration tests.

* test_wrong_school_role_for_each_school doesn't check the 'staff', 'teacher' and 'teacher_and_staff' roles
* test_wrong_school_role doesn't check the 'staff' role
* test_wrong_group_membership doesn't check the 'staff' and 'teacher' roles
Comment 5 Toni Röhmeyer univentionstaff 2021-01-19 14:04:06 CET
added test cases with commit
bf5331441 Bug #52500: added test parameters to test more roles

>* test_wrong_school_role_for_each_school doesn't check the 'staff', 'teacher' and 'teacher_and_staff' roles

I intentionally did not implement more roles in that test because I trust test_wrong_school_role() on ensuring that this would work for all roles.
Comment 6 Daniel Tröder univentionstaff 2021-03-22 11:06:02 CET
OK: all roles are checked
OK: except in test_wrong_school_role_for_each_school() as it is already checked in test_wrong_school_role()
OK: tests succeed
Comment 7 Daniel Tröder univentionstaff 2021-03-22 11:19:00 CET
I will cherry-pick to 4.4 and squash.