#50096 Issue: 49761 - Fix CI test suite issues
Closed by spichugi. Opened by aborah.
aborah/389-ds-base regression  into  master

Download 50096.patch

Bug Description:Fix CI test suite issues

Fix Description: Ported test scrips

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

Reviewed by: Mark Reynolds (https://pagure.io/389-ds-base/pull-request/50083)

It should be 2018

You can use here - topo_m2.ms['master1'].config.replace('nsslapd-plugin-binddn-tracking', 'on')

Please, use UserAccounts (DSLdapObject here)

you can use Domain(DSLdapObject) here

Please, don't use the Legacy method - testReplication
Use ReplicationManager().test_replication(master1, master2) - search the example with 'grep -rni test_replication'

You can create an agreement with ReplicationManager() object too (check the lib389/replica.py).
Or you can use Agreements(DSLdapObjects) directly

The way we work with DSLdapObject is:
1. Define: vlv_searches = VLVSearches(M2)
2. Create objects with it: userroot_vlvsearch = vlv_searches.create()
3. Access the element: userroot_vlvsearch.delete_all()

In the future, when we'll get rid of all legacy objects - we'll use shortcuts - M2.vlvsearches.create() instead of first two steps.

It is Legacy objects.
https://pagure.io/389-ds-base/blob/master/f/src/lib389/lib389/init.py#_306

Please, use MappingTrees and Backends DSLDapObjects.

Please, use UserAccounts (DSLdapObject here)
@spichugi here i need to define my own object classes

'objectclass': "top person inetuser".split()

how can i define my own object classes as bellow are predefined object classes in UserAccounts method.

self._objectclasses = [
'account',
'posixaccount',
'inetOrgPerson',
'organizationalPerson',
]

@spichugi here i need to define my own object classes

'objectclass': "top person inetuser".split()
how can i define my own object classes as bellow are predefined object classes in UserAccounts method.

Why do you need it in this test case? Looking on the BZ... And it looks like any user will work...

And if you'll need to add some specific objectclasses, you can use this example
https://pagure.io/389-ds-base/blob/master/f/dirsrvtests/tests/suites/acl/acl_deny_test.py#_44

But I really dont think that you need it here

rebased onto 4858246bc8c1ad275b38d28ab9643b68e02ee1cc

rebased onto 8d13807b4541a628dcdfd75bbeefa03e0e55c45e

@spichugi all changes done . Please merge if all ok .

rebased onto ea63c42c94d8569da4bd128ebae3695c0a293457

@mreynolds please merge this one also if , all ok

You can use users.create_test_user(uid=1) here. Your user_properties is the default

Also, just add two users with two lines:
test_user_1 = users.create_test_user(uid=1)
test_user_2 = users.create_test_user(uid=2)

And then you can use the users for other operations.

you can use test_user_2.replace("cn", "new value") here

Let's not use old legacy methods.
You already have an object 'replica'. You can use it for replacing attributes:

replica.replace("nsDS5ReplicaId", "7")

It is not safe to check for the string output (and it is harder to read because it is inconsistent with other code logic)

You can check it with

assert replica.present("nsDS5ReplicaId", "7")

the same here. Let's use standard search methods that are available in DSLdapObject

rebased onto 38e44fb2e8aaff1dd5900e2e67c3de86bf37d0d4

@spichugi changes has been as per your suggestion , kindly merger if all ok

You can use the existing repl_agreement object here

rebased onto 4bb89f164c885af381c5298a86dadf3cd8a0b169

@spichugi changes has been as per your suggestion , kindly merger if all ok

Looks good to me! Nice job!

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

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