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

ugaston
17.04.2007 c1dc1a5f70f7616013e61477be9b38e363e93097
opends/tests/functional-tests/shared/functions/topology.xml
@@ -916,7 +916,161 @@
  </function>
  <!-- Initialize replicated suffix with the contents of a source server using dsreplication -->
  <function name="initializeReplication">
    <function-prolog>
      This function initializes replicated suffixes with the contents
      of a source server using dsreplication.
    </function-prolog>
    <function-map-args>
      <function-arg-def name="location"
                        type="optional"
                        default="STAF_REMOTE_HOSTNAME">
        <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="dsInstanceHost"
                        type="optional"
                        default="STAF_REMOTE_HOSTNAME">
        <function-arg-description>
          Directory server hostname or IP address
        </function-arg-description>
        <function-arg-property name="type" value="hostname" />
      </function-arg-def>
      <function-arg-def name="dsInstancePort" type="required">
        <function-arg-description>
          Directory server port number
        </function-arg-description>
        <function-arg-property name="type" value="Port number" />
      </function-arg-def>
      <function-arg-def name="sourceInstanceHost"
                        type="optional"
                        default="STAF_REMOTE_HOSTNAME">
        <function-arg-description>
          Source Directory server hostname or IP address
        </function-arg-description>
        <function-arg-property name="type" value="hostname" />
      </function-arg-def>
      <function-arg-def name="sourceInstancePort" type="required">
        <function-arg-description>
          Source Directory server port number
        </function-arg-description>
        <function-arg-property name="type" value="Port number" />
      </function-arg-def>
      <function-arg-def name="replicationDnList" type="required">
        <function-arg-description>
          DN of the replicated suffix
        </function-arg-description>
        <function-arg-property name="type" value="DN list" />
      </function-arg-def>
      <function-arg-def name="adminUID"
                                   type="optional"
                                   default="AdminUID">
        <function-arg-description>
          Global Administrator UID
        </function-arg-description>
        <function-arg-property name="type" value="UID" />
      </function-arg-def>
      <function-arg-def name="adminPswd"
                                   type="optional"
                                   default="AdminPswd">
        <function-arg-description>
          Global Administrator password
        </function-arg-description>
        <function-arg-property name="type" value="string" />
      </function-arg-def>
      <function-arg-def name="expectedRC" type="optional" default="0">
        <function-arg-description>
        Expected return code value. Default value is 0
        </function-arg-description>
        <function-arg-property name="type" value="string" />
      </function-arg-def>
    </function-map-args>
    <sequence>
      <!-- Local variables -->
      <script>
        mylocation=location
        STAFCmdParams=''
        STAFCmd=''
        if dsPath:
          dsBinPath='%s/%s' % (dsPath,fileFolder)
          STAFCmd='%s/%s%s' % (dsBinPath,DSREPLICATION,fileExt)
        STAFCmdParamsList=[]
        STAFCmdParamsList.append('initialize')
        STAFCmdParamsList.append('-n')
        STAFCmdParamsList.append('-Q')
        if dsInstanceHost:
          STAFCmdParamsList.append('-O %s' % dsInstanceHost)
        if dsInstancePort:
          STAFCmdParamsList.append('--portDestination %s' % dsInstancePort)
        if sourceInstanceHost:
          STAFCmdParamsList.append('-h %s' % sourceInstanceHost)
        if sourceInstancePort:
          STAFCmdParamsList.append('-p %s' % sourceInstancePort)
        if replicationDnList:
          for dn in replicationDnList:
            STAFCmdParamsList.append('-b "%s"' % dn)
        if adminUID:
          STAFCmdParamsList.append('-I "%s"' % adminUID)
        if adminPswd:
          STAFCmdParamsList.append('-w "%s"' % adminPswd)
        STAFCmdParams=' '.join(STAFCmdParamsList)
      </script>
      <call function="'runCommand'">
        { 'name'      : 'Initialize Replication',
          'location'  : location,
          'command'   : STAFCmd,
          'arguments' : STAFCmdParams
        }
      </call>
      <script>
        STAXCode=RC
        STAXReason=STAXResult
      </script>
      <call function="'checktestRC'">
        { 'returncode' : STAXCode,
          'result'     : STAXReason,
          'expected'   : expectedRC
        }
      </call>
      <return>
        STAXReason
      </return>
    </sequence>
  </function>
  
  <function name="readTopology">
    <function-prolog>