mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

andrug
04.35.2008 1f47dd72a570c48695c0de46784af216e7e35339
allow opends to setup ssl/startTLS
5 files modified
99 ■■■■■ changed files
opends/tests/system-tests/phases/installation/installation_opends.xml 24 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/parser/parser.py 27 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/shared/functions/opendsadm.xml 40 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/shared/functions/utils.xml patch | view | raw | blame | history
opends/tests/system-tests/scenario/conf.dtd 8 ●●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/installation/installation_opends.xml
@@ -265,7 +265,9 @@
      }
      </call>
      
      <!--== Setup product ==-->
      <if expr="instance.isSecurityEnabled() == 'false'">
      <call function="'SetUpDsWithScript'">
        { 
          'location'      : instance.getHost(), 
@@ -275,11 +277,29 @@
          'dsBindDN'      : DIRECTORY_INSTANCE_DN,
          'dsBindPwd'     : DIRECTORY_INSTANCE_PSWD,
          'dsBaseDN'      : suffixDn,
          'dsDoNotStart'  : 'TRUE',
            'dsDoNotStart'     : 'true',
          'fileFd'        : fileFd
        }
      </call>
     <else>
        <call function="'SetUpDsWithScript'">
          {
            'location'         : instance.getHost(),
            'dsPath'           : instance.getInstallDir(),
            'dsPort'           : instance.getLDAPPort(),
            'dsSslPort'        : instance.getLDAPSPort(),
            'dsJmxPort'        : instance.getJMXPort(),
            'dsBindDN'         : DIRECTORY_INSTANCE_DN,
            'dsBindPwd'        : DIRECTORY_INSTANCE_PSWD,
            'dsBaseDN'         : suffixDn,
            'dsDoNotStart'     : 'true',
            'dsEnableStartTLS' : instance.isStartTlsEnabled(),
            'dsCertificate'    : instance.getCertificate(),
            'fileFd'           : fileFd
          }
        </call>
      </else>
      </if>
      
      <call function="'writeEndTagStep'">{ 'fileFd' : fileFd}</call>
      
opends/tests/system-tests/phases/parser/parser.py
@@ -273,7 +273,8 @@
class OpendsInstance(Instance):
  "Describes an opends Instance"
  def __init__(self, iid, name, product, role, host, installDir, tarball, \
               portLDAP, portLDAPS, portJMX, portREPL):
               portLDAP, portLDAPS, portJMX, portREPL, \
               securityEnabled, certificate, startTlsEnabled):
    # from instance object
    self.iid         = iid
    self.name        = name
@@ -288,6 +289,9 @@
    self.portJMX     = portJMX
    self.portREPL    = portREPL
    self.javaVersion = NOT_DEFINED
    self.securityEnabled = securityEnabled
    self.certificate     = certificate
    self.startTlsEnabled = startTlsEnabled
    
  def getLDAPSPort(self):
    return self.portLDAPS
@@ -304,6 +308,14 @@
  def setJavaVersion(self,javaVersion):
    self.javaVersion = javaVersion
  def isSecurityEnabled(self):
    return self.securityEnabled
  def getCertificate(self):
    return self.certificate
  def isStartTlsEnabled(self):
    return self.startTlsEnabled
#
@@ -577,6 +589,9 @@
  cPortLDAPS  = '1636'
  cPortJMX    = '1390'
  cPortREPL   = '1391'
  cSecurityEnabled = 'false'
  cCertificate     = NOT_DEFINED
  cStartTlsEnabled = 'false'
  
  #
  # Parsing second level : host,ports,...
@@ -626,6 +641,13 @@
              msg = '%s\n ERROR: instance %s : unknown port node name %s' % \
                    (msg, cName, thisPort.getNodeName())
            
      elif (thisSubChild.getNodeType() == Node.ELEMENT_NODE and
          thisSubChild.getNodeName() == 'security'):
        cSecurityEnabled = _getAttributeNode(thisSubChild,'enabled')
        cCertificate     = _getAttributeNode(thisSubChild,'certificate')
        cStartTlsEnabled = _getAttributeNode(thisSubChild,'startTlsEnabled')
      
      # must be at the end of the if case
      elif (thisSubChild.getNodeType() == Node.TEXT_NODE or
@@ -647,7 +669,8 @@
  cInstallDir = '%s/%s/%s' % (cInstallDir,cName,opendsName)
  return [msg,OpendsInstance(cId,cName,cProduct,cRole,cHost,cInstallDir,\
                             opendsZip,\
                             cPortLDAP,cPortLDAPS,cPortJMX,cPortREPL)]
                             cPortLDAP,cPortLDAPS,cPortJMX,cPortREPL,\
                             cSecurityEnabled,cCertificate,cStartTlsEnabled)]
