#50168 Issue: 50112 - Port ACI test suit from TET to python3(Global Group)
Closed by spichugi. Opened by aborah.
aborah/389-ds-base globalgroup  into  master

Download 50168.patch

Port ACI test suit from TET to python3(Global Group)

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

Reviewed by: ???

rebased onto 8477ba634c4b88e83be829f5c64d8d294dfa049f

rebased onto b078501f31662d234518276a33c956a1e065365e

rebased onto e90bb77f6d73e4b506720873f3f1698ab11cfe44

@firstyear , this one is also ready to review .

rebased onto bda0b3fac574994e643c4405ffd76c3254d16ada

rebased onto c2ffb3eff08d919b160f395479de87f8cbf9e432

rebased onto f47ef46c9d6aa46ceb4cd06717b7a03a9eb0094e

rebased onto fabc6978100bd52d94534341969105ac95f1668b

rebased onto 0899212d93ea927eccb34f0e41b7e4933bfe1f6e

rebased onto 15de57aaad52c4ddd8d7f3a1220fcf52d7750808

rebased onto 27ac0ef905f8b74cf823c0624c1b1de7f6c1967b

rebased onto 26d3bf2504591ae624ff15baa62d5ee070690796

typo in function name

Another typo in function name - in fact all the function names have typos

indentation looks off of above aci string

Besides those minor issues this looks okay to me.

rebased onto ce4aefbb89d3a53a64ca6fc07e4fe58017c6ca93

rebased onto 12d5f258b51d87d55f896a1fec0b4777925d6e02

@mreynolds all changes are done as per your suggestion

rebased onto 5579a8e7a4dae409b615bec8b7d183d9cb486b14

The same here.
Please, run pytest-pylint using the suggestion from https://pagure.io/389-ds-base/pull-request/50180#comment-75994

rebased onto 7a8d99da2f3e2e902fc435617c6ab52b1d727cc9

rebased onto b80d6c71184f2e079d55f99f4d14b725d57938a8

"his membership"

Don't use gendered language. It's "their membership".

As before: don't have the "useraccount(conn, ....)" in the .raises clause.

Worse, you even copy paste the line to the line below, and do it again.

ua = UserAccount(conn, ...)
with pytest.raises:
    ua.replace(...)
assert ua.get_attr_val_utf8() == '...'

I have made this comment before in multiple cases now, please please please please improve this.

Why is it undefined?

This is not coherent

This says there is a not(undef(attr) OR false attr), where is the OR in the aci?

You need to describe the structure of the objects and how this works.

I didn't make it to the end of the file to review. I think you need to work on commenting for clarity and explanation, and re-view all my past comments on what you are doing code wise.

rebased onto 975e4c55e6481c690397a63551f709bc4c20c66f

rebased onto 96ef9cff38508cf1efe89f343b2cac3a5a76c051

rebased onto 3d26331c51a5f7bda6af71bdd36e997515dd57e1

rebased onto 9b3e6c83c0202e9f963133b801ddaa8249e24803

I don't know why you keep doing this. Use userAccountS (note the S on the end). Then you can do:

uas = UserAccounts(topo.standalone, basedn) # Here basedn would be ou=nestedgroup,DEFAULT_SUFFIX
for i in [list ...]: 
    uas.create(properties={
    ....
})

Much cleaner.

I also have no idea what this group stuff is you are doing, but it looks like you could do:

grp = UniqueGroup(...)
uas = UserAccounts(topo.standalone, basedn) # Here basedn would be ou=nestedgroup,DEFAULT_SUFFIX
for i in [list ...]: 
    user = uas.create(properties={
    ....
    })
    grp.add_member(user.dn)

Most of lib389 is designed so you never need to add or think about ldap stuff, or handle it too manually. Mainly because everything about LDAP is an un-usable confusing nightmare disaster show.

So if you find yourself in this pattern with lots of dns, and using attributes manually, it probably is an indicator that you are missing some of the nice functions of lib389.

Don't use UserAccount when it's not user accounts. At least use "DSLdapObject", OR in this case, you could use delete_branch_s, but it's wildly dangerous and violates my "no _s function rule".

Leftover debugging stuff?

See comments above.

I don't know why you keep doing this. Use userAccountS (note the S on the end). Then you can do:
uas = UserAccounts(topo.standalone, basedn) # Here basedn would be ou=nestedgroup,DEFAULT_SUFFIX
for i in [list ...]:
uas.create(properties={
....
})

Much cleaner.
I also have no idea what this group stuff is you are doing, but it looks like you could do:
grp = UniqueGroup(...)
uas = UserAccounts(topo.standalone, basedn) # Here basedn would be ou=nestedgroup,DEFAULT_SUFFIX
for i in [list ...]:
user = uas.create(properties={
....
})
grp.add_member(user.dn)

Most of lib389 is designed so you never need to add or think about ldap stuff, or handle it too manually. Mainly because everything about LDAP is an un-usable confusing nightmare disaster show.
So if you find yourself in this pattern with lots of dns, and using attributes manually, it probably is an indicator that you are missing some of the nice functions of lib389.

User part has been corrected, but group part !! You cant create group entry with UserAccounts.

*** ldap.UNWILLING_TO_PERFORM: Attribute uid must not be None

Groups does not have 'uid', 'cn', 'sn' , uidNumber, gidNumber, homeDirectory which is required by UserAccounts

Seriously ... please stop. Think about the problem you just had, and why it happened. I've been trying for weeks, literally weeks that types in lib389 are typed, and won't create things that don't match. If you have something that isn't a UserAccount ... like a Group, and you try to make it of course it will fail. Please please please stop and think about the types and the exception you ahve here.

rebased onto 88b6f47e84511a1722cc8cf763497aa9b522dda4

I'll check this in a few days, I'm a bit unwell at the moment and can't do this right now.

rebased onto e8c0a86b496534477fe2651e69a360a525fb9729

rebased onto 1f97180d3a8c4717ce449bbe39a9d2527099f5aa

I'll check monday if that's okay.

rebased onto 55f333b4cab7e6147162c801305af0be332b9a6d

@firstyear , changes are done , please check

rebased onto 20fdbe29a669ff55be9fb030dc7973d6501d276c

I'll check this tomorrow, I'm writing some tests today sorry.

rebased onto 5563e770c4e2d6681710c9f4c4af6660f7839b8d

I reckon there are still issues here, and it's ineffecient, but I can't see them, it's too long, so merge and I'll just fix it later.

Pull-Request has been merged by firstyear

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/3227

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