#50319 Issue:50112 - Port ACI test suit from TET to python3(Delete and Add)
Closed by spichugi. Opened by aborah.
aborah/389-ds-base deladd  into  master

Download 50319.patch

Port ACI test suit from TET to python3(Delete and Add)

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

Reviewed by: ???

use with pytest.raises instead of try except

rebased onto 4d4c74a687b87c75d5a0de1b1d73112dfc5b0537

@firstyear , changes are done , Please check

Why do you add ou: People attribute for the users?

Why do you add ou: People attribute for the users?

There is a dynamic group which has :

group.add("memberURL", f'ldap:///{DEFAULT_SUFFIX}??sub?(&(ou=People)(cn=test_user_1000))')

as by default if you create a user with user = users.create_test_user(uid=i, gid=i)

the dn will be 'uid=test_user_1000,ou=People,dc=example,dc=com' but no ou: 'People'

but dynamic group need ou: 'People '

Why do you add ou: People attribute for the users?

There is a dynamic group which has :
group.add("memberURL", f'ldap:///{DEFAULT_SUFFIX}??sub?(&(ou=People)(cn=test_user_1000))')
as by default if you create a user with user = users.create_test_user(uid=i, gid=i)
the dn will be 'uid=test_user_1000,ou=People,dc=example,dc=com' but no ou: 'People'
but dynamic group need ou: 'People '

It doesn't make sense... We don't create users with ou attribute. If you want to setup memberURL with the specific filter - use something like &(objectclass=person)(cn=test_user_1000))

You can use get() method here. First, create UserAccounts instance (without this rdn). And then get the user by selector (test_user_1000)

rebased onto b3772c5580fe5c9ebaa120a4edd2af7bdc074b74

@spichugi , changes are done , Please check

rebased onto 1cfd7584b2757af19eadbb3ed5e40537abbd6c43

It shouldn't be a docstring. It should be a commented text.

Please, go through --pylint output. There are a few issues left

You already have users object. Why not to use it here?

I think it will make more sense if you create a user (and assign it to user for delete operation). And then you can assert if the user is present (user.exists())

I think it will make more sense if you create a user (and assign it to user for delete operation). And then you can assert if the user is present (user.exists())

You cant do it as you only have add privilege to parents .

And UserAccounts(conn, DEFAULT_SUFFIX, rdn='uid=test_user_1000, ou=people') and UserAccounts(topo.standalone, DEFAULT_SUFFIX).get('test_user_1').delete() are different

see conn and topo.standalone

rebased onto d826d53052f08e9dc81f193eda05b703717048f0

@spichugi , changes are done , Please check

You cant do it as you only have add privilege to parents .
And UserAccounts(conn, DEFAULT_SUFFIX, rdn='uid=test_user_1000, ou=people') and UserAccounts(topo.standalone, DEFAULT_SUFFIX).get('test_user_1').delete() are different

Right. We can't use the same UserAccount instance for the delete operation.
But the rest in my comment is true. assert doesn't make sense here because if the user creation will fail it will through the exception anyway.
We should assert that the user exists().

see conn and topo.standalone !!

The imperative mood plus these two exclamation marks (after a space) can be misunderstood as a rude gesture (it sounds a bit like you are yelling at me).
Please, avoid such expressions in the project.

P.S. I understand that it wasn't, probably, your intention. But to be sure, please, use polite language forms. :)

rebased onto b673a77540f5218f5c402258c0e5ca8d39d6c4ba

rebased onto a6a53483afa7e421a693cab73299bbaf05b8b303

You cant do it as you only have add privilege to parents .
And UserAccounts(conn, DEFAULT_SUFFIX, rdn='uid=test_user_1000, ou=people') and UserAccounts(topo.standalone, DEFAULT_SUFFIX).get('test_user_1').delete() are different

Right. We can't use the same UserAccount instance for the delete operation.
But the rest in my comment is true. assert doesn't make sense here because if the user creation will fail it will through the exception anyway.
We should assert that the user exists().

see conn and topo.standalone !!

The imperative mood plus these two exclamation marks (after a space) can be misunderstood as a rude gesture (it sounds a bit like you are yelling at me).
Please, avoid such expressions in the project.
P.S. I understand that it wasn't, probably, your intention. But to be sure, please, use polite language forms. :)

Obviously it was not my intention , will keep in mind in future

@spichugi , changes are done , Please check

LGTM! Thanks!
Ack

rebased onto af97382fa1f7444ab7cc013e48dd7a4c80430f5f

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

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