Skip to content

Commit 81ca90a

Browse files
tiranencukou
authored andcommitted
Convert slapdtest to package with data
The slapdtest module has been converted to a package to ship the test certs as package data. Closes: #76 Signed-off-by: Christian Heimes <cheimes@redhat.com>
1 parent cd6f620 commit 81ca90a

File tree

14 files changed

+10
-9
lines changed

14 files changed

+10
-9
lines changed

Lib/slapdtest.py renamed to Lib/slapdtest/__init__.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import ldap
2525
from ldap.compat import quote_plus
2626

27+
HERE = os.path.abspath(os.path.dirname(__file__))
28+
2729
# a template string for generating simple slapd.conf file
2830
SLAPD_CONF_TEMPLATE = r"""
2931
serverID %(serverid)s
@@ -191,14 +193,11 @@ def __init__(self):
191193
ldapi_path = os.path.join(self.testrundir, 'ldapi')
192194
self.ldapi_uri = "ldapi://%s" % quote_plus(ldapi_path)
193195
# TLS certs
194-
capath = os.path.abspath(os.path.join(
195-
os.getcwd(), 'Tests/certs'
196-
))
197-
self.cafile = os.path.join(capath, 'ca.pem')
198-
self.servercert = os.path.join(capath, 'server.pem')
199-
self.serverkey = os.path.join(capath, 'server.key')
200-
self.clientcert = os.path.join(capath, 'client.pem')
201-
self.clientkey = os.path.join(capath, 'client.key')
196+
self.cafile = os.path.join(HERE, 'certs/ca.pem')
197+
self.servercert = os.path.join(HERE, 'certs/server.pem')
198+
self.serverkey = os.path.join(HERE, 'certs/server.key')
199+
self.clientcert = os.path.join(HERE, 'certs/client.pem')
200+
self.clientkey = os.path.join(HERE, 'certs/client.key')
202201

203202
def _check_requirements(self):
204203
binaries = [
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy