From 1d533e61d395c11978d62530afa48ef1cf334346 Mon Sep 17 00:00:00 2001
From: el_kaboing <el_kaboing@localhost>
Date: Thu, 19 Oct 2006 14:27:32 +0000
Subject: [PATCH] Fix for Issue 842 - An ldif file is generated during run time which is used to add the ldaps conenction handler. The SSL port which is used is obtained from the config.py file and is defined by the user.
---
opends/tests/functional-tests/shared/python/security.py | 34 ++++++++++++++++++++++++++++++++++
opends/tests/functional-tests/shared/functions/security.xml | 7 +++++--
2 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/opends/tests/functional-tests/shared/functions/security.xml b/opends/tests/functional-tests/shared/functions/security.xml
index ac02ce3..c624a66 100755
--- a/opends/tests/functional-tests/shared/functions/security.xml
+++ b/opends/tests/functional-tests/shared/functions/security.xml
@@ -111,6 +111,9 @@
'result' : STAXResult }
</call>
+ <!--- Modify the SSL port to the user-defined value -->
+ <script>write_ldaps_ldif_file('%s' % (TMPDIR), '%s' % (DIRECTORY_INSTANCE_SSL_PORT));</script>
+
<!--- Add LDAPS Connection Handler -->
<message>
'Adding LDAPS Connection Handler'
@@ -121,14 +124,14 @@
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'entryToBeAdded' : '%s/security/%s/setup/enable_ldaps_conn_handler.ldif' % (LDIF_DATA_DIR,keystoreType) }
+ 'entryToBeAdded' : '%s/ldaps_port.ldif' % (TMPDIR) }
</call>
<call function="'checktestRC'">
{ 'returncode' : RC ,
'result' : STAXResult }
</call>
-
+
</sequence>
</function>
diff --git a/opends/tests/functional-tests/shared/python/security.py b/opends/tests/functional-tests/shared/python/security.py
new file mode 100644
index 0000000..4f5f22f
--- /dev/null
+++ b/opends/tests/functional-tests/shared/python/security.py
@@ -0,0 +1,34 @@
+#! /usr/bin python
+
+def write_ldaps_ldif_file(path, port):
+ ldif_file = open("/tmp/ldaps_port.ldif","w")
+
+ ldif_file.write("dn: cn=LDAPS Connection Handler,cn=Connection Handlers,cn=config\n")
+ ldif_file.write("objectclass: top\n")
+ ldif_file.write("objectclass: ds-cfg-connection-handler\n")
+ ldif_file.write("objectclass: ds-cfg-ldap-connection-handler\n")
+ ldif_file.write("cn: LDAPS Connection Handler\n")
+ ldif_file.write("ds-cfg-connection-handler-class: org.opends.server.protocols.ldap.LDAPConnectionHandler\n")
+ ldif_file.write("ds-cfg-connection-handler-enabled: true\n")
+ ldif_file.write("ds-cfg-listen-address: 0.0.0.0\n")
+
+ ldif_file.write("ds-cfg-listen-port: ")
+ ldif_file.write(port)
+ ldif_file.write("\n")
+
+ ldif_file.write("ds-cfg-allow-ldapv2: true\n")
+ ldif_file.write("ds-cfg-keep-stats: true\n")
+ ldif_file.write("ds-cfg-use-tcp-keepalive: true\n")
+ ldif_file.write("ds-cfg-use-tcp-nodelay: true\n")
+ ldif_file.write("ds-cfg-allow-tcp-reuse-address: true\n")
+ ldif_file.write("ds-cfg-send-rejection-notice: true\n")
+ ldif_file.write("ds-cfg-max-request-size: 5 mb\n")
+ ldif_file.write("ds-cfg-num-request-handlers: 2\n")
+ ldif_file.write("ds-cfg-allow-start-tls: false\n")
+ ldif_file.write("ds-cfg-use-ssl: true\n")
+ ldif_file.write("ds-cfg-ssl-client-auth-policy: optional\n")
+ ldif_file.write("ds-cfg-ssl-cert-nickname: server-cert\n")
+
+ ldif_file.close()
+
+
--
Gitblit v1.10.0