#============================================================================
opends/tests/system-tests/phases/shared/functions/opendsadm.xml
@@ -50,6 +50,12 @@
        </function-arg-description>
        <function-arg-property name="type" value="Port number"/>
      </function-arg-def>
      <function-arg-def name="dsSslPort" type="optional">
        <function-arg-description>
          Directory server secure port number
        </function-arg-description>
        <function-arg-property name="type" value="Port number"/>
      </function-arg-def>
      <function-arg-def name="dsJmxPort" type="optional">
        <function-arg-description>
          Directory server JMX port number
@@ -98,6 +104,21 @@
        </function-arg-description>
        <function-arg-property name="help" value="option"/>
      </function-arg-def>    
      <function-arg-def name="dsEnableStartTLS" type="optional"
                                                default="'false'">
        <function-arg-description>
          Enable startTLS, must use dsCertifiacte parameter
        </function-arg-description>
        <function-arg-property name="type" value="boolean"/>
      </function-arg-def>
      <function-arg-def name="dsCertificate" type="optional">
        <function-arg-description>
          certificate mode: selfsigned,Pkcs11keyStore,Pkcs12keyStore,
                            JavakeyStore,
        </function-arg-description>
        <function-arg-property name="type" value="string"/>
      </function-arg-def>
      <function-arg-def name="fileFd" type="required">
        <function-arg-description>
          output file descriptor
@@ -120,6 +141,9 @@
        if dsPort:
          STAFCmdParamsList.append('-p %s' % dsPort)
        
        if dsSslPort:
          STAFCmdParamsList.append('-Z %s' % dsSslPort)
        if dsJmxPort:
          STAFCmdParamsList.append('-x %s' % dsJmxPort)
              
@@ -144,6 +168,22 @@
        if dsHelp:
          STAFCmdParamsList.append('-H')
 
        if dsEnableStartTLS:
          dsEnableStartTLS = dsEnableStartTLS.lower()
          if dsEnableStartTLS == 'true':
            STAFCmdParamsList.append('--enableStartTLS')
        if dsCertificate:
          dsCertificate = dsCertificate.lower()
          if dsCertificate == 'selfsigned':
            STAFCmdParamsList.append('--generateSelfSignedCertificate')
          elif dsCertificate == 'pkcs11keystore':
            STAFCmdParamsList.append('--usePkcs11Keystore')
          elif dsCertificate == 'pkcs12keystore':
            STAFCmdParamsList.append('--usePkcs12keyStore')
          elif dsCertificate == 'javakeystore':
            STAFCmdParamsList.append('--useJavaKeystore')
        STAFCmdParams=' '.join(STAFCmdParamsList)
      </script>
      
opends/tests/system-tests/phases/shared/functions/utils.xml
opends/tests/system-tests/scenario/conf.dtd
@@ -40,7 +40,7 @@
  <!ELEMENT domain (#PCDATA)>
<!-- ========== INSTANCE NODE ========================= -->
<!ELEMENT instance (host,installDir,ports?)>
<!ELEMENT instance (host,installDir,ports?,security?)>
<!ATTLIST instance 
    name NMTOKEN #REQUIRED 
    product NMTOKEN #REQUIRED
@@ -53,6 +53,12 @@
    <!ELEMENT ldaps (#PCDATA)>
    <!ELEMENT jmx (#PCDATA)>
    <!ELEMENT replicationServer (#PCDATA)>
  <!ELEMENT security EMPTY>
  <!ATTLIST security
      enabled ( true | false ) "true"
      certificate ( selfSigned | Pkcs11keyStore | Pkcs12keyStore
                    | JavakeyStore ) "selfSigned"
      startTlsEnabled ( true | false) "false">
<!-- ========== SUFFIX NODE ========================= -->