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

gary_williams
18.30.2007 aea86376c715c71696d1472dbd3f23173c42116c
Issue 1796 use setup -n on windows to avoid service issues
3 files modified
232 ■■■■■ changed files
opends/tests/functional-tests/shared/functions/baselib.xml 2 ●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/functions/dsadm.xml 196 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/functions/topology.xml 34 ●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/functions/baselib.xml
@@ -96,7 +96,7 @@
          DSInfo.ServerDict['system name']= \
            DSInfo.getServerValueFromKey('System Name',DSInfo.SystemDict)
          
          DSInfoServersDict[dsPath]=DSInfo.ServerDict
          DSInfoServersDict[mypath]=DSInfo.ServerDict
        </script>
      
      </else>
opends/tests/functional-tests/shared/functions/dsadm.xml
@@ -27,7 +27,7 @@
 ! -->
<stax>
  
  <!-- This function configures DS using the configure-ds script -->
  <!-- This function sets up DS using the setup script -->
  <function name="SetUpDsWithScript">
    <function-prolog>
      This function sets up a Directory Server using a script
@@ -81,6 +81,12 @@
        </function-arg-description>
        <function-arg-property name="type" value="filename"/>
      </function-arg-def>
      <function-arg-def name="dsNoWindowsService" type="optional">
        <function-arg-description>
          Do not enable as a Windows Service
        </function-arg-description>
        <function-arg-property name="type" value="boolean"/>
      </function-arg-def>
      <function-arg-def name="dsHelp" type="optional">
        <function-arg-description>
          Help option
@@ -118,6 +124,9 @@
        
        if dsBindPwdFile:
          STAFCmdParamsList.append('-j "%s"' % dsBindPwdFile)
        if dsNoWindowsService:
          STAFCmdParamsList.append('-n')
        
        if dsHelp:
          STAFCmdParamsList.append('-H')
