#49406 Port backend_test.py lib389 test to the new DSLdapObject implementation
Closed: wontfix 5 years ago Opened 6 years ago by spichugi.

Port the test cases from lib389/tests/backend_test.py to new Backends(DSLdapObject).

Legacy object test cases should be at lib389/tests/backendLegacy_test.py
test_create can be ported with the same structure, but the docstrings should be adjusted to the proper format.

Additionally, we need to test the next methods: lint, create_sample_entries, get_monitor, get_indexes. Just test the very basic behavior:

  • test_lint - check that we can detect missing mapping tree entries for the backend (take a look at "def _lint_mappingtree(self):" at lib389/backend.py)
  • test_create_sample_entries - check that entries are created with a valid input; check that entries aren't created with an invalid input;
  • test_get_monitor - check that we get the right object;
  • test_get_indexes - check that we get the right object.
  • test_delete_valid, test_delete_invalid - rework to test_get_valid and test_get_invalid.
  • test_delete - add the test case

Metadata Update from @mreynolds:
- Custom field component adjusted to None
- Custom field origin adjusted to None
- Custom field reviewstatus adjusted to None
- Custom field type adjusted to None
- Custom field version adjusted to None
- Issue set to the milestone: 1.4 backlog

6 years ago

Hey there,

388 +    backend = topology_st.standalone.backends.create(properties={BACKEND_SUFFIX: NEW_SUFFIX_1_RDN,
389 +                                                                 BACKEND_NAME: BACKEND_NAME_1})

Avoid the use of backend_suffix and backend_name : they are there for legacy compat, but they should be removed.

Use "nsslapd-suffix" and "cn" instead :)

429 +    ents = topology_st.standalone.backends.list()

I don't like this syntax either. While it can be convinient to say "topo.backends..." I think it's cleaner to say:

backends = Backends(topology.standalone)
backends.list()

But that's my personal preference.

840 +    assert backend_monitor.normalizeddncachetries == monitor.normalizeddncachetries

Don't check this, because the value could CHANGE in the background due to the way this monitor works. Check the .dn is the same is sufficent.

Otherwise looks pretty good, @spichugi may have some more comments,

Thanks!

Metadata Update from @spichugi:
- Issue assigned to spichugi

5 years ago

Metadata Update from @spichugi:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

5 years ago

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 issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/2465

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: fixed)

3 years ago

Login to comment on this ticket.

Metadata