|
|
0a5078 |
From 6fd4fd082424838f7d06e0de8683d28f04ec0d43 Mon Sep 17 00:00:00 2001
|
|
|
0a5078 |
From: Mark Reynolds <mreynolds@redhat.com>
|
|
|
0a5078 |
Date: Wed, 10 Aug 2022 08:59:15 -0400
|
|
|
0a5078 |
Subject: [PATCH 2/4] Issue 5412 - lib389 - do not set backend name to
|
|
|
0a5078 |
lowercase
|
|
|
0a5078 |
|
|
|
0a5078 |
Description:
|
|
|
0a5078 |
|
|
|
0a5078 |
There is no reason to set a new suffix to lowercase. The server
|
|
|
0a5078 |
will correctly handle the case, and some customers, especially
|
|
|
0a5078 |
with migrations, want to have the base suffix a certain case.
|
|
|
0a5078 |
|
|
|
0a5078 |
relates: https://github.com/389ds/389-ds-base/issues/5412
|
|
|
0a5078 |
|
|
|
0a5078 |
Reviewed by: spichugi(Thanks!)
|
|
|
0a5078 |
---
|
|
|
0a5078 |
dirsrvtests/tests/suites/basic/basic_test.py | 33 ++++++++++++++++++--
|
|
|
0a5078 |
src/lib389/lib389/backend.py | 3 +-
|
|
|
0a5078 |
2 files changed, 32 insertions(+), 4 deletions(-)
|
|
|
0a5078 |
|
|
|
0a5078 |
diff --git a/dirsrvtests/tests/suites/basic/basic_test.py b/dirsrvtests/tests/suites/basic/basic_test.py
|
|
|
0a5078 |
index 003cd8f28..6fa4dea25 100644
|
|
|
0a5078 |
--- a/dirsrvtests/tests/suites/basic/basic_test.py
|
|
|
0a5078 |
+++ b/dirsrvtests/tests/suites/basic/basic_test.py
|
|
|
0a5078 |
@@ -22,6 +22,8 @@ from lib389.idm.directorymanager import DirectoryManager
|
|
|
0a5078 |
from lib389.config import LDBMConfig
|
|
|
0a5078 |
from lib389.dseldif import DSEldif
|
|
|
0a5078 |
from lib389.rootdse import RootDSE
|
|
|
0a5078 |
+from lib389.backend import Backends
|
|
|
0a5078 |
+from lib389.idm.domain import Domain
|
|
|
0a5078 |
|
|
|
0a5078 |
|
|
|
0a5078 |
pytestmark = pytest.mark.tier0
|
|
|
0a5078 |
@@ -1410,8 +1412,35 @@ def test_ldbm_modification_audit_log(topology_st):
|
|
|
0a5078 |
assert conn.searchAuditLog('%s: %s' % (attr, VALUE))
|
|
|
0a5078 |
|
|
|
0a5078 |
|
|
|
0a5078 |
-@pytest.mark.skipif(not get_user_is_root() or ds_is_older('1.4.0.0'),
|
|
|
0a5078 |
- reason="This test is only required if perl is enabled, and requires root.")
|
|
|
0a5078 |
+def test_suffix_case(topology_st):
|
|
|
0a5078 |
+ """Test that the suffix case is preserved when creating a new backend
|
|
|
0a5078 |
+
|
|
|
0a5078 |
+ :id: 4eff15be-6cde-4312-b492-c88941876bda
|
|
|
0a5078 |
+ :setup: Standalone Instance
|
|
|
0a5078 |
+ :steps:
|
|
|
0a5078 |
+ 1. Create backend with uppercase characters
|
|
|
0a5078 |
+ 2. Create root node entry
|
|
|
0a5078 |
+ 3. Search should return suffix with upper case characters
|
|
|
0a5078 |
+ :expectedresults:
|
|
|
0a5078 |
+ 1. Success
|
|
|
0a5078 |
+ 2. Success
|
|
|
0a5078 |
+ 3. Success
|
|
|
0a5078 |
+ """
|
|
|
0a5078 |
+
|
|
|
0a5078 |
+ # Start with a clean slate
|
|
|
0a5078 |
+ topology_st.standalone.restart()
|
|
|
0a5078 |
+
|
|
|
0a5078 |
+ TEST_SUFFIX = 'dc=UPPER_CASE'
|
|
|
0a5078 |
+
|
|
|
0a5078 |
+ backends = Backends(topology_st.standalone)
|
|
|
0a5078 |
+ backends.create(properties={'nsslapd-suffix': TEST_SUFFIX,
|
|
|
0a5078 |
+ 'name': 'upperCaseRoot',
|
|
|
0a5078 |
+ 'sample_entries': '001004002'})
|
|
|
0a5078 |
+
|
|
|
0a5078 |
+ domain = Domain(topology_st.standalone, TEST_SUFFIX)
|
|
|
0a5078 |
+ assert domain.dn == TEST_SUFFIX
|
|
|
0a5078 |
+
|
|
|
0a5078 |
+
|
|
|
0a5078 |
def test_dscreate(request):
|
|
|
0a5078 |
"""Test that dscreate works, we need this for now until setup-ds.pl is
|
|
|
0a5078 |
fully discontinued.
|
|
|
0a5078 |
diff --git a/src/lib389/lib389/backend.py b/src/lib389/lib389/backend.py
|
|
|
0a5078 |
index cbd2810e9..24613655d 100644
|
|
|
0a5078 |
--- a/src/lib389/lib389/backend.py
|
|
|
0a5078 |
+++ b/src/lib389/lib389/backend.py
|
|
|
0a5078 |
@@ -608,8 +608,7 @@ class Backend(DSLdapObject):
|
|
|
0a5078 |
dn = ",".join(dn_comps)
|
|
|
0a5078 |
|
|
|
0a5078 |
if properties is not None:
|
|
|
0a5078 |
- suffix_dn = properties['nsslapd-suffix'].lower()
|
|
|
0a5078 |
- dn_comps = ldap.dn.explode_dn(suffix_dn)
|
|
|
0a5078 |
+ dn_comps = ldap.dn.explode_dn(properties['nsslapd-suffix'])
|
|
|
0a5078 |
ndn = ",".join(dn_comps)
|
|
|
0a5078 |
properties['nsslapd-suffix'] = ndn
|
|
|
0a5078 |
sample_entries = properties.pop(BACKEND_SAMPLE_ENTRIES, False)
|
|
|
0a5078 |
--
|
|
|
0a5078 |
2.37.1
|
|
|
0a5078 |
|