@@ -148,6 +157,189 @@
    </sequence>
  </function>
  <!-- This function configures DS using the configure-ds script -->
  <function name="ConfigureDsWithScript">
    <function-prolog>
      This function configures a Directory Server using a script
    </function-prolog>
    <function-map-args>
      <function-arg-def name="location" type="optional" default="'%s' % STAXServiceMachine">
        <function-arg-description>
          Location of target host
        </function-arg-description>
        <function-arg-property name="type" value="hostname"/>
      </function-arg-def>
      <function-arg-def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
        <function-arg-description>
          Pathname to installation root
        </function-arg-description>
        <function-arg-property name="type" value="filepath"/>
      </function-arg-def>
      <function-arg-def name="dsVersion" type="optional">
        <function-arg-description>
          Display Directory Server version information
        </function-arg-description>
        <function-arg-property name="type" value="Port number"/>
      </function-arg-def>
      <function-arg-def name="dsLdapPort" type="optional">
        <function-arg-description>
          Directory server LDAP port number
        </function-arg-description>
        <function-arg-property name="type" value="Port number"/>
      </function-arg-def>
      <function-arg-def name="dsLdapsPort" type="optional">
        <function-arg-description>
          Directory server LDAPS port number
        </function-arg-description>
        <function-arg-property name="type" value="Port number"/>
      </function-arg-def>
      <function-arg-def name="dsEnableStartTLS" type="optional">
        <function-arg-description>
          Specifies whether to enable or not StartTLS
        </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
        </function-arg-description>
        <function-arg-property name="type" value="Port number"/>
      </function-arg-def>
      <function-arg-def name="dsKeyManagerProviderDN" type="optional">
        <function-arg-description>
          DN of the key manager provider to use for SSL and/or StartTLS
        </function-arg-description>
        <function-arg-property name="type" value="Port number"/>
      </function-arg-def>
      <function-arg-def name="dsTrustManagerProviderDN" type="optional">
        <function-arg-description>
          DN of the trust manager provider to use for SSL and/or StartTLS
        </function-arg-description>
        <function-arg-property name="type" value="Port number"/>
      </function-arg-def>
      <function-arg-def name="dsKeyManagerPath" type="optional">
        <function-arg-description>
          Path of the keystore to be used by the key manager provider
        </function-arg-description>
        <function-arg-property name="type" value="Port number"/>
      </function-arg-def>
      <function-arg-def name="dsCertNickName" type="optional">
        <function-arg-description>
          Nickname of the certificate
        </function-arg-description>
        <function-arg-property name="type" value="Port number"/>
      </function-arg-def>
      <function-arg-def name="dsBaseDN" type="optional">
        <function-arg-description>
          Base DN (only single base DN supported).
        </function-arg-description>
        <function-arg-property name="type" value="DN"/>
      </function-arg-def>
      <function-arg-def name="dsRootUserDN" type="optional">
        <function-arg-description>
          Root User Bind DN
        </function-arg-description>
        <function-arg-property name="type" value="DN"/>
      </function-arg-def>
      <function-arg-def name="dsRootPassword" type="optional">
        <function-arg-description>
          Root User Bind password
        </function-arg-description>
        <function-arg-property name="type" value="string"/>
      </function-arg-def>
      <function-arg-def name="dsRootPasswordFile" type="optional">
        <function-arg-description>
          Root User password file
        </function-arg-description>
        <function-arg-property name="type" value="filename"/>
      </function-arg-def>
      <function-arg-def name="dsHelp" type="optional">
        <function-arg-description>
          Help option
        </function-arg-description>
        <function-arg-property name="help" value="option"/>
      </function-arg-def>
    </function-map-args>
    <sequence>
      <!-- Build the Command -->
      <script>
        STAFCmdParamsList=[]
        STAFCmdParams=''
        if dsPath:
          dsBinPath='%s/%s' % (dsPath,fileFolder)
          STAFCmd='%s/configure-ds%s' % (dsBinPath,fileExt)
        if dsVersion:
          STAFCmdParamsList.append('-V %s' % dsVersion)
        if dsLdapPort:
          STAFCmdParamsList.append('-p %s' % dsLdapPort)
        if dsLdapsPort:
          STAFCmdParamsList.append('-P %s' % dsLdapsPort)
        if dsEnableStartTLS:
          STAFCmdParamsList.append('-q %s' % dsEnableStartTLS)
        if dsJmxPort:
          STAFCmdParamsList.append('-x %s' % dsJmxPort)
        if dsKeyManagerProviderDN:
          STAFCmdParamsList.append('-k "%s"' % dsKeyManagerProviderDN)
        if dsTrustManagerProviderDN:
          STAFCmdParamsList.append('-t "%s"' % dsTrustManagerProviderDN)
        if dsKeyManagerPath:
          STAFCmdParamsList.append('-m "%s"' % dsKeyManagerPath)
        if dsCertNickName:
          STAFCmdParamsList.append('-a "%s"' % dsCertNickName)
        if dsBaseDN:
          STAFCmdParamsList.append('-b "%s"' % dsBaseDN)
        if dsRootUserDN:
          STAFCmdParamsList.append('-D "%s"' % dsRootUserDN)
        if dsRootPassword:
          STAFCmdParamsList.append('-w "%s"' % dsRootPassword)
        if dsRootPasswordFile:
          STAFCmdParamsList.append('-j "%s"' % dsRootPasswordFile)
        if dsHelp:
          STAFCmdParamsList.append('-H')
        STAFCmdParams=' '.join(STAFCmdParamsList)
      </script>
      <message>
        '%s %s' % (STAFCmd, STAFCmdParams)
      </message>
      <process name="'Setup DS Script'">
        <location>'%s' % location</location>
        <command>'%s' % STAFCmd</command>
        <parms>'%s' % STAFCmdParams</parms>
        <workdir>'%s' % dsBinPath</workdir>
        <envs>
          ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
        </envs>
        <console use="'same'"/>
        <stderr mode="'stdout'"/>
        <returnstdout/>
      </process>
      <call function="'checkRC'">
        { 'returncode' : RC ,
          'result'     : STAXResult }
      </call>
    </sequence>
  </function>
  <!-- This function starts DS using the start-ds script -->
  <function name="StartDsWithScript">
    <function-prolog>
@@ -2301,7 +2493,7 @@
      
      <if expr="STAXCode != 0">
        <sequence>
          <message>
          <message level="'error'">
            'Copy of totalupdate task failed (STAXCode=%s)' % STAXCode
          </message>
          <return>[STAXCode, STAXReason]</return>
opends/tests/functional-tests/shared/functions/topology.xml
@@ -400,20 +400,38 @@
          'unzipdir' : dsDir }
      </call>
      <!-- fixMe: Windows Services are not enabled -->
      <if expr="isWindows">
        <script>
          noWindowsService='true'
        </script>
      <else>
        <script>
          noWindowsService=''
        </script>
      </else>
      </if>
      <!--- Set up DS -->
      <message>
        'Set up DS on %s : %s/%s' % (dsHost,dsDir,OPENDSNAME)
      </message>
      <call function="'SetUpDsWithScript'">
        { 'location' : dsHost,
          'dsPath' : '%s/%s' % (dsDir, OPENDSNAME),
          'dsPort'   : dsPort,
          'dsJmxPort' : dsJmxPort,
          'dsBindDN' : dsBindDN,
          'dsBindPwd' : dsBindPwd,
          'dsBaseDN' : dsBaseDN }
        { 'location'  : dsHost,
          'dsPath'    : '%s/%s' % (dsDir, OPENDSNAME),
          'dsPort'    : dsPort,
          'dsJmxPort' : dsJmxPort,
          'dsBindDN'  : dsBindDN,
          'dsBindPwd' : dsBindPwd,
          'dsBaseDN'  : dsBaseDN,
          'dsNoWindowsService' : noWindowsService }
      </call>
      <call function="'checkRC'">
        { 'returncode' : RC ,
          'result'     : STAXResult }