#49799 Ticket 49161 - Add CI test case
Closed by spichugi. Opened by amsharma.
amsharma/389-ds-base ticket_49161  into  master

Download 49799.patch

Description: Add a test case in ticket49161_test.py
Test that memberof does not fail if group is moved into scope

https://pagure.io/389-ds-base/issue/49161

Reviewed by: ?

Since this is a new test, perhaps we can place it directly to memberof test suite instead of adding another ticket test?

I think we should add a proper docstring and test function name here (instead of test_ticket_49161)

config_memberof does not repeat. I think we can have the code in test case and remove config_memberof func.

So as long as you've added a new test case, lets make it lib389ish right. :)

 server.plugins.enable(name=PLUGIN_MEMBER_OF)
 # set memberofentryscope
 dn = "cn=%s,%s" % (PLUGIN_MEMBER_OF, DN_PLUGIN)
 server.modify_s(dn, [(ldap.MOD_REPLACE, 'memberOfEntryScope', ensure_bytes(SUBTREE_1))])

can be

plugin = MemberOfPlugin(inst)
plugin.replace('memberOfEntryScope', SUBTREE_1)

For adding containers, members and groups you can use code from here - https://pagure.io/389-ds-base/blob/master/f/dirsrvtests/tests/suites/replication/conflict_resolve_test.py

But I think it makes sense to put the code directly to the test function and remove 'add_*' helper function. Because you need only 'add' operations you can do like this:

test_groups = Groups(standalone, SUBTREE_1, rdn=None)
test_groups.create(properties={'member' and 'cn' here})
test_groups.create(properties={'member' and another 'cn' here})

rebased onto 0df5cebc6d945e71f2c5ad83f2ec0d4d471bd6ea

rebased onto 98ad13daa0c2df24244fdcdc1d054c5bd3459031

It should be linked to the associated pagure issue:
@pytest.mark.ds49161

Remove one blank line please, two is too much

You already have the line

topology_m2 is not used in the test

It is used by other test functions in the file.

Thanks for the valuable review, changes made, please check.

rebased onto fbe62eb751b280df86744272eb802d7ac51816ae

Right, I grepped the wrong word...
Okay, looks good to me, ack!

Pull-Request has been merged by spichugi

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/2858

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

Metadata