Skip to content

Commit

Permalink
Issue 6224 - Remove test_referral_subsuffix from ds_logs_test.py (#6456)
Browse files Browse the repository at this point in the history
Bug Description:

test_referral_subsuffix test was removed from main branch and some other
ones for higher versions. But, it was not removed from 389-ds-base-1.4.3
and 389-ds-base-2.1. The test doesn't work anymore with the fix for
Issue 6224, because the added new control limited one backend for internal
search. The test should be removed.

Fix Description:

remove the test from ds_logs_test.py

relates: #6224
  • Loading branch information
mmatsuya authored Dec 20, 2024
1 parent d968f3b commit b3a8146
Showing 1 changed file with 0 additions and 177 deletions.
177 changes: 0 additions & 177 deletions dirsrvtests/tests/suites/ds_logs/ds_logs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1222,183 +1222,6 @@ def fin():

request.addfinalizer(fin)

def test_referral_subsuffix(topology_st, request):
"""Test the results of an inverted parent suffix definition in the configuration.
For more details see:
https://www.port389.org/docs/389ds/design/mapping_tree_assembly.html
:id: 4faf210a-4fde-4e4f-8834-865bdc8f4d37
:setup: Standalone instance
:steps:
1. First create two Backends, without mapping trees.
2. create the mapping trees for these backends
3. reduce nsslapd-referral-check-period to accelerate test
4. Remove error log file
5. Create a referral entry on parent suffix
6. Check that the server detected the referral
7. Delete the referral entry
8. Check that the server detected the deletion of the referral
9. Remove error log file
10. Create a referral entry on child suffix
11. Check that the server detected the referral on both parent and child suffixes
12. Delete the referral entry
13. Check that the server detected the deletion of the referral on both parent and child suffixes
14. Remove error log file
15. Create a referral entry on parent suffix
16. Check that the server detected the referral on both parent and child suffixes
17. Delete the child referral entry
18. Check that the server detected the deletion of the referral on child suffix but not on parent suffix
19. Delete the parent referral entry
20. Check that the server detected the deletion of the referral parent suffix
:expectedresults:
all steps succeeds
"""
inst = topology_st.standalone
# Step 1 First create two Backends, without mapping trees.
PARENT_SUFFIX='dc=parent,dc=com'
CHILD_SUFFIX='dc=child,%s' % PARENT_SUFFIX
be1 = create_backend(inst, 'Parent', PARENT_SUFFIX)
be2 = create_backend(inst, 'Child', CHILD_SUFFIX)
# Step 2 create the mapping trees for these backends
mts = MappingTrees(inst)
mt1 = mts.create(properties={
'cn': PARENT_SUFFIX,
'nsslapd-state': 'backend',
'nsslapd-backend': 'Parent',
})
mt2 = mts.create(properties={
'cn': CHILD_SUFFIX,
'nsslapd-state': 'backend',
'nsslapd-backend': 'Child',
'nsslapd-parent-suffix': PARENT_SUFFIX,
})

dc_ex = Domain(inst, dn=PARENT_SUFFIX)
assert dc_ex.exists()

dc_st = Domain(inst, dn=CHILD_SUFFIX)
assert dc_st.exists()

# Step 3 reduce nsslapd-referral-check-period to accelerate test
# requires a restart done on step 4
REFERRAL_CHECK=7
topology_st.standalone.config.set("nsslapd-referral-check-period", str(REFERRAL_CHECK))

# Check that if we create a referral at parent level
# - referral is detected at parent backend
# - referral is not detected at child backend

# Step 3 Remove error log file
topology_st.standalone.stop()
lpath = topology_st.standalone.ds_error_log._get_log_path()
os.unlink(lpath)
topology_st.standalone.start()

# Step 4 Create a referral entry on parent suffix
rs_parent = Referrals(topology_st.standalone, PARENT_SUFFIX)

referral_entry_parent = rs_parent.create(properties={
'cn': 'testref',
'ref': 'ldap://localhost:38901/ou=People,dc=example,dc=com'
})

# Step 5 Check that the server detected the referral
time.sleep(REFERRAL_CHECK + 1)
assert topology_st.standalone.ds_error_log.match('.*slapd_daemon - New referral entries are detected under %s.*' % PARENT_SUFFIX)
assert not topology_st.standalone.ds_error_log.match('.*slapd_daemon - New referral entries are detected under %s.*' % CHILD_SUFFIX)
assert not topology_st.standalone.ds_error_log.match('.*slapd_daemon - No more referral entry under %s' % PARENT_SUFFIX)

# Step 6 Delete the referral entry
referral_entry_parent.delete()

# Step 7 Check that the server detected the deletion of the referral
time.sleep(REFERRAL_CHECK + 1)
assert topology_st.standalone.ds_error_log.match('.*slapd_daemon - No more referral entry under %s' % PARENT_SUFFIX)

# Check that if we create a referral at child level
# - referral is detected at parent backend
# - referral is detected at child backend

# Step 8 Remove error log file
topology_st.standalone.stop()
lpath = topology_st.standalone.ds_error_log._get_log_path()
os.unlink(lpath)
topology_st.standalone.start()

# Step 9 Create a referral entry on child suffix
rs_child = Referrals(topology_st.standalone, CHILD_SUFFIX)
referral_entry_child = rs_child.create(properties={
'cn': 'testref',
'ref': 'ldap://localhost:38901/ou=People,dc=example,dc=com'
})

# Step 10 Check that the server detected the referral on both parent and child suffixes
time.sleep(REFERRAL_CHECK + 1)
assert topology_st.standalone.ds_error_log.match('.*slapd_daemon - New referral entries are detected under %s.*' % PARENT_SUFFIX)
assert topology_st.standalone.ds_error_log.match('.*slapd_daemon - New referral entries are detected under %s.*' % CHILD_SUFFIX)
assert not topology_st.standalone.ds_error_log.match('.*slapd_daemon - No more referral entry under %s' % CHILD_SUFFIX)

# Step 11 Delete the referral entry
referral_entry_child.delete()

# Step 12 Check that the server detected the deletion of the referral on both parent and child suffixes
time.sleep(REFERRAL_CHECK + 1)
assert topology_st.standalone.ds_error_log.match('.*slapd_daemon - No more referral entry under %s' % PARENT_SUFFIX)
assert topology_st.standalone.ds_error_log.match('.*slapd_daemon - No more referral entry under %s' % CHILD_SUFFIX)

# Check that if we create a referral at child level and parent level
# - referral is detected at parent backend
# - referral is detected at child backend

# Step 13 Remove error log file
topology_st.standalone.stop()
lpath = topology_st.standalone.ds_error_log._get_log_path()
os.unlink(lpath)
topology_st.standalone.start()

# Step 14 Create a referral entry on parent suffix
# Create a referral entry on child suffix
referral_entry_parent = rs_parent.create(properties={
'cn': 'testref',
'ref': 'ldap://localhost:38901/ou=People,dc=example,dc=com'
})
referral_entry_child = rs_child.create(properties={
'cn': 'testref',
'ref': 'ldap://localhost:38901/ou=People,dc=example,dc=com'
})

# Step 15 Check that the server detected the referral on both parent and child suffixes
time.sleep(REFERRAL_CHECK + 1)
assert topology_st.standalone.ds_error_log.match('.*slapd_daemon - New referral entries are detected under %s.*' % PARENT_SUFFIX)
assert topology_st.standalone.ds_error_log.match('.*slapd_daemon - New referral entries are detected under %s.*' % CHILD_SUFFIX)
assert not topology_st.standalone.ds_error_log.match('.*slapd_daemon - No more referral entry under %s' % CHILD_SUFFIX)

# Step 16 Delete the child referral entry
referral_entry_child.delete()

# Step 17 Check that the server detected the deletion of the referral on child suffix but not on parent suffix
time.sleep(REFERRAL_CHECK + 1)
assert topology_st.standalone.ds_error_log.match('.*slapd_daemon - No more referral entry under %s' % CHILD_SUFFIX)
assert not topology_st.standalone.ds_error_log.match('.*slapd_daemon - No more referral entry under %s' % PARENT_SUFFIX)

# Step 18 Delete the parent referral entry
referral_entry_parent.delete()

# Step 19 Check that the server detected the deletion of the referral parent suffix
time.sleep(REFERRAL_CHECK + 1)
assert topology_st.standalone.ds_error_log.match('.*slapd_daemon - No more referral entry under %s' % PARENT_SUFFIX)

def fin():
log.info('Deleting referral')
try:
referral_entry_parent.delete()
referral.entry_child.delete()
except:
pass

request.addfinalizer(fin)

def test_missing_backend_suffix(topology_st, request):
"""Test that the server does not crash if a backend has no suffix
Expand Down

0 comments on commit b3a8146

Please sign in to comment.