2788N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2788N/A<!DOCTYPE stax SYSTEM "/stax.dtd">
2788N/A<!--
2788N/A ! CDDL HEADER START
2788N/A !
2788N/A ! The contents of this file are subject to the terms of the
2788N/A ! Common Development and Distribution License, Version 1.0 only
2788N/A ! (the "License"). You may not use this file except in compliance
2788N/A ! with the License.
2788N/A !
2788N/A ! You can obtain a copy of the license at
2788N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
2788N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
2788N/A ! See the License for the specific language governing permissions
2788N/A ! and limitations under the License.
2788N/A !
2788N/A ! When distributing Covered Code, include this CDDL HEADER in each
2788N/A ! file and include the License file at
2788N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
2788N/A ! add the following below this CDDL HEADER, with the fields enclosed
2788N/A ! by brackets "[]" replaced with your own identifying information:
2788N/A ! Portions Copyright [yyyy] [name of copyright owner]
2788N/A !
2788N/A ! CDDL HEADER END
2788N/A !
5061N/A ! Copyright 2007-2010 Sun Microsystems, Inc.
6066N/A ! Portions Copyright 2013 ForgeRock AS
2788N/A ! -->
2788N/A<stax>
2788N/A <!-- This function uses make ldif to generate LDIF data files -->
3327N/A <function name="MakeLdifWithScript">
2788N/A <function-prolog>
2788N/A This function uses make ldif to generate LDIF data files
2788N/A </function-prolog>
2788N/A
2788N/A <function-map-args>
2788N/A <function-arg-def name="location"
2788N/A type="optional"
2788N/A default="STAF_REMOTE_HOSTNAME">
2788N/A <function-arg-description>
2788N/A Location of target host
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="hostname"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="dsPath"
2788N/A type="optional"
4153N/A default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
2788N/A <function-arg-description>
2788N/A Pathname to installation root
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="filepath"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="version" type="optional">
2788N/A <function-arg-description>
2788N/A Display Directory Server version information
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="string"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="templateFile" type="optional">
2788N/A <function-arg-description>
2788N/A Path to the template file
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="filename"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="ldifFile" type="optional">
2788N/A <function-arg-description>
2788N/A Path to the LDIF file
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="filename"/>
2788N/A </function-arg-def>
2788N/A
3332N/A <function-arg-def name="randomSeed" type="optional">
2788N/A <function-arg-description>
2788N/A The seed to use to initialize the random number generator
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="integer"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="Help" type="optional">
2788N/A <function-arg-description>
2788N/A Help option
2788N/A </function-arg-description>
2788N/A <function-arg-property name="help" value="option"/>
2788N/A </function-arg-def>
3194N/A
3194N/A <function-arg-def name="expectedRC" type="optional" default="0">
3194N/A <function-arg-description>
3194N/A Expected return code value. Default value is 0.
3194N/A Wildcard 'noCheck' to not check the RC
3194N/A </function-arg-description>
3194N/A </function-arg-def>
3951N/A
3951N/A <function-arg-def name="knownIssue" type="optional" default="None">
3951N/A <function-arg-description>
3951N/A Known issue. Corresponds to an issue number.
3951N/A </function-arg-description>
3951N/A </function-arg-def>
3951N/A
2788N/A </function-map-args>
2788N/A <sequence>
2788N/A <!-- Build the Command -->
2788N/A <script>
5976N/A foldersToCreate = []
2788N/A STAFCmdParamsList=[]
2788N/A STAFCmdParams=''
2788N/A
2788N/A if dsPath:
2788N/A dsBinPath='%s/%s' % (dsPath,fileFolder)
2788N/A STAFCmd='%s/make-ldif%s' % (dsBinPath,fileExt)
2788N/A
2788N/A if version:
2788N/A STAFCmdParamsList.append('-V')
2788N/A
2788N/A if templateFile:
2788N/A STAFCmdParamsList.append('-t %s' % templateFile)
2788N/A
2788N/A if ldifFile:
5976N/A foldersToCreate.append(os.path.dirname(ldifFile))
2788N/A STAFCmdParamsList.append('-o %s' % ldifFile)
2788N/A
2788N/A if randomSeed:
2788N/A STAFCmdParamsList.append('-s "%s"' % randomSeed)
2788N/A
2788N/A if Help:
2788N/A STAFCmdParamsList.append('-H')
2788N/A
2788N/A STAFCmdParams=' '.join(STAFCmdParamsList)
2788N/A </script>
5976N/A
5976N/A <call function="'createMultiFolders'">
5976N/A { 'location' : location,
5976N/A 'folderslist' : foldersToCreate
5976N/A }
5976N/A </call>
5976N/A
5976N/A <message>
5976N/A '%s %s' % (STAFCmd, STAFCmdParams)
5976N/A </message>
5976N/A
2788N/A <call function="'runCommand'">
2788N/A { 'name' : 'Make Ldif Script',
2788N/A 'location' : location,
2788N/A 'command' : STAFCmd,
2788N/A 'arguments' : STAFCmdParams,
3951N/A 'expectedRC': expectedRC,
3951N/A 'knownIssue': knownIssue
2788N/A }
2788N/A </call>
3332N/A <return>STAXResult</return>
2788N/A </sequence>
4865N/A </function>
2788N/A
2788N/A
2788N/A <!-- This function uses make ldif to generate LDIF data files -->
2788N/A <function name="MakeAMakeLdifTemplate">
2788N/A <function-prolog>
2788N/A This function makes a make-ldif template file
2788N/A </function-prolog>
2788N/A
2788N/A <function-map-args>
2788N/A <function-arg-def name="numEntries" type="required">
2788N/A <function-arg-description>
2788N/A Number of entries
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="string"/>
2788N/A </function-arg-def>
4865N/A <function-arg-def name="startFrom"
4495N/A type="optional"
4495N/A default="0">
4495N/A <function-arg-description>
4495N/A Start entries number
4495N/A </function-arg-description>
4495N/A <function-arg-property name="type" value="string"/>
4495N/A </function-arg-def>
4865N/A <function-arg-def name="suffix"
4495N/A type="optional"
4495N/A default="DIRECTORY_INSTANCE_SFX">
4495N/A <function-arg-description>
4495N/A Suffix
4495N/A </function-arg-description>
4495N/A <function-arg-property name="type" value="string"/>
4495N/A </function-arg-def>
2788N/A <function-arg-def name="templateFile" type="required">
2788N/A <function-arg-description>
2788N/A Template file name
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="filename"/>
2788N/A </function-arg-def>
4495N/A <function-arg-def name="templateLocation"
4495N/A type="optional"
4495N/A default="STAXServiceMachine">
4495N/A <function-arg-description>
4495N/A Template file location
4495N/A </function-arg-description>
4495N/A <function-arg-property name="type" value="filename"/>
4495N/A </function-arg-def>
4865N/A <function-arg-def name="additionalAttributes"
4495N/A type="optional"
4495N/A default="False">
4495N/A <function-arg-description>
4495N/A Add (or not) additional attributes
4495N/A </function-arg-description>
4495N/A <function-arg-property name="type" value="integer"/>
4495N/A </function-arg-def>
2788N/A <function-arg-def name="extraLine" type="optional">
2788N/A <function-arg-description>
2788N/A Extra line to add to the mkae-ldif template
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="string"/>
2788N/A </function-arg-def>
2788N/A </function-map-args>
2788N/A <sequence>
2788N/A <!-- Build the import task configuration object -->
2788N/A <script>
2788N/A ldifLines=[]
4495N/A ldifLines.append('define suffix=%s' % suffix)
2788N/A ldifLines.append('define maildomain=example.com')
2788N/A ldifLines.append('define numusers=%s' % numEntries )
2788N/A ldifLines.append('')
2788N/A
2788N/A ldifLines.append('branch: [suffix]')
2788N/A ldifLines.append('')
2788N/A
2788N/A ldifLines.append('branch: ou=People,[suffix]')
2788N/A ldifLines.append('subordinateTemplate: person:[numusers]')
2788N/A ldifLines.append('')
2788N/A
2788N/A ldifLines.append('template: person')
4495N/A ldifLines.append('rdnAttr: uid')
2788N/A ldifLines.append('objectClass: top')
2788N/A ldifLines.append('objectClass: person')
2788N/A ldifLines.append('objectClass: organizationalPerson')
2788N/A ldifLines.append('objectClass: inetOrgPerson')
2788N/A ldifLines.append('givenName: &lt;first&gt;')
2788N/A ldifLines.append('sn: &lt;last&gt;')
4495N/A ldifLines.append('employeeNumber: &lt;sequential:%s&gt;' % startFrom)
2788N/A ldifLines.append('cn: {givenName} {sn} {employeeNumber}')
2788N/A ldifLines.append('uid: user.{employeeNumber}')
2788N/A ldifLines.append('mail: {uid}@[maildomain]')
2788N/A ldifLines.append('telephoneNumber: &lt;random:telephone&gt;')
2788N/A ldifLines.append('description: This is the description for user.{employeeNumber}.')
4495N/A
4495N/A if additionalAttributes == True:
4495N/A ldifLines.append('initials: {givenName:1}&lt;random:chars:ABCDEFGHIJKLMNOPQRSTUVWXYZ:1>{sn:1}')
4495N/A ldifLines.append('homePhone: &lt;random:telephone>')
4495N/A ldifLines.append('mobile: &lt;random:telephone>')
4495N/A ldifLines.append('street: &lt;random:numeric:5> &lt;file:streets> Street')
4495N/A ldifLines.append('l: &lt;file:cities>')
4495N/A ldifLines.append('st: &lt;file:states>')
4495N/A ldifLines.append('postalCode: &lt;random:numeric:5>')
4495N/A ldifLines.append('postalAddress: {cn}${street}${l}, {st} {postalCode}')
4495N/A ldifLines.append('jpegPhoto:: &lt;random:base64:10000&gt;')
4495N/A
2788N/A if extraLine:
2788N/A ldifLines.append('%s' % extraLine)
2788N/A </script>
2788N/A
2788N/A <!-- Write out the make-ldif template file -->
2788N/A <script>
4495N/A RC=0
4495N/A </script>
4495N/A <script>
4495N/A tmpTemplateFile = '%s/tempLdifTemplateFile' % local.temp
4495N/A outfile = open(tmpTemplateFile,"w")
2788N/A
2788N/A for line in ldifLines:
2788N/A outfile.write("%s\n" % line)
2788N/A
2788N/A outfile.close()
2788N/A </script>
2788N/A <script>
2788N/A STAXCode=RC
2788N/A STAXReason=STAXResult
2788N/A </script>
2788N/A <if expr="STAXCode != 0">
2788N/A <sequence>
2788N/A <message level="'error'">
2788N/A 'creation of a make-ldif template failed (Code=%s,Reason=%s).' % (STAXCode,STAXReason)
2788N/A </message>
2788N/A </sequence>
2788N/A </if>
2788N/A <call function="'checktestRC'">
2788N/A { 'returncode' : STAXCode ,
2788N/A 'result' : STAXReason }
2788N/A </call>
4495N/A
4495N/A <call function="'copyFile'">
4495N/A { 'location' : STAXServiceMachine,
4495N/A 'srcfile' : tmpTemplateFile,
4495N/A 'destfile' : templateFile,
4495N/A 'remotehost' : templateLocation }
4495N/A </call>
4495N/A
4495N/A <call function="'checktestRC'">
4495N/A {
4495N/A 'returncode' : RC ,
4495N/A 'result' : STAXResult
4495N/A }
4495N/A </call>
4495N/A
4495N/A <return>[RC, STAXResult]</return>
2788N/A
2788N/A </sequence>
4865N/A </function>
2788N/A
2788N/A <!-- This function compares two LDIF files using the ldif-diff script -->
2788N/A <function name="LdifDiffWithScript">
2788N/A <function-prolog>
2788N/A This function compares two LDIF files and reports the differences in LDIF format
2788N/A </function-prolog>
2788N/A <function-map-args>
2788N/A <function-arg-def name="location"
2788N/A type="optional"
2788N/A default="STAF_REMOTE_HOSTNAME">
2788N/A <function-arg-description>
2788N/A Location of target host
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="hostname"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="dsPath"
2788N/A type="optional"
4153N/A default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
2788N/A <function-arg-description>
2788N/A Pathname to installation root
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="filepath"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="version" type="optional">
2788N/A <function-arg-description>
2788N/A Display Directory Server version information
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="string"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="sourceLdif" type="required">
2788N/A <function-arg-description>
2788N/A LDIF file to use as the source data
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="filepath"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="targetLdif" type="required">
2788N/A <function-arg-description>
2788N/A LDIF file to use as the target data
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="filepath"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="outputLdif" type="required">
2788N/A <function-arg-description>
2788N/A File to which the diffs should be written
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="filepath"/>
2788N/A </function-arg-def>
2788N/A
5047N/A <function-arg-def name="ignoreAttrsFile"
5047N/A type="optional"
5047N/A default="None">
5047N/A <function-arg-description>
5047N/A File containing a list of attributes to ignore when computing the
5047N/A difference
5047N/A </function-arg-description>
5047N/A <function-arg-property name="type" value="filepath"/>
5047N/A </function-arg-def>
5047N/A
2788N/A <function-arg-def name="overwriteExisting" type="optional" default="True">
2788N/A <function-arg-description>
2788N/A Overwrite existing output file rather than append to it
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="option"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="singleValueChanges" type="optional">
2788N/A <function-arg-description>
2788N/A Write each attribute-level change as a separate modification
2788N/A per attribute value rather than one modification per entry
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="option"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="Help" type="optional">
2788N/A <function-arg-description>
2788N/A Help option
2788N/A </function-arg-description>
2788N/A <function-arg-property name="help" value="option"/>
4865N/A </function-arg-def>
3951N/A
2788N/A </function-map-args>
2788N/A <sequence>
2788N/A <!-- Build the Command -->
2788N/A <script>
5976N/A foldersToCreate = []
2788N/A STAFCmdParamsList=[]
2788N/A STAFCmdParams=''
2788N/A
2788N/A if dsPath:
2788N/A dsBinPath='%s/%s' % (dsPath,fileFolder)
2788N/A STAFCmd='%s/ldif-diff%s' % (dsBinPath,fileExt)
2788N/A
2788N/A if version:
2788N/A STAFCmdParamsList.append('-V')
2788N/A
2788N/A if sourceLdif:
2788N/A STAFCmdParamsList.append('-s %s' % sourceLdif)
2788N/A
2788N/A if targetLdif:
2788N/A STAFCmdParamsList.append('-t %s' % targetLdif)
2788N/A
2788N/A if outputLdif:
5976N/A foldersToCreate.append(os.path.dirname(outputLdif))
2788N/A STAFCmdParamsList.append('-o %s' % outputLdif)
2788N/A
5047N/A if ignoreAttrsFile:
5047N/A STAFCmdParamsList.append('-a %s' % ignoreAttrsFile)
5047N/A
2788N/A if overwriteExisting:
2788N/A STAFCmdParamsList.append('-O')
2788N/A
2788N/A if singleValueChanges:
2788N/A STAFCmdParamsList.append('-S')
2788N/A
2788N/A if Help:
2788N/A STAFCmdParamsList.append('-H')
2788N/A
2788N/A STAFCmdParams=' '.join(STAFCmdParamsList)
2788N/A </script>
3315N/A
5976N/A <call function="'createMultiFolders'">
5976N/A { 'location' : location,
5976N/A 'folderslist' : foldersToCreate
5976N/A }
5976N/A </call>
5976N/A
3315N/A <message>
5976N/A '%s %s' % (STAFCmd, STAFCmdParams)
3315N/A </message>
3951N/A
2788N/A <process name="'LDIF Diff Script'">
2788N/A <location>location</location>
2788N/A <command>STAFCmd</command>
2788N/A <parms>STAFCmdParams</parms>
2788N/A <workdir>dsBinPath</workdir>
2788N/A <envs>
2788N/A ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
2788N/A </envs>
2788N/A <console use="'same'"/>
2788N/A <stderr mode="'stdout'"/>
4616N/A <returnstdout/>
2788N/A </process>
3951N/A
2788N/A <script>
2788N/A STAXCode=RC
2788N/A </script>
4616N/A <if expr="STAXCode == 0">
4616N/A <sequence>
4616N/A <!-- Check the size of the diff file, and avoid reading its
4616N/A content with getFile if the file is too big to prevent
4616N/A the staf process from running out of memory -->
4616N/A <call function="'GetEntry'">
4616N/A {
4616N/A 'location' : location,
4616N/A 'entry' : outputLdif,
4616N/A 'attribute' : 'SIZE'
4616N/A }
4616N/A </call>
4616N/A <script>
4616N/A # GetEntry returns: STAXResult = [cmdRC, cmdResult]
4616N/A if RC == 0:
4616N/A diffsFileSize = int(STAXResult[1]['lowerSize'])
4616N/A msg = 'File: %s Size (bytes): %s' % (outputLdif, diffsFileSize)
4616N/A else:
4616N/A diffsFileSize = MAX_READABLE_SIZE
4616N/A msg = 'Could not retrieve the size of file %s' % outputLdif
4616N/A </script>
4616N/A <message log="1"> 'LdifDiffWithScript: %s' % msg </message>
4616N/A <if expr="diffsFileSize &lt; MAX_READABLE_SIZE">
4865N/A <sequence>
4616N/A <call function="'getFile'">
4616N/A { 'location' : location,
4616N/A 'filename' : outputLdif
4616N/A }
4616N/A </call>
4616N/A <script>
4616N/A # getFile returns: STAXResult = [cmdRC, cmdResult]
4616N/A diffsFileContent = STAXResult[1]
4616N/A
4616N/A if diffsFileContent.startswith("# No differences were detected between the source and target LDIF files") :
4616N/A diffRC = 0
4616N/A else:
4616N/A diffRC = 1
4616N/A </script>
4616N/A </sequence>
4616N/A <else>
4616N/A <script>
4616N/A # diffs file to big to be read
4616N/A diffsFileContent = 'File too big to be read.'
4616N/A
4616N/A # if the diff file is too big, it means that there ARE
4616N/A # actually some diffs, so we may deduce diffRC = 1
4616N/A diffRC = 1
4616N/A </script>
4616N/A </else>
4616N/A </if>
4616N/A </sequence>
4631N/A <else>
4631N/A <sequence>
4631N/A <message log="1" level="'Error'">
4631N/A 'LdifDiffWithScript: command run FAILED.'
4631N/A </message>
4631N/A <return> -1 </return>
4631N/A </sequence>
4631N/A </else>
4616N/A </if>
4616N/A
4616N/A <if expr="diffRC == 0">
4616N/A <message log="1">
4616N/A 'NO DIFFERENCES were detected between the source and the target \
4616N/A LDIF files.'
4616N/A </message>
4616N/A <else>
4616N/A <message log="1" level="'Error'">
4616N/A 'Source and target LDIF files are DIFFERENT: \n\n%s' % \
4616N/A diffsFileContent
4616N/A </message>
4616N/A </else>
4616N/A </if>
4616N/A
2788N/A <return> diffRC </return>
2788N/A </sequence>
2788N/A </function>
6350N/A
2788N/A <!-- This function modifies an LDIF file using ldifmodify script -->
2788N/A <function name="LdifModifyWithScript">
2788N/A <function-prolog>
2788N/A This function modifies an LDIF file with the changes contained in another LDIF file
2788N/A </function-prolog>
2788N/A <function-map-args>
2788N/A <function-arg-def name="location"
2788N/A type="optional"
2788N/A default="STAF_REMOTE_HOSTNAME">
2788N/A <function-arg-description>
2788N/A Location of target host
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="hostname"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="dsPath"
2788N/A type="optional"
4153N/A default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
2788N/A <function-arg-description>
2788N/A Pathname to installation root
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="filepath"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="version" type="optional">
2788N/A <function-arg-description>
2788N/A Display Directory Server version information
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="string"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="sourceLdif" type="required">
2788N/A <function-arg-description>
2788N/A LDIF file containing the data to be updated
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="filepath"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="targetLdif" type="required">
2788N/A <function-arg-description>
2788N/A LDIF file that will contain the updated data
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="filepath"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="changesLdif" type="required">
2788N/A <function-arg-description>
2788N/A LDIF file containing the changes to apply
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="filepath"/>
4865N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="Help" type="optional">
2788N/A <function-arg-description>
2788N/A Help option
2788N/A </function-arg-description>
2788N/A <function-arg-property name="help" value="option"/>
2788N/A </function-arg-def>
3194N/A
3194N/A <function-arg-def name="expectedRC" type="optional" default="0">
3194N/A <function-arg-description>
3194N/A Expected return code value. Default value is 0.
3194N/A Wildcard 'noCheck' to not check the RC
3194N/A </function-arg-description>
3194N/A </function-arg-def>
3951N/A
3951N/A <function-arg-def name="knownIssue" type="optional" default="None">
3951N/A <function-arg-description>
3951N/A Known issue. Corresponds to an issue number.
3951N/A </function-arg-description>
3951N/A </function-arg-def>
3951N/A
2788N/A </function-map-args>
2788N/A <sequence>
2788N/A <!-- Build the Command -->
2788N/A <script>
5976N/A foldersToCreate = []
2788N/A STAFCmdParamsList=[]
2788N/A STAFCmdParams=''
2788N/A
2788N/A if dsPath:
2788N/A dsBinPath='%s/%s' % (dsPath,fileFolder)
2788N/A STAFCmd='%s/ldifmodify%s' % (dsBinPath,fileExt)
2788N/A
2788N/A if version:
2788N/A STAFCmdParamsList.append('-V')
2788N/A
2788N/A if sourceLdif:
2788N/A STAFCmdParamsList.append('-s %s' % sourceLdif)
2788N/A
2788N/A if targetLdif:
5976N/A foldersToCreate.append(os.path.dirname(targetLdif))
2788N/A STAFCmdParamsList.append('-t %s' % targetLdif)
2788N/A
2788N/A if changesLdif:
2788N/A STAFCmdParamsList.append('-m %s' % changesLdif)
2788N/A
2788N/A if Help:
2788N/A STAFCmdParamsList.append('-H')
2788N/A
2788N/A STAFCmdParams=' '.join(STAFCmdParamsList)
2788N/A </script>
5976N/A
5976N/A <call function="'createMultiFolders'">
5976N/A { 'location' : location,
5976N/A 'folderslist' : foldersToCreate
5976N/A }
5976N/A </call>
5976N/A
5976N/A <message>
5976N/A '%s %s' % (STAFCmd, STAFCmdParams)
5976N/A </message>
5976N/A
2788N/A <call function="'runCommand'">
2788N/A { 'name' : 'LDIF Modify Script',
2788N/A 'location' : location,
2788N/A 'command' : STAFCmd,
2788N/A 'arguments' : STAFCmdParams,
3951N/A 'expectedRC': expectedRC,
3951N/A 'knownIssue': knownIssue
2788N/A }
2788N/A </call>
2788N/A <return>STAXResult</return>
2788N/A </sequence>
2788N/A </function>
2788N/A
2788N/A
2788N/A <function name="verifyTrees">
2788N/A <function-prolog>
3812N/A This function verifies that the trees in a group of ldap servers are
3812N/A synchronized.
2788N/A </function-prolog>
2788N/A <function-list-args>
2788N/A <function-arg-def name="location"
2788N/A type="optional"
2788N/A default="STAF_REMOTE_HOSTNAME">
2788N/A <function-arg-description>
2788N/A Location of target host
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="hostname"/>
2788N/A </function-arg-def>
2788N/A <function-arg-def name="dsPath"
2788N/A type="optional"
4153N/A default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
2788N/A <function-arg-description>
2788N/A Pathname to installation root
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="filepath"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="referenceServer" type="required">
2788N/A <function-arg-description>
2788N/A Server that should be taken as reference.
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="Server"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="serverList" type="required">
2788N/A <function-arg-description>
2788N/A List of the servers to verify against the referenceServer.
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="Server-list"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="treeSuffix" type="required">
2788N/A <function-arg-description>
2788N/A Suffix of the tree to verify.
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="DN"/>
2788N/A </function-arg-def>
3951N/A
4267N/A <function-arg-def name="knownIssue" type="optional" default="None">
4267N/A <function-arg-description>
4267N/A Known issue. Corresponds to an issue number.
4267N/A </function-arg-description>
4267N/A </function-arg-def>
4267N/A
5047N/A <function-arg-def name="ignoreAttrsFile"
5047N/A type="optional"
5047N/A default="None">
5047N/A <function-arg-description>
5047N/A File containing a list of attributes to ignore when computing the
5047N/A difference
5047N/A </function-arg-description>
5047N/A <function-arg-property name="type" value="filepath"/>
5047N/A </function-arg-def>
2788N/A </function-list-args>
4865N/A <sequence>
2788N/A <script>
2788N/A myRC = 0
4319N/A myKnownIssue = knownIssue
2788N/A failedServers = []
2788N/A failingServerList = ''
3812N/A referenceServerPath = '%s/%s' % (referenceServer.getDir(), OPENDSNAME)
2788N/A referenceTree = 'referenceTree.ldif'
2788N/A sampleTree = 'sampleTree.ldif'
2788N/A treeDiffs = 'treeDiffs.ldif'
2788N/A </script>
4648N/A
4648N/A <!-- Verify the synchronization of the trees among the servers in
4648N/A the topology -->
4648N/A <call function="'getReplicationStatus'">
4648N/A { 'location' : location,
4648N/A 'dsPath' : dsPath,
4648N/A 'dsInstanceHost' : referenceServer.getHostname(),
4648N/A 'dsInstanceAdminPort' : referenceServer.getAdminPort(),
4865N/A 'replicationDnList' : [treeSuffix],
4648N/A 'noOfLoops' : 10,
4648N/A 'noOfMilliSeconds' : 6000
4648N/A }
4648N/A </call>
4648N/A
4648N/A <message>
3812N/A 'Verify tree %s taking %s as reference.' \
3812N/A % (treeSuffix, referenceServerPath)
2788N/A </message>
4616N/A <!-- Retrieve the tree from the reference server -->
4865N/A <call function="'exportLdifWithScript'">
4616N/A { 'location' : location,
4616N/A 'dsPath' : dsPath,
4616N/A 'dsInstanceHost' : referenceServer.getHostname(),
4616N/A 'dsInstanceAdminPort' : referenceServer.getAdminPort(),
4616N/A 'dsInstanceDn' : referenceServer.getRootDn(),
4616N/A 'dsInstancePswd' : referenceServer.getRootPwd(),
4865N/A 'ldifFile' : '%s/../%s' % (dsPath, referenceTree),
4865N/A 'includeBranches' : [treeSuffix]
2788N/A }
2788N/A </call>
4616N/A
2788N/A <if expr="RC != 0">
2788N/A <!-- If the reference tree could not be retrieved, return an error -->
2788N/A <return> [1, None] </return>
2788N/A </if>
2788N/A <iterate var="server" in="serverList">
2788N/A <sequence>
2788N/A <!-- Retrieve the same tree for every other server in the list -->
4616N/A <if expr="server.getHostname() == location">
4616N/A <script>
4616N/A filePath = dsPath
4616N/A isSameLocation = True
4616N/A </script>
4616N/A <else>
4616N/A <script>
4616N/A filePath = '%s/%s' % (server.getDir(), OPENDSNAME)
4616N/A isSameLocation = False
4616N/A </script>
4616N/A </else>
4616N/A </if>
4865N/A <call function="'exportLdifWithScript'">
4616N/A { 'location' : location,
4616N/A 'dsPath' : dsPath,
4616N/A 'dsInstanceHost' : server.getHostname(),
4616N/A 'dsInstanceAdminPort' : server.getAdminPort(),
4616N/A 'dsInstanceDn' : server.getRootDn(),
4616N/A 'dsInstancePswd' : server.getRootPwd(),
4865N/A 'ldifFile' : '%s/../%s' % (filePath, sampleTree),
4865N/A 'includeBranches' : [treeSuffix]
2788N/A }
2788N/A </call>
4616N/A
2788N/A <if expr="RC == 0">
2788N/A <sequence>
4616N/A
4865N/A <if expr="not isSameLocation">
4616N/A <!-- Copy sample tree file to reference server -->
4616N/A <call function="'copyFile'">
4616N/A { 'location' : server.getHostname(),
4616N/A 'remotehost' : location,
4616N/A 'srcfile' : '%s/../%s' % (filePath, sampleTree),
4616N/A 'destfile' : '%s/../%s' % (dsPath, sampleTree)
4616N/A }
4616N/A </call>
4616N/A </if>
4616N/A
2788N/A <!-- Compare this tree to the reference one -->
2788N/A <call function="'LdifDiffWithScript'">
5047N/A { 'location' : location,
5047N/A 'dsPath' : dsPath,
5047N/A 'sourceLdif' : '%s/../%s' % (dsPath, sampleTree),
5047N/A 'targetLdif' : '%s/../%s' % (dsPath, referenceTree),
5047N/A 'outputLdif' : '%s/../%s' % (dsPath, treeDiffs),
5047N/A 'ignoreAttrsFile' : ignoreAttrsFile
2788N/A }
2788N/A </call>
4616N/A <if expr="STAXResult != 0">
4616N/A <sequence>
4865N/A <script>
4616N/A failedServers.append('%s:%s' % \
4616N/A (server.getHostname(), server.getPort()))
4616N/A </script>
4616N/A <message log="1" level="'Error'">
4616N/A 'Tree is DIFFERENT for %s:%s compared to %s:%s' % \
4616N/A (server.getHostname(), server.getPort(),
4616N/A referenceServer.getHostname(), referenceServer.getPort())
4616N/A </message>
4616N/A </sequence>
4616N/A </if>
2788N/A </sequence>
2788N/A <else>
2788N/A <script>
3812N/A failedServers.append('%s:%s' % \
3812N/A (server.getHostname(), server.getPort()))
2788N/A </script>
2788N/A </else>
2788N/A </if>
2788N/A </sequence>
2788N/A </iterate>
2788N/A <if expr="len(failedServers) > 0">
3812N/A <!-- If at least one server failed to successfully compare to the
3812N/A ! reference tree, return an error, along with the list of the
4267N/A ! servers that failed to do so -->
2788N/A <script>
2788N/A myRC = 1
2788N/A comma = ','
3812N/A failingServerList = \
3812N/A 'List of non-synchronized servers (tree verify FAILED): %s ' \
3812N/A % comma.join(failedServers)
2788N/A </script>
2788N/A <else>
2788N/A <message>
2788N/A 'All servers synchronized (tree verify SUCCEEDED).'
2788N/A </message>
2788N/A </else>
2788N/A </if>
2788N/A <call function="'checktestRC'">
2788N/A { 'returncode' : myRC,
2788N/A 'result' : failingServerList,
4267N/A 'expected' : 0,
4319N/A 'issue' : myKnownIssue
2788N/A }
2788N/A </call>
2788N/A <return>[myRC, failedServers]</return>
2788N/A </sequence>
2788N/A </function>
6350N/A
6350N/A <function name="verifyTreesSdk">
6350N/A <function-prolog>
6350N/A This function verifies that the trees in a group of ldap servers are
6350N/A synchronized.
6350N/A </function-prolog>
6350N/A <function-list-args>
6350N/A <function-arg-def name="location"
6350N/A type="optional"
6350N/A default="STAF_REMOTE_HOSTNAME">
6350N/A <function-arg-description>
6350N/A Location of target host
6350N/A </function-arg-description>
6350N/A <function-arg-property name="type" value="hostname"/>
6350N/A </function-arg-def>
6350N/A <function-arg-def name="dsPath"
6350N/A type="optional"
6350N/A default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
6350N/A <function-arg-description>
6350N/A Pathname to installation root
6350N/A </function-arg-description>
6350N/A <function-arg-property name="type" value="filepath"/>
6350N/A </function-arg-def>
6350N/A
6350N/A <function-arg-def name="referenceServer" type="required">
6350N/A <function-arg-description>
6350N/A Server that should be taken as reference.
6350N/A </function-arg-description>
6350N/A <function-arg-property name="type" value="Server"/>
6350N/A </function-arg-def>
6350N/A
6350N/A <function-arg-def name="serverList" type="required">
6350N/A <function-arg-description>
6350N/A List of the servers to verify against the referenceServer.
6350N/A </function-arg-description>
6350N/A <function-arg-property name="type" value="Server-list"/>
6350N/A </function-arg-def>
6350N/A
6350N/A <function-arg-def name="treeSuffix" type="required">
6350N/A <function-arg-description>
6350N/A Suffix of the tree to verify.
6350N/A </function-arg-description>
6350N/A <function-arg-property name="type" value="DN"/>
6350N/A </function-arg-def>
6350N/A
6350N/A <function-arg-def name="knownIssue" type="optional" default="None">
6350N/A <function-arg-description>
6350N/A Known issue. Corresponds to an issue number.
6350N/A </function-arg-description>
6350N/A </function-arg-def>
6350N/A
6350N/A <function-arg-def name="ignoreAttrsFile"
6350N/A type="optional"
6350N/A default="None">
6350N/A <function-arg-description>
6350N/A File containing a list of attributes to ignore when computing the
6350N/A difference
6350N/A </function-arg-description>
6350N/A <function-arg-property name="type" value="filepath"/>
6350N/A </function-arg-def>
6350N/A </function-list-args>
6350N/A <sequence>
6350N/A <script>
6350N/A myRC = 0
6350N/A myKnownIssue = knownIssue
6350N/A failedServers = []
6350N/A failingServerList = ''
6350N/A referenceServerPath = '%s/%s' % (referenceServer.getDir(), OPENDSNAME)
6350N/A referenceTree = 'referenceTree.ldif'
6350N/A sampleTree = 'sampleTree.ldif'
6350N/A treeDiffs = 'treeDiffs.ldif'
6350N/A </script>
6350N/A
6350N/A <!-- Verify the synchronization of the trees among the servers in
6350N/A the topology -->
6350N/A <call function="'getReplicationStatus'">
6350N/A { 'location' : location,
6350N/A 'dsPath' : dsPath,
6350N/A 'dsInstanceHost' : referenceServer.getHostname(),
6350N/A 'dsInstanceAdminPort' : referenceServer.getAdminPort(),
6350N/A 'replicationDnList' : [treeSuffix],
6350N/A 'noOfLoops' : 10,
6350N/A 'noOfMilliSeconds' : 6000
6350N/A }
6350N/A </call>
6350N/A
6350N/A <message>
6350N/A 'Verify tree %s taking %s as reference.' \
6350N/A % (treeSuffix, referenceServerPath)
6350N/A </message>
6350N/A <!-- Retrieve the tree from the reference server -->
6350N/A <call function="'exportLdifWithScript'">
6350N/A { 'location' : location,
6350N/A 'dsPath' : dsPath,
6350N/A 'dsInstanceHost' : referenceServer.getHostname(),
6350N/A 'dsInstanceAdminPort' : referenceServer.getAdminPort(),
6350N/A 'dsInstanceDn' : referenceServer.getRootDn(),
6350N/A 'dsInstancePswd' : referenceServer.getRootPwd(),
6350N/A 'ldifFile' : '%s/../%s' % (dsPath, referenceTree),
6350N/A 'includeBranches' : [treeSuffix]
6350N/A }
6350N/A </call>
6350N/A
6350N/A <if expr="RC != 0">
6350N/A <!-- If the reference tree could not be retrieved, return an error -->
6350N/A <return> [1, None] </return>
6350N/A </if>
6350N/A <iterate var="server" in="serverList">
6350N/A <sequence>
6350N/A <!-- Retrieve the same tree for every other server in the list -->
6350N/A <if expr="server.getHostname() == location">
6350N/A <script>
6350N/A filePath = dsPath
6350N/A isSameLocation = True
6350N/A </script>
6350N/A <else>
6350N/A <script>
6350N/A filePath = '%s/%s' % (server.getDir(), OPENDSNAME)
6350N/A isSameLocation = False
6350N/A </script>
6350N/A </else>
6350N/A </if>
6350N/A <call function="'exportLdifWithScript'">
6350N/A { 'location' : location,
6350N/A 'dsPath' : dsPath,
6350N/A 'dsInstanceHost' : server.getHostname(),
6350N/A 'dsInstanceAdminPort' : server.getAdminPort(),
6350N/A 'dsInstanceDn' : server.getRootDn(),
6350N/A 'dsInstancePswd' : server.getRootPwd(),
6350N/A 'ldifFile' : '%s/../%s' % (filePath, sampleTree),
6350N/A 'includeBranches' : [treeSuffix]
6350N/A }
6350N/A </call>
6350N/A
6350N/A <if expr="RC == 0">
6350N/A <sequence>
6350N/A
6350N/A <if expr="not isSameLocation">
6350N/A <!-- Copy sample tree file to reference server -->
6350N/A <call function="'copyFile'">
6350N/A { 'location' : server.getHostname(),
6350N/A 'remotehost' : location,
6350N/A 'srcfile' : '%s/../%s' % (filePath, sampleTree),
6350N/A 'destfile' : '%s/../%s' % (dsPath, sampleTree)
6350N/A }
6350N/A </call>
6350N/A </if>
6350N/A
6350N/A <!-- Compare this tree to the reference one -->
6350N/A <call function="'LdifDiffSdk'">
6350N/A { 'location' : location,
6350N/A 'dsPath' : dsPath,
6350N/A 'sourceLdif' : '%s/../%s' % (dsPath, sampleTree),
6350N/A 'targetLdif' : '%s/../%s' % (dsPath, referenceTree),
6350N/A 'outputLdif' : '%s/../%s' % (dsPath, treeDiffs)
6350N/A }
6350N/A </call>
6350N/A <if expr="STAXResult[0][0] != 0">
6350N/A <sequence>
6350N/A <script>
6350N/A failedServers.append('%s:%s' % \
6350N/A (server.getHostname(), server.getPort()))
6350N/A </script>
6350N/A <message log="1" level="'Error'">
6350N/A 'Tree is DIFFERENT for %s:%s compared to %s:%s' % \
6350N/A (server.getHostname(), server.getPort(),
6350N/A referenceServer.getHostname(), referenceServer.getPort())
6350N/A </message>
6350N/A </sequence>
6350N/A </if>
6350N/A </sequence>
6350N/A <else>
6350N/A <script>
6350N/A failedServers.append('%s:%s' % \
6350N/A (server.getHostname(), server.getPort()))
6350N/A </script>
6350N/A </else>
6350N/A </if>
6350N/A </sequence>
6350N/A </iterate>
6350N/A <if expr="len(failedServers) > 0">
6350N/A <!-- If at least one server failed to successfully compare to the
6350N/A ! reference tree, return an error, along with the list of the
6350N/A ! servers that failed to do so -->
6350N/A <script>
6350N/A myRC = 1
6350N/A comma = ','
6350N/A failingServerList = \
6350N/A 'List of non-synchronized servers (tree verify FAILED): %s ' \
6350N/A % comma.join(failedServers)
6350N/A </script>
6350N/A <else>
6350N/A <message>
6350N/A 'All servers synchronized (tree verify SUCCEEDED).'
6350N/A </message>
6350N/A </else>
6350N/A </if>
6350N/A <call function="'checktestRC'">
6350N/A { 'returncode' : myRC,
6350N/A 'result' : failingServerList,
6350N/A 'expected' : 0,
6350N/A 'issue' : myKnownIssue
6350N/A }
6350N/A </call>
6350N/A <return>[myRC, failedServers]</return>
6350N/A </sequence>
6350N/A </function>
2788N/A
2788N/A <function name="verifySchemas">
2788N/A <function-prolog>
2788N/A This function verifies that a schema file is synchronized all over a group of servers.
2788N/A </function-prolog>
2788N/A <function-list-args>
2788N/A <function-arg-def name="location"
2788N/A type="optional"
2788N/A default="STAF_REMOTE_HOSTNAME">
2788N/A <function-arg-description>
2788N/A Location of target host
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="hostname"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="dsPath"
2788N/A type="optional"
4153N/A default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
2788N/A <function-arg-description>
2788N/A Pathname to installation root
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="filepath"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="referenceServer" type="required">
2788N/A <function-arg-description>
2788N/A Server that should be taken as reference.
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="Server"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="serverList" type="required">
2788N/A <function-arg-description>
2788N/A List of the servers to verify against the referenceServer.
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="Server-list"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="schemaFile" type="required">
2788N/A <function-arg-description>
2788N/A Schema file to verify.
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="filename"/>
2788N/A </function-arg-def>
3951N/A
4267N/A <function-arg-def name="knownIssue" type="optional" default="None">
4267N/A <function-arg-description>
4267N/A Known issue. Corresponds to an issue number.
4267N/A </function-arg-description>
4267N/A </function-arg-def>
4267N/A
2788N/A </function-list-args>
2788N/A <sequence>
2788N/A <script>
2788N/A myRC = 0
4319N/A myKnownIssue = knownIssue
2788N/A failedServers = []
2788N/A failingServerList = ''
2788N/A referenceServerPath = '%s/%s' % (referenceServer.getDir(), OPENDSNAME)
2788N/A referenceSchema = '%s/config/schema/%s' % (referenceServerPath, schemaFile)
2788N/A schemaDiffs = 'schemaDiffs.ldif'
2788N/A </script>
2788N/A
2788N/A <message>
2788N/A 'Verify schema file %s taking %s as reference.' % (schemaFile, referenceServerPath)
2788N/A </message>
2788N/A
2788N/A <iterate var="server" in="serverList">
2788N/A <sequence>
2788N/A <!-- Copy reference schema file to other server -->
2788N/A <call function="'copyFile'">
2788N/A { 'location' : referenceServer.getHostname(),
2788N/A 'remotehost' : server.getHostname(),
2788N/A 'srcfile' : referenceSchema,
2788N/A 'destfile' : '%s/reference_%s' % (server.getDir(),schemaFile)
2788N/A }
2788N/A </call>
2788N/A <script>
2788N/A serverPath = '%s/%s' % (server.getDir(), OPENDSNAME)
2788N/A </script>
2788N/A
2788N/A <!-- Compare this schema to the reference one -->
2788N/A <call function="'LdifDiffWithScript'">
2788N/A { 'location' : location,
2788N/A 'dsPath' : dsPath,
2788N/A 'sourceLdif' : '%s/config/schema/%s' % (serverPath, schemaFile),
2788N/A 'targetLdif' : '%s/reference_%s' % (server.getDir(), schemaFile),
2788N/A 'outputLdif' : '%s/%s' % (server.getDir(), schemaDiffs)
2788N/A }
2788N/A </call>
2788N/A <script>
2788N/A if STAXResult != 0 :
2788N/A failedServers.append('%s:%s' % (server.getHostname(), server.getPort()))
4865N/A </script>
2788N/A </sequence>
2788N/A </iterate>
2788N/A <if expr="len(failedServers) > 0">
2788N/A <!-- If at least one server failed to successfully compare to the reference tree,
2788N/A ! return an error, along with the list of the servers that failed to do so -->
2788N/A <script>
2788N/A myRC = 1
2788N/A comma = ','
2788N/A failingServerList = 'List of non-synchronized servers (schema verify FAILED): %s ' % comma.join(failedServers)
2788N/A </script>
2788N/A <else>
2788N/A <message>
2788N/A 'All servers synchronized (schema verify SUCCEEDED).'
2788N/A </message>
2788N/A </else>
2788N/A </if>
2788N/A <call function="'checktestRC'">
2788N/A { 'returncode' : myRC,
2788N/A 'result' : failingServerList ,
4267N/A 'expected' : 0,
4319N/A 'issue' : myKnownIssue
2788N/A }
2788N/A </call>
2788N/A <return>[myRC, failedServers]</return>
2788N/A </sequence>
2788N/A </function>
2788N/A
2788N/A
2788N/A <function name="deleteTrees">
2788N/A <function-prolog>
2788N/A This function deletes a (sub)tree from a list of servers.
2788N/A </function-prolog>
2788N/A <function-list-args>
2788N/A <function-arg-def name="serverList" type="required">
2788N/A <function-arg-description>
2788N/A List of the servers (instances of "Server" class) where the tree will be deleted.
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="Server-list"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="treeSuffix" type="required">
2788N/A <function-arg-description>
2788N/A Suffix of the tree to delete.
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="DN"/>
2788N/A </function-arg-def>
2788N/A
2788N/A <function-arg-def name="startDS" type="optional" default="True">
2788N/A <function-arg-description>
2788N/A Need to start the Directory Servers before deleting.
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="boolean"/>
2788N/A </function-arg-def>
2788N/A </function-list-args>
2788N/A <sequence>
2788N/A <if expr="startDS">
2788N/A <!-- Start the servers in the list -->
2788N/A <call function="'startServers'">
2788N/A [serverList]
2788N/A </call>
2788N/A </if>
2788N/A
2788N/A <!-- Delete the tree in every server in the list -->
2788N/A <paralleliterate var="server" in="serverList">
2788N/A <sequence>
2788N/A <message>
2788N/A 'Delete suffix %s on server running on host %s on port %s' % (treeSuffix, server.getHostname(), server.getPort())
2788N/A </message>
2788N/A
2788N/A <!-- Delete suffix and subtree -->
2788N/A <call function="'ldapDeleteWithScript'">
2788N/A { 'location' : server.getHostname(),
2788N/A 'dsPath' : '%s/%s' % (server.getDir(),OPENDSNAME),
2788N/A 'dsInstanceHost' : server.getHostname(),
2788N/A 'dsInstancePort' : server.getPort(),
2788N/A 'dsInstanceDn' : server.getRootDn(),
2788N/A 'dsInstancePswd' : server.getRootPwd(),
2788N/A 'dsDn' : [treeSuffix],
2788N/A 'dsDeleteSubtree' : True
2788N/A }
2788N/A </call>
2788N/A </sequence>
2788N/A </paralleliterate>
2788N/A
2788N/A <if expr="startDS">
2788N/A <!-- Stop the servers in the list -->
2788N/A <call function="'stopServers'">
2788N/A [serverList]
2788N/A </call>
2788N/A </if>
2788N/A </sequence>
2788N/A </function>
2788N/A
2788N/A
2788N/A <function name="startServers">
2788N/A <function-prolog>
2788N/A This function starts a list of servers.
2788N/A </function-prolog>
4865N/A <function-list-args>
2788N/A <function-arg-def name="serverList" type="required">
2788N/A <function-arg-description>
2788N/A List of the servers (instances of "Server" class) to be started.
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="Server-list"/>
4865N/A </function-arg-def>
2788N/A </function-list-args>
2788N/A
2788N/A <sequence>
5098N/A
5098N/A <!-- Check if using coverage in which case we'll avoid doing parallele iterate -->
5098N/A <!-- Check if 'emma.jar' exists -->
5098N/A <call function="'GetEntry'">
5098N/A {
5098N/A 'location' : STAF_REMOTE_HOSTNAME ,
5098N/A 'entry' : '%s/%s/lib/emma.jar' % (serverList[0].getDir(),OPENDSNAME) ,
5098N/A 'attribute' : 'TYPE'
5098N/A }
5098N/A </call>
5098N/A <if expr="RC != 48">
5098N/A <!-- 'emma.jar' exists -->
5098N/A <script>coverage = True</script>
5098N/A <else>
5098N/A <script>coverage = False</script>
5098N/A </else>
5098N/A </if>
5098N/A <message>'tools.xml - coverage=%s' % coverage</message>
5098N/A
5098N/A <!-- Start the servers in the list -->
5056N/A <if expr="coverage == True">
2788N/A <sequence>
5056N/A <message>'starting servers in sequence using "iterate"'</message>
5056N/A <iterate var="server" in="serverList">
5056N/A <sequence>
5056N/A <message>
5056N/A 'Start DS on host %s to run on port %s' % (server.getHostname(),server.getPort())
5056N/A </message>
5056N/A
5056N/A <!--- Start DS -->
5056N/A <call function="'StartDsWithScript'">
5056N/A { 'location' : server.getHostname(),
5056N/A 'dsPath' : '%s/%s' % (server.getDir(),OPENDSNAME)
5056N/A }
5056N/A </call>
5056N/A
5056N/A <!--- Check that DS started -->
5056N/A <call function="'isAlive'">
5056N/A { 'location' : server.getHostname(),
5056N/A 'dsPath' : '%s/%s' % (server.getDir(),OPENDSNAME),
5056N/A 'dsInstanceHost' : server.getHostname(),
5056N/A 'dsInstancePort' : server.getPort(),
5056N/A 'dsInstanceDn' : server.getRootDn(),
5056N/A 'dsInstancePswd' : server.getRootPwd(),
5056N/A 'noOfLoops' : 10 ,
5056N/A 'noOfMilliSeconds' : 2000
5056N/A }
5056N/A </call>
5056N/A </sequence>
5056N/A </iterate>
2788N/A </sequence>
5056N/A <else>
5056N/A <sequence>
5056N/A <message>'starting servers in parallel using "paralleliterate"'</message>
5056N/A <paralleliterate var="server" in="serverList">
5056N/A <sequence>
5056N/A <message>
5056N/A 'Start DS on host %s to run on port %s' % (server.getHostname(),server.getPort())
5056N/A </message>
5056N/A
5056N/A <!--- Start DS -->
5056N/A <call function="'StartDsWithScript'">
5056N/A { 'location' : server.getHostname(),
5056N/A 'dsPath' : '%s/%s' % (server.getDir(),OPENDSNAME)
5056N/A }
5056N/A </call>
5056N/A
5056N/A <!--- Check that DS started -->
5056N/A <call function="'isAlive'">
5056N/A { 'location' : server.getHostname(),
5056N/A 'dsPath' : '%s/%s' % (server.getDir(),OPENDSNAME),
5056N/A 'dsInstanceHost' : server.getHostname(),
5056N/A 'dsInstancePort' : server.getPort(),
5056N/A 'dsInstanceDn' : server.getRootDn(),
5056N/A 'dsInstancePswd' : server.getRootPwd(),
5056N/A 'noOfLoops' : 10 ,
5056N/A 'noOfMilliSeconds' : 2000
5056N/A }
5056N/A </call>
5056N/A </sequence>
5056N/A </paralleliterate>
5056N/A </sequence>
5056N/A </else>
5056N/A </if>
2788N/A </sequence>
2788N/A </function>
2788N/A
2788N/A
2788N/A <function name="stopServers">
2788N/A <function-prolog>
2788N/A This function stops a list of servers.
2788N/A </function-prolog>
2788N/A <function-list-args>
2788N/A <function-arg-def name="serverList" type="required">
2788N/A <function-arg-description>
2788N/A List of the servers (instances of "Server" class) to be stopped.
2788N/A </function-arg-description>
2788N/A <function-arg-property name="type" value="Server-list"/>
2788N/A </function-arg-def>
4865N/A <function-arg-def name="noOfLoops"
4865N/A type="optional"
6374N/A default="20">
4865N/A <function-arg-description>
4865N/A Number of iterations (for isStopped())
4865N/A </function-arg-description>
4865N/A <function-arg-property name="type" value="integer"/>
4865N/A </function-arg-def>
4865N/A <function-arg-def name="noOfMilliSeconds"
4865N/A type="optional"
4865N/A default="2000">
4865N/A <function-arg-description>
4865N/A Number of seconds to wait between iterations (for isStopped())
4865N/A </function-arg-description>
4865N/A <function-arg-property name="type" value="seconds"/>
4865N/A </function-arg-def>
2788N/A </function-list-args>
2788N/A
2788N/A <sequence>
2788N/A <!-- Stop the servers in the list -->
2788N/A <paralleliterate var="server" in="serverList">
2788N/A <sequence>
2788N/A <message>
2788N/A 'Stop DS on host %s running on port %s' % (server.getHostname(),server.getPort())
2788N/A </message>
2788N/A
2788N/A <!--- Stop DS -->
2788N/A <call function="'StopDsWithScript'">
4865N/A { 'location' : server.getHostname(),
4865N/A 'dsHost' : server.getHostname(),
4865N/A 'dsPath' : '%s/%s' % (server.getDir(),OPENDSNAME),
4865N/A 'dsAdminPort' : server.getAdminPort(),
4865N/A 'dsBindDN' : server.getRootDn(),
4865N/A 'dsBindPwd' : server.getRootPwd(),
4865N/A 'noOfLoops' : noOfLoops,
4865N/A 'noOfMilliSeconds' : noOfMilliSeconds
2788N/A }
2788N/A </call>
2788N/A </sequence>
2788N/A </paralleliterate>
2788N/A </sequence>
2788N/A </function>
2788N/A
3315N/A <!-- This function perform a search operation in a LDIF file -->
3321N/A <function name="ldifSearchWithScript" scope="local">
3315N/A <function-prolog>
3315N/A This function perform a search operation in a LDIF file
3315N/A </function-prolog>
3315N/A <function-map-args>
3315N/A <function-arg-def name="location"
3315N/A type="optional"
3315N/A default="STAF_REMOTE_HOSTNAME">
3315N/A <function-arg-description>
3315N/A Location of target host
3315N/A </function-arg-description>
3315N/A <function-arg-property name="type" value="hostname"/>
3315N/A </function-arg-def>
3315N/A <function-arg-def name="dsPath"
3327N/A type="optional"
4153N/A default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
3315N/A <function-arg-description>
3315N/A Pathname to installation root
3315N/A </function-arg-description>
3315N/A <function-arg-property name="type" value="filepath"/>
3315N/A </function-arg-def>
3315N/A <function-arg-def name="dsBaseDN" type="optional">
3315N/A <function-arg-description>
3315N/A The baseDN for the search operation
3315N/A </function-arg-description>
3315N/A <function-arg-property name="type" value="dn"/>
4865N/A </function-arg-def>
3315N/A <function-arg-def name="dsFilterFile" type="optional">
3315N/A <function-arg-description>
3315N/A File containing a list of search filter strings
3315N/A </function-arg-description>
3315N/A <function-arg-property name="type" value="filename"/>
3315N/A </function-arg-def>
3315N/A <function-arg-def name="dsLdifFile" type="required">
3315N/A <function-arg-description>
3315N/A LDIF file to use as the source data
3315N/A </function-arg-description>
3315N/A <function-arg-property name="type" value="filename"/>
3315N/A </function-arg-def>
3315N/A <function-arg-def name="dsOutputFile" type="optional">
3315N/A <function-arg-description>
3315N/A File to which the search results should be written
3315N/A </function-arg-description>
3315N/A <function-arg-property name="type" value="filename"/>
3315N/A </function-arg-def>
4865N/A <function-arg-def name="dsOverwriteExisting"
3327N/A type="optional"
3327N/A default="True">
3315N/A <function-arg-description>
3315N/A Overwrite the output file specified
3315N/A </function-arg-description>
3315N/A <function-arg-property name="type" value="filename"/>
3315N/A </function-arg-def>
3315N/A <function-arg-def name="dsSearchScope" type="optional">
3315N/A <function-arg-description>
3315N/A The scope of the search operation
3315N/A </function-arg-description>
3315N/A <function-arg-property name="type" value="option"/>
4865N/A </function-arg-def>
3315N/A <function-arg-def name="dsTimeLimit" type="optional">
3315N/A <function-arg-description>
3315N/A Maximum length of time in seconds to allow for the search
3315N/A </function-arg-description>
3315N/A <function-arg-property name="type" value="integer"/>
3315N/A </function-arg-def>
3315N/A <function-arg-def name="dsSizeLimit" type="optional">
3315N/A <function-arg-description>
3315N/A Maximum number of entries to return from the search
3315N/A </function-arg-description>
3315N/A <function-arg-property name="type" value="integer"/>
3315N/A </function-arg-def>
3315N/A <function-arg-def name="dsDontWrap" type="optional">
3315N/A <function-arg-description>
3315N/A Do not wrap long lines
3315N/A </function-arg-description>
3315N/A <function-arg-property name="type" value="option"/>
3315N/A </function-arg-def>
3315N/A <function-arg-def name="dsHelp" type="optional">
3315N/A <function-arg-description>
3315N/A Display this usage information
3315N/A </function-arg-description>
3315N/A <function-arg-property name="type" value="option"/>
3315N/A </function-arg-def>
3315N/A <function-arg-def name="dsVersion" type="optional">
3315N/A <function-arg-description>
3315N/A Display Directory Server version information
3315N/A </function-arg-description>
3315N/A <function-arg-property name="type" value="option"/>
3315N/A </function-arg-def>
3315N/A <function-arg-def name="dsFilter" type="optional">
3315N/A <function-arg-description>
3315N/A The filter for the search operation
3315N/A </function-arg-description>
3315N/A <function-arg-property name="type" value="filter"/>
3315N/A </function-arg-def>
3315N/A <function-arg-def name="dsAttributes" type="optional">
3315N/A <function-arg-description>
3315N/A Only return these attributes
3315N/A </function-arg-description>
3315N/A <function-arg-property name="type" value="string"/>
3315N/A </function-arg-def>
3315N/A <function-arg-def name="expectedRC" type="optional" default="0">
3315N/A <function-arg-description>
3315N/A Expected return code value. Default value is 0
3315N/A Wildcard 'noCheck' to not check the RC
3315N/A </function-arg-description>
4865N/A <function-arg-property name="type" value="integer"/>
4865N/A </function-arg-def>
3315N/A </function-map-args>
3315N/A <sequence>
3315N/A <!-- Build the Command -->
3315N/A <script>
3315N/A STAFCmdParamsList=[]
3315N/A STAFCmdParams=''
3315N/A
3315N/A if dsPath:
3315N/A dsBinPath='%s/%s' % (dsPath,fileFolder)
3315N/A STAFCmd='%s/ldifsearch%s' % (dsBinPath,fileExt)
3315N/A
3315N/A if dsBaseDN:
3315N/A STAFCmdParamsList.append('-b "%s"' % dsBaseDN)
3315N/A
3315N/A if dsFilterFile:
3315N/A STAFCmdParamsList.append('-f %s' % dsFilterFile)
3315N/A
3315N/A if dsLdifFile:
3315N/A STAFCmdParamsList.append('-l %s' % dsLdifFile)
3315N/A
3315N/A if dsOutputFile:
3315N/A STAFCmdParamsList.append('-o %s' % dsOutputFile)
3315N/A
3315N/A if dsOverwriteExisting:
3315N/A STAFCmdParamsList.append('-O')
3315N/A
3315N/A if dsSearchScope:
3315N/A STAFCmdParamsList.append('-s %s' % dsSearchScope)
3315N/A
3315N/A if dsTimeLimit:
3315N/A STAFCmdParamsList.append('-t %s' % dsTimeLimit)
3315N/A
3315N/A if dsSizeLimit:
3315N/A STAFCmdParamsList.append('-z %s' % dsSizeLimit)
3315N/A
3315N/A if dsDontWrap:
3315N/A STAFCmdParamsList.append('-T')
3315N/A
3315N/A if dsHelp:
3315N/A STAFCmdParamsList.append('-H')
3315N/A
3315N/A if dsVersion:
3315N/A STAFCmdParamsList.append('-V')
3315N/A
3315N/A if dsFilter:
3315N/A STAFCmdParamsList.append('"%s"' % dsFilter)
3315N/A
3315N/A if dsAttributes:
3315N/A STAFCmdParamsList.append('%s' % dsAttributes)
3315N/A
3315N/A STAFCmdParams=' '.join(STAFCmdParamsList)
3315N/A </script>
3315N/A
3315N/A <call function="'runCommand'" >
3315N/A {
3315N/A 'name' : 'LDIF Search Script',
3315N/A 'command' : STAFCmd,
3315N/A 'arguments' : STAFCmdParams,
3315N/A 'location' : location,
3315N/A 'expectedRC' : expectedRC
3315N/A }
3315N/A </call>
3315N/A
3315N/A <return>STAXResult</return>
3315N/A </sequence>
3315N/A </function>
3327N/A
3327N/A <!-- This function execute the encode-password tool -->
3327N/A <function name="encodePasswordWithScript" scope="local">
3321N/A <function-prolog>
3327N/A This function execute the encode-password tool
3321N/A </function-prolog>
3321N/A <function-map-args>
3321N/A <function-arg-def name="location"
3321N/A type="optional"
3321N/A default="STAF_REMOTE_HOSTNAME">
3321N/A <function-arg-description>
3321N/A Location of target host
3321N/A </function-arg-description>
3321N/A <function-arg-property name="type" value="hostname"/>
3321N/A </function-arg-def>
3321N/A <function-arg-def name="dsPath"
3321N/A type="optional"
4153N/A default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
3321N/A <function-arg-description>
3321N/A Pathname to installation root
3321N/A </function-arg-description>
3321N/A <function-arg-property name="type" value="filepath"/>
4865N/A </function-arg-def>
3327N/A <function-arg-def name="authPwdSyntax" type="optional">
3327N/A <function-arg-description>
3327N/A Use the authentication password syntax.
3327N/A </function-arg-description>
3327N/A <function-arg-property name="type" value="option"/>
3327N/A </function-arg-def>
3327N/A <function-arg-def name="clearPwd" type="optional">
3321N/A <function-arg-description>
3327N/A Specify the clear-text password.
3327N/A </function-arg-description>
3327N/A <function-arg-property name="type" value="string"/>
3327N/A </function-arg-def>
3327N/A <function-arg-def name="encodedPwd" type="optional">
3327N/A <function-arg-description>
3327N/A Specify the encoded password.
3321N/A </function-arg-description>
3327N/A <function-arg-property name="type" value="string"/>
3327N/A </function-arg-def>
3327N/A <function-arg-def name="encodedPwdFile" type="optional">
3327N/A <function-arg-description>
3327N/A Use the encoded password from the specified file.
3327N/A </function-arg-description>
3327N/A <function-arg-property name="type" value="filename"/>
3321N/A </function-arg-def>
3327N/A <function-arg-def name="clearPwdFile" type="optional">
3327N/A <function-arg-description>
3327N/A Use the clear-text password from the specified file.
3327N/A </function-arg-description>
3327N/A <function-arg-property name="type" value="filename"/>
3327N/A </function-arg-def>
3327N/A <function-arg-def name="listSchemes" type="optional">
3327N/A <function-arg-description>
3327N/A Display a list of the password storage schemes that are available
3327N/A for use in the OpenDS server.
3327N/A </function-arg-description>
3327N/A <function-arg-property name="type" value="option"/>
3327N/A </function-arg-def>
3327N/A <function-arg-def name="useCmpRC" type="optional">
3321N/A <function-arg-description>
3327N/A Use an exit code that indicates whether a given clear-text password
3327N/A matched a provided encoded password.
3327N/A Results are an exit code of 6 (COMPARE_TRUE) or
3327N/A an exit code of 5 (COMPARE_FALSE).
3321N/A </function-arg-description>
3327N/A <function-arg-property name="type" value="option"/>
3321N/A </function-arg-def>
3327N/A <function-arg-def name="storageScheme" type="optional">
3327N/A <function-arg-description>
3327N/A Specify the name of the password storage scheme to use when
3327N/A encoding a clear-text password.
3327N/A </function-arg-description>
3327N/A <function-arg-property name="type" value="option"/>
4865N/A </function-arg-def>
3321N/A <function-arg-def name="dsHelp" type="optional">
3321N/A <function-arg-description>
3321N/A Display this usage information
3321N/A </function-arg-description>
3321N/A <function-arg-property name="type" value="option"/>
3321N/A </function-arg-def>
3321N/A <function-arg-def name="dsVersion" type="optional">
3321N/A <function-arg-description>
3321N/A Display Directory Server version information
3321N/A </function-arg-description>
3321N/A <function-arg-property name="type" value="option"/>
3321N/A </function-arg-def>
3321N/A <function-arg-def name="expectedRC" type="optional" default="0">
3321N/A <function-arg-description>
3321N/A Expected return code value. Default value is 0.
3321N/A Wildcard 'noCheck' to not check the RC
3321N/A </function-arg-description>
4865N/A <function-arg-property name="type" value="integer"/>
3321N/A </function-arg-def>
5061N/A <function-arg-def name="knownIssue" type="optional" default="None">
5061N/A <function-arg-description>
5061N/A Known issue. Corresponds to an issue number.
5061N/A </function-arg-description>
5061N/A </function-arg-def>
3321N/A </function-map-args>
3321N/A <sequence>
3321N/A <!-- Build the Command -->
3321N/A <script>
3321N/A STAFCmdParamsList=[]
3321N/A STAFCmdParams=''
3321N/A
3321N/A if dsPath:
3321N/A dsBinPath='%s/%s' % (dsPath,fileFolder)
3327N/A STAFCmd='%s/encode-password%s' % (dsBinPath,fileExt)
3327N/A
3327N/A if authPwdSyntax:
3327N/A STAFCmdParamsList.append('-a')
3327N/A
3327N/A if clearPwd:
3327N/A STAFCmdParamsList.append('-c %s' % clearPwd)
3327N/A
3327N/A if encodedPwd:
3327N/A STAFCmdParamsList.append('-e %s' % encodedPwd)
3321N/A
3327N/A if encodedPwdFile:
3327N/A STAFCmdParamsList.append('-E %s' % encodedPwdFile)
3327N/A
3327N/A if clearPwdFile:
3327N/A STAFCmdParamsList.append('-f %s' % clearPwdFile)
3321N/A
3327N/A if listSchemes:
3327N/A STAFCmdParamsList.append('-l')
3321N/A
3327N/A if useCmpRC:
3327N/A STAFCmdParamsList.append('-r')
3327N/A
3327N/A if storageScheme:
3327N/A STAFCmdParamsList.append('-s %s' % storageScheme)
3327N/A
3321N/A if dsHelp:
3321N/A STAFCmdParamsList.append('-H')
3327N/A
3321N/A if dsVersion:
3321N/A STAFCmdParamsList.append('-V')
3321N/A
3321N/A STAFCmdParams=' '.join(STAFCmdParamsList)
3321N/A </script>
3321N/A
3321N/A <call function="'runCommand'">
3321N/A {
3327N/A 'name' : 'Encode password script',
3321N/A 'command' : STAFCmd,
3321N/A 'arguments' : STAFCmdParams,
3321N/A 'location' : location,
5061N/A 'expectedRC' : expectedRC,
5061N/A 'knownIssue' : knownIssue
3321N/A }
3321N/A </call>
3321N/A
3321N/A <return>STAXResult</return>
3321N/A </sequence>
3321N/A </function>
4865N/A
4865N/A
4865N/A <!-- This function check task execution-->
4865N/A <function name="checkTaskExecution" scope="local">
4865N/A <function-prolog>
4865N/A This functioncheck task execution
4865N/A </function-prolog>
4865N/A <function-map-args>
4865N/A <function-arg-def name="location"
4865N/A type="optional"
4865N/A default="STAF_REMOTE_HOSTNAME">
4865N/A <function-arg-description>
4865N/A Location of target host
4865N/A </function-arg-description>
4865N/A <function-arg-property name="type" value="hostname"/>
4865N/A </function-arg-def>
4865N/A <function-arg-def name="dsPath"
4865N/A type="optional"
4865N/A default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
4865N/A <function-arg-description>
4865N/A Pathname to installation root
4865N/A </function-arg-description>
4865N/A <function-arg-property name="type" value="filepath"/>
4865N/A </function-arg-def>
4865N/A <function-arg-def name="outputToCheck" type="required">
4865N/A <function-arg-description>
4865N/A The output result of the task
4865N/A </function-arg-description>
4865N/A <function-arg-property name="type" value="string"/>
4865N/A </function-arg-def>
4865N/A
4865N/A <function-arg-def name="dsInstanceDn" type="required">
4865N/A <function-arg-description>
4865N/A Bind DN
4865N/A </function-arg-description>
4865N/A <function-arg-property name="type" value="DN" />
4865N/A </function-arg-def>
4865N/A
4865N/A <function-arg-def name="dsInstanceAdminPort"
4865N/A type="optional"
4865N/A default="DIRECTORY_INSTANCE_ADMIN_PORT">
4865N/A <function-arg-description>
4865N/A Directory server admin port number
4865N/A </function-arg-description>
4865N/A <function-arg-property name="type" value="Port number" />
4865N/A </function-arg-def>
4865N/A
4865N/A <function-arg-def name="dsInstanceHost"
4865N/A type="optional"
4865N/A default="STAF_REMOTE_HOSTNAME">
4865N/A <function-arg-description>
4865N/A Directory server hostname or IP address
4865N/A </function-arg-description>
4865N/A <function-arg-property name="type" value="hostname" />
4865N/A </function-arg-def>
4865N/A
4865N/A <function-arg-def name="dsInstancePswd" type="required">
4865N/A <function-arg-description>
4865N/A Bind password
4865N/A </function-arg-description>
4865N/A <function-arg-property name="type" value="string" />
4865N/A </function-arg-def>
4865N/A
4865N/A </function-map-args>
4865N/A <sequence>
4865N/A <script>
4865N/A resultString = outputToCheck
4865N/A resultSplitted = resultString.split()
4865N/A taskId = None
4865N/A for str in resultSplitted:
4865N/A if len(str) == 17:
4865N/A taskId = str
4865N/A </script>
4865N/A
4865N/A <message>
4865N/A 'Command task Id : %s' % taskId
4865N/A </message>
4865N/A
4865N/A <message>
4865N/A 'Check ldif command successfully completed with manage-task'
4865N/A </message>
4865N/A
4865N/A <script>checkRC=9999</script>
4865N/A <loop from="1" to="10" var="loop" while="checkRC != 0">
4865N/A <sequence>
4865N/A <message>'LOOP %s' % loop</message>
4865N/A <call function="'manage-tasks'">
4865N/A {
4865N/A 'dsPath' : dsPath,
4865N/A 'dsInstanceHost' : dsInstanceHost ,
4865N/A 'dsInstanceAdminPort' : dsInstanceAdminPort,
4865N/A 'dsInstanceDn' : dsInstanceDn ,
4865N/A 'dsInstancePswd' : dsInstancePswd ,
4865N/A 'dsInfo' : taskId ,
5098N/A 'dsQuiet' : 'True' ,
5098N/A 'expectedRC' : 'noCheck'
4865N/A }
4865N/A </call>
4865N/A
4865N/A <script>
4865N/A returnString = STAXResult[0][1]
4865N/A msg = 'Status Completed successfully'
4865N/A </script>
4865N/A
4865N/A <call function="'searchString'">
4865N/A {
4865N/A 'expectedString' : msg ,
4865N/A 'returnString' : returnString ,
4865N/A 'expectedRC' : 'noCheck'
4865N/A }
4865N/A </call>
4865N/A
4865N/A <script>
4865N/A checkRC = STAXResult[0]
4865N/A </script>
4865N/A
4865N/A <call function="'Sleep'">
4865N/A { 'sleepForMilliSeconds' : 2000 }
4865N/A </call>
4865N/A
4865N/A </sequence>
4865N/A </loop>
4865N/A
4865N/A <call function="'checktestRC'">
4865N/A { 'returncode' : checkRC ,
4865N/A 'result' : "Task succeeds" ,
4865N/A 'expected' : 0
4865N/A }
4865N/A </call>
4865N/A </sequence>
4865N/A </function>
3327N/A
3327N/A <!-- This function compares two LDIF files using the ldif-diff script -->
3327N/A <function name="LdifDiffWithScript-new" scope="local">
3321N/A <function-prolog>
3327N/A This function compares two LDIF files and reports the differences
3327N/A in LDIF format
3321N/A </function-prolog>
3321N/A <function-map-args>
3321N/A <function-arg-def name="location"
3321N/A type="optional"
3321N/A default="STAF_REMOTE_HOSTNAME">
3321N/A <function-arg-description>
3321N/A Location of target host
3321N/A </function-arg-description>
3321N/A <function-arg-property name="type" value="hostname"/>
4865N/A </function-arg-def>
3321N/A <function-arg-def name="dsPath"
3321N/A type="optional"
4153N/A default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
3321N/A <function-arg-description>
3321N/A Pathname to installation root
3321N/A </function-arg-description>
3321N/A <function-arg-property name="type" value="filepath"/>
4865N/A </function-arg-def>
3321N/A <function-arg-def name="dsVersion" type="optional">
3321N/A <function-arg-description>
3321N/A Display Directory Server version information
3321N/A </function-arg-description>
3321N/A <function-arg-property name="type" value="option"/>
4865N/A </function-arg-def>
3327N/A <function-arg-def name="sourceLdif" type="required">
3327N/A <function-arg-description>
3327N/A LDIF file to use as the source data
3327N/A </function-arg-description>
3327N/A <function-arg-property name="type" value="filepath"/>
4865N/A </function-arg-def>
3327N/A <function-arg-def name="targetLdif" type="required">
3327N/A <function-arg-description>
3327N/A LDIF file to use as the target data
3327N/A </function-arg-description>
3327N/A <function-arg-property name="type" value="filepath"/>
4865N/A </function-arg-def>
3327N/A <function-arg-def name="outputLdif" type="required">
3327N/A <function-arg-description>
3327N/A File to which the diffs should be written
3327N/A </function-arg-description>
3327N/A <function-arg-property name="type" value="filepath"/>
4865N/A </function-arg-def>
3327N/A <function-arg-def name="overwriteExisting" type="optional" default="True">
3327N/A <function-arg-description>
3327N/A Overwrite existing output file rather than append to it
3327N/A </function-arg-description>
3327N/A <function-arg-property name="type" value="option"/>
4865N/A </function-arg-def>
3327N/A <function-arg-def name="singleValueChanges" type="optional">
3327N/A <function-arg-description>
3327N/A Write each attribute-level change as a separate modification
3327N/A per attribute value rather than one modification per entry
3327N/A </function-arg-description>
3327N/A <function-arg-property name="type" value="option"/>
4865N/A </function-arg-def>
6066N/A <function-arg-def name="useCmpRC" type="optional">
6066N/A <function-arg-description>
6073N/A Use an exit code that indicates whether difference were not found.
6066N/A Results are an exit code of 6 (COMPARE_TRUE) or
6066N/A an exit code of 5 (COMPARE_FALSE).
6066N/A </function-arg-description>
6066N/A <function-arg-property name="type" value="option"/>
6066N/A </function-arg-def>
3327N/A <function-arg-def name="dsHelp" type="optional">
3327N/A <function-arg-description>
3327N/A Help option
3327N/A </function-arg-description>
3327N/A <function-arg-property name="help" value="option"/>
3327N/A </function-arg-def>
3327N/A <function-arg-def name="expectedRC" type="optional" default="0">
3327N/A <function-arg-description>
3327N/A Expected return code value. Default value is 0.
3327N/A Wildcard 'noCheck' to not check the RC
3327N/A </function-arg-description>
4865N/A <function-arg-property name="type" value="integer"/>
4865N/A </function-arg-def>
3951N/A <function-arg-def name="knownIssue" type="optional" default="None">
3951N/A <function-arg-description>
3951N/A Known issue. Corresponds to an issue number.
3951N/A </function-arg-description>
3951N/A </function-arg-def>
3327N/A </function-map-args>
3327N/A <sequence>
3327N/A <!-- Build the Command -->
3327N/A <script>
5976N/A foldersToCreate = []
3327N/A STAFCmdParamsList=[]
3327N/A STAFCmdParams=''
3327N/A
3327N/A if dsPath:
3327N/A dsBinPath='%s/%s' % (dsPath,fileFolder)
3327N/A STAFCmd='%s/ldif-diff%s' % (dsBinPath,fileExt)
3327N/A
3327N/A if dsVersion:
3327N/A STAFCmdParamsList.append('-V')
3327N/A
3327N/A if sourceLdif:
3327N/A STAFCmdParamsList.append('-s %s' % sourceLdif)
3327N/A
3327N/A if targetLdif:
3327N/A STAFCmdParamsList.append('-t %s' % targetLdif)
3327N/A
3327N/A if outputLdif:
5976N/A foldersToCreate.append(os.path.dirname(outputLdif))
3327N/A STAFCmdParamsList.append('-o %s' % outputLdif)
3327N/A
6066N/A if useCmpRC:
6066N/A STAFCmdParamsList.append('-r')
6066N/A
3327N/A if overwriteExisting:
3327N/A STAFCmdParamsList.append('-O')
3327N/A
3327N/A if singleValueChanges:
3327N/A STAFCmdParamsList.append('-S')
3327N/A
3327N/A if dsHelp:
3327N/A STAFCmdParamsList.append('-H')
3327N/A
3327N/A STAFCmdParams=' '.join(STAFCmdParamsList)
3327N/A </script>
5976N/A
5976N/A <call function="'createMultiFolders'">
5976N/A { 'location' : location,
5976N/A 'folderslist' : foldersToCreate
5976N/A }
5976N/A </call>
5976N/A
5976N/A <message>
5976N/A '%s %s' % (STAFCmd, STAFCmdParams)
5976N/A </message>
3327N/A
3327N/A <call function="'runCommand'">
3327N/A {
3327N/A 'name' : 'Ldif diff script',
3327N/A 'command' : STAFCmd,
3327N/A 'arguments' : STAFCmdParams,
3327N/A 'location' : location,
3951N/A 'expectedRC' : expectedRC ,
3951N/A 'knownIssue' : knownIssue
3327N/A }
3327N/A </call>
3327N/A
3327N/A <return>STAXResult</return>
3327N/A </sequence>
3327N/A </function>
3327N/A
3327N/A <!-- This function execute the dsjavaproperties tool -->
3327N/A <function name="dsJavaPropertiesWithScript" scope="local">
3327N/A <function-prolog>
3327N/A This function execute the dsjavaproperties tool
3327N/A </function-prolog>
3327N/A <function-map-args>
3327N/A <function-arg-def name="location"
3327N/A type="optional"
3327N/A default="STAF_REMOTE_HOSTNAME">
3327N/A <function-arg-description>
3327N/A Location of target host
3327N/A </function-arg-description>
3327N/A <function-arg-property name="type" value="hostname"/>
4865N/A </function-arg-def>
3327N/A <function-arg-def name="dsPath"
3327N/A type="optional"
4153N/A default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
3327N/A <function-arg-description>
3327N/A Pathname to installation root
3327N/A </function-arg-description>
3327N/A <function-arg-property name="type" value="filepath"/>
3327N/A </function-arg-def>
3327N/A <function-arg-def name="Version" type="optional">
3327N/A <function-arg-description>
3327N/A Display Directory Server version information
3327N/A </function-arg-description>
3327N/A <function-arg-property name="type" value="option"/>
3327N/A </function-arg-def>
3327N/A <function-arg-def name="Quiet" type="optional">
3327N/A <function-arg-description>
3327N/A Run dsjavaproperties in quiet mode
3327N/A Quiet mode does not output progress information to standard output
3327N/A </function-arg-description>
3327N/A <function-arg-property name="type" value="option"/>
3327N/A </function-arg-def>
3327N/A <function-arg-def name="Help" type="optional">
3327N/A <function-arg-description>
3327N/A Help option
3327N/A </function-arg-description>
3327N/A <function-arg-property name="help" value="option"/>
3321N/A </function-arg-def>
3321N/A <function-arg-def name="expectedRC" type="optional" default="0">
3321N/A <function-arg-description>
3321N/A Expected return code value. Default value is 0.
3321N/A Wildcard 'noCheck' to not check the RC
3321N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="integer"/>
3321N/A </function-arg-def>
3321N/A </function-map-args>
3321N/A <sequence>
3321N/A <!-- Build the Command -->
3321N/A <script>
3321N/A STAFCmdParamsList=[]
3321N/A STAFCmdParams=''
3321N/A
3321N/A if dsPath:
3321N/A dsBinPath='%s/%s' % (dsPath,fileFolder)
3327N/A STAFCmd='%s/dsjavaproperties%s' % (dsBinPath,fileExt)
3321N/A
3327N/A if Version:
3327N/A STAFCmdParamsList.append('-V')
3327N/A
3327N/A if Quiet:
3327N/A STAFCmdParamsList.append('-Q')
3327N/A
3327N/A if Help:
3321N/A STAFCmdParamsList.append('-H')
3327N/A
3321N/A STAFCmdParams=' '.join(STAFCmdParamsList)
3321N/A </script>
3321N/A
3321N/A <call function="'runCommand'">
3321N/A {
3327N/A 'name' : 'dsjavaproperties script',
3321N/A 'command' : STAFCmd,
3321N/A 'arguments' : STAFCmdParams,
3321N/A 'location' : location,
3321N/A 'expectedRC' : expectedRC
3321N/A }
3321N/A </call>
3321N/A
3321N/A <return>STAXResult</return>
3321N/A </sequence>
3327N/A </function>
3648N/A
3648N/A <!-- This function uses manage-account to manage users account-->
3648N/A <function name="manageAccountWithScript">
3648N/A <function-prolog>
3648N/A This function uses manage-account to manage users account
3648N/A </function-prolog>
3648N/A
3648N/A <function-map-args>
3648N/A
3648N/A <function-arg-def name="location"
3648N/A type="optional"
3648N/A default="STAF_REMOTE_HOSTNAME">
3648N/A <function-arg-description>
3648N/A Location of target host
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="hostname" />
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="dsPath"
3648N/A type="optional"
4153N/A default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
3648N/A <function-arg-description>
3648N/A Pathname to installation root
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="filepath" />
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="dsInstanceHost"
3648N/A type="optional"
3648N/A default="STAF_REMOTE_HOSTNAME">
3648N/A <function-arg-description>
3648N/A Directory server hostname or IP address
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="hostname" />
3648N/A </function-arg-def>
3648N/A
3853N/A <function-arg-def name="dsInstanceAdminPort"
3853N/A type="optional"
3853N/A default="DIRECTORY_INSTANCE_ADMIN_PORT">
3648N/A <function-arg-description>
3853N/A Directory server admin port number
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="Port number" />
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="dsInstanceDn" type="required">
3648N/A <function-arg-description>
3648N/A Bind DN
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="DN" />
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="targetDn" type="required">
3648N/A <function-arg-description>
3648N/A Specifies the DN of the user entry for which to get and set password
3648N/A policy state information
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="dn"/>
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="dsInstancePswd" type="required">
3648N/A <function-arg-description>
3648N/A Bind password
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="string" />
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="dsBindPasswordFile" type="optional">
3648N/A <function-arg-description>
3648N/A Bind password file
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="filename"/>
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="subcommand" type="required">
3648N/A <function-arg-description>
3648N/A manage-account subcommand to execute
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="string" />
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="expectedRC" type="optional" default="0">
3648N/A <function-arg-description>
3648N/A Expected return code value. Default value is 0.
3648N/A Wildcard 'noCheck' to not check the RC
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="string" />
3648N/A </function-arg-def>
3648N/A
4618N/A <function-arg-def name="dsHelp" type="optional">
3648N/A <function-arg-description>
3648N/A Help option
3648N/A </function-arg-description>
3648N/A <function-arg-property name="help" value="option"/>
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="dsVersion" type="optional">
3648N/A <function-arg-description>
3648N/A Display Directory Server version information
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="option"/>
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="dsCertNickname" type="optional">
3648N/A <function-arg-description>
3648N/A Nickname of certificate for SSL client authentication
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="string"/>
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="dsKeyStorePath" type="optional">
3648N/A <function-arg-description>
3648N/A Certificate keystore path
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="filename"/>
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="dsSaslOption" type="optional">
3648N/A <function-arg-description>
3648N/A SASL bind options
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="string"/>
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="dsTrustStorePath" type="optional">
3648N/A <function-arg-description>
3648N/A Certificate trust store path
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="filename"/>
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="dsUseStartTLS" type="optional">
3648N/A <function-arg-description>
3648N/A Use StartTLS to secure communication with the server
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="option"/>
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="dsTrustStorePassword" type="optional">
3648N/A <function-arg-description>
3648N/A Certificate trust store PIN
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="string"/>
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="dsTrustStorePasswordFile" type="optional">
3648N/A <function-arg-description>
3648N/A Certificate trust store PIN file
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="filename"/>
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="dsKeyStorePasswordFile" type="optional">
3648N/A <function-arg-description>
3648N/A Certificate keystore PIN file
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="filename"/>
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="dsKeyStorePassword" type="optional">
3648N/A <function-arg-description>
3648N/A Certificate keystore PIN
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="string"/>
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="dsUseSSL" type="optional">
3648N/A <function-arg-description>
3648N/A Use SSL for secure communication with the server
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="option"/>
3648N/A </function-arg-def>
3648N/A
3648N/A <function-arg-def name="dsTrustAll" type="optional">
3648N/A <function-arg-description>
3648N/A Trust all server SSL certificates
3648N/A </function-arg-description>
3648N/A <function-arg-property name="type" value="option"/>
3648N/A </function-arg-def>
3707N/A
3707N/A <function-arg-def name="dsOperationValue" type="optional">
3707N/A <function-arg-description>
3707N/A dsOperationValue is true or false
3707N/A </function-arg-description>
3707N/A <function-arg-property name="type" value="boolean"/>
4865N/A </function-arg-def>
3648N/A
3648N/A </function-map-args>
3648N/A
3648N/A <sequence>
3648N/A
3648N/A <!-- Build the Command -->
3648N/A <script>
3648N/A STAFCmdParamsList=[]
3648N/A STAFCmdParams=''
3648N/A
3648N/A if dsPath:
3648N/A dsBinPath='%s/%s' % (dsPath,fileFolder)
3648N/A STAFCmd='%s/manage-account%s' % (dsBinPath,fileExt)
3648N/A
3648N/A STAFCmdParamsList.append(subcommand)
3648N/A
3648N/A if targetDn:
3648N/A STAFCmdParamsList.append('-b "%s"' % targetDn)
3648N/A
3648N/A if dsInstanceHost:
3648N/A STAFCmdParamsList.append('-h %s' % dsInstanceHost)
3648N/A
3648N/A if dsInstanceDn:
3648N/A STAFCmdParamsList.append('-D "%s"' % dsInstanceDn)
3648N/A
3648N/A if dsInstancePswd:
3648N/A STAFCmdParamsList.append('-w %s' % dsInstancePswd)
3648N/A
3648N/A if dsHelp:
3648N/A STAFCmdParamsList.append('-H')
3648N/A
3648N/A if dsBindPasswordFile:
3648N/A STAFCmdParamsList.append('-j %s' % dsBindPasswordFile)
3648N/A
3648N/A if dsKeyStorePath:
3648N/A STAFCmdParamsList.append('-K %s' % dsKeyStorePath)
3648N/A
3648N/A if dsCertNickname:
3648N/A STAFCmdParamsList.append('-N %s' % dsCertNickname)
3648N/A
3648N/A if dsSaslOption:
3648N/A STAFCmdParamsList.append('-o %s' % dsSaslOption)
3648N/A
3853N/A if dsInstanceAdminPort:
3853N/A STAFCmdParamsList.append('-p %s' % dsInstanceAdminPort)
3853N/A STAFCmdParamsList.append('-X')
3853N/A
3648N/A if dsTrustStorePath:
3648N/A STAFCmdParamsList.append('-P %s' % dsTrustStorePath)
3648N/A
3648N/A if dsUseStartTLS:
3648N/A STAFCmdParamsList.append('-q')
3648N/A
3648N/A if dsTrustStorePassword:
3648N/A STAFCmdParamsList.append('--trustStorePassword %s' % dsTrustStorePassword)
3648N/A
3648N/A if dsTrustStorePasswordFile:
3648N/A STAFCmdParamsList.append('-U %s' % dsTrustStorePasswordFile)
3648N/A
3648N/A if dsKeyStorePasswordFile:
3648N/A STAFCmdParamsList.append('-u %s' % dsKeyStorePasswordFile)
3648N/A
3648N/A if dsVersion:
3648N/A STAFCmdParamsList.append('-V')
3648N/A
3648N/A if dsKeyStorePassword:
3648N/A STAFCmdParamsList.append('-W %s' % dsKeyStorePassword)
3853N/A
3648N/A if dsUseSSL:
3648N/A STAFCmdParamsList.append('-Z')
3707N/A
3707N/A if dsOperationValue:
3707N/A STAFCmdParamsList.append('-O %s' % dsOperationValue)
3648N/A
3648N/A STAFCmdParams=' '.join(STAFCmdParamsList)
3648N/A </script>
3648N/A
3648N/A <call function="'runCommand'" >
3648N/A { 'name' : 'Manage-account script',
3648N/A 'command' : STAFCmd,
3648N/A 'arguments' : STAFCmdParams,
3648N/A 'location' : location,
3648N/A 'expectedRC': expectedRC
3648N/A }
3648N/A </call>
3648N/A <return>
3648N/A STAXResult
3648N/A </return>
3648N/A </sequence>
3648N/A </function>
4616N/A
4616N/A
3648N/A
4616N/A <function name="verifyReplication">
4616N/A <function-prolog>
4616N/A This function verifies that replication is working, that is, the updates
4616N/A done on any of the servers in the topology are being pushed to the other
4616N/A servers.
4616N/A </function-prolog>
4616N/A <function-list-args>
4616N/A <function-arg-def name="serverList" type="required">
4616N/A <function-arg-description>
4616N/A List of the servers to verify against the referenceServer.
4616N/A </function-arg-description>
4616N/A <function-arg-property name="type" value="Server-list"/>
4616N/A </function-arg-def>
4616N/A
4616N/A <function-arg-def name="replicatedSuffix" type="required">
4616N/A <function-arg-description>
4616N/A Suffix of the tree to verify.
4616N/A </function-arg-description>
4616N/A <function-arg-property name="type" value="DN"/>
4616N/A </function-arg-def>
4616N/A
4616N/A <function-arg-def name="knownIssue" type="optional" default="None">
4616N/A <function-arg-description>
4616N/A Known issue. Corresponds to an issue number.
4616N/A </function-arg-description>
4616N/A </function-arg-def>
4616N/A
4616N/A </function-list-args>
4616N/A <sequence>
4616N/A
4616N/A <message>
4616N/A 'verifyReplication: Verify updates on the suffix %s are being \
4616N/A replicated.' % replicatedSuffix
4616N/A </message>
4616N/A
4616N/A <iterate var="server" in="serverList" indexvar="i">
4616N/A <sequence>
4616N/A
4616N/A <script>
4616N/A serverHost = server.getHostname()
4616N/A serverPath = '%s/%s' % (server.getDir(), OPENDSNAME)
4616N/A otherServersList = serverList[:i] + serverList[i+1:]
4616N/A entryDn = 'uid=testentry-%s, %s' % (i, replicatedSuffix)
4616N/A
4616N/A myRC = 0
4616N/A myKnownIssue = knownIssue
4616N/A failedServers = STAXGlobal( [] )
4616N/A failingServerList = ''
4616N/A </script>
4616N/A
4616N/A <!-- Add entry to one of the other servers -->
4616N/A <script>
4616N/A listAttr = []
4616N/A listAttr.append('objectclass:top')
4616N/A listAttr.append('objectclass:organizationalperson')
4616N/A listAttr.append('objectclass:inetorgperson')
4616N/A listAttr.append('objectclass:person')
4616N/A listAttr.append('givenname:Test-%s' % i)
4616N/A listAttr.append('sn:Entry-%s' % i)
4616N/A listAttr.append('cn:Test Entry - %s' % i)
4616N/A </script>
4616N/A
4616N/A <message>
4616N/A 'verifyReplication: Add entry %s to server %s:%s' % \
4616N/A (entryDn, serverHost, server.getPort())
4616N/A </message>
4616N/A
4616N/A <call function="'addAnEntry'">
4616N/A { 'location' : serverHost,
4616N/A 'dsPath' : serverPath,
4616N/A 'dsInstanceHost' : serverHost,
4616N/A 'dsInstancePort' : server.getPort(),
4616N/A 'dsInstanceDn' : server.getRootDn(),
4616N/A 'dsInstancePswd' : server.getRootPwd(),
4616N/A 'DNToAdd' : entryDn,
4616N/A 'listAttributes' : listAttr
4616N/A }
4616N/A </call>
4616N/A
4616N/A <call function="'Sleep'">
4616N/A { 'sleepForMilliSeconds' : 2000 }
4865N/A </call>
4616N/A
4616N/A <!-- Check the update has been propagated -->
4616N/A <paralleliterate var="otherServer" in="otherServersList">
4616N/A <sequence>
4616N/A <call function="'ldapSearchWithScript'">
4616N/A { 'location' : otherServer.getHostname(),
4616N/A 'dsPath' : '%s/%s' \
4616N/A % (otherServer.getDir(), OPENDSNAME),
4616N/A 'dsInstanceHost' : otherServer.getHostname(),
4616N/A 'dsInstancePort' : otherServer.getPort(),
4616N/A 'dsInstanceDn' : otherServer.getRootDn(),
4616N/A 'dsInstancePswd' : otherServer.getRootPwd(),
4616N/A 'dsBaseDN' : entryDn,
4616N/A 'dsFilter' : 'objectclass=*',
4616N/A 'logStderr' : False
4616N/A }
4865N/A </call>
4616N/A <script>
4865N/A searchRC = RC
4616N/A searchResult = STAXResult[0][1]
4616N/A resultLength = len(searchResult) > 0
4616N/A </script>
4616N/A <if expr="resultLength != 0">
4616N/A <sequence>
4616N/A <message>
4616N/A '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
4616N/A % (otherServer.getHostname(), otherServer.getPort(),
4616N/A searchResult)
4616N/A </message>
4616N/A </sequence>
4865N/A <else>
4865N/A <sequence>
4865N/A <message>
4616N/A 'verifyReplication: Entry %s NOT found in server %s:%s' % \
4616N/A (entryDn, otherServer.getHostname(), otherServer.getPort())
4865N/A </message>
4865N/A <script>
4616N/A failedServers.append('%s:%s' % \
4616N/A (otherServer.getHostname(), otherServer.getPort()))
4865N/A </script>
4865N/A </sequence>
4865N/A </else>
4616N/A </if>
4865N/A </sequence>
4616N/A </paralleliterate>
4616N/A
4616N/A <if expr="len(failedServers) > 0">
4616N/A <!-- If at least one server failed to receive the update return an
4616N/A ! error, along with the list of the servers that failed to do so
4616N/A -->
4616N/A <script>
4616N/A myRC = 1
4616N/A comma = ','
4616N/A failingServerList = \
4616N/A 'List of non-synchronized servers (replication verify FAILED \
4616N/A for entry %s): %s ' % (entryDn, comma.join(failedServers))
4616N/A </script>
4616N/A <else>
4616N/A <message>
4616N/A 'All servers synchronized (replication verify SUCCEEDED for \
4616N/A entry %s)' % entryDn
4616N/A </message>
4616N/A </else>
4616N/A </if>
4616N/A <call function="'checktestRC'">
4616N/A { 'returncode' : myRC,
4616N/A 'result' : failingServerList,
4616N/A 'expected' : 0,
4616N/A 'issue' : myKnownIssue
4616N/A }
4865N/A </call>
5047N/A
5047N/A <!-- Remove footprint: delete the entry just added -->
5047N/A <call function="'ldapDeleteWithScript'">
5047N/A { 'location' : serverHost,
5047N/A 'dsPath' : serverPath,
5047N/A 'dsInstanceHost' : serverHost,
5047N/A 'dsInstancePort' : server.getPort(),
5047N/A 'dsInstanceDn' : server.getRootDn(),
5047N/A 'dsInstancePswd' : server.getRootPwd(),
5047N/A 'dsDn' : [entryDn]
5047N/A }
5047N/A </call>
4865N/A </sequence>
4865N/A </iterate>
4616N/A
4616N/A </sequence>
4616N/A </function>
4616N/A
4616N/A
2788N/A</stax>
4153N/A