| | |
| | | </call> |
| | | <return>STAXResult</return> |
| | | </sequence> |
| | | </function> |
| | | </function> |
| | | |
| | | |
| | | <!-- This function uses make ldif to generate LDIF data files --> |
| | |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="startFrom" |
| | | <function-arg-def name="startFrom" |
| | | type="optional" |
| | | default="0"> |
| | | <function-arg-description> |
| | |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="suffix" |
| | | <function-arg-def name="suffix" |
| | | type="optional" |
| | | default="DIRECTORY_INSTANCE_SFX"> |
| | | <function-arg-description> |
| | |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filename"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="additionalAttributes" |
| | | <function-arg-def name="additionalAttributes" |
| | | type="optional" |
| | | default="False"> |
| | | <function-arg-description> |
| | |
| | | <return>[RC, STAXResult]</return> |
| | | |
| | | </sequence> |
| | | </function> |
| | | </function> |
| | | |
| | | <!-- This function compares two LDIF files using the ldif-diff script --> |
| | | <function name="LdifDiffWithScript"> |
| | |
| | | Help option |
| | | </function-arg-description> |
| | | <function-arg-property name="help" value="option"/> |
| | | </function-arg-def> |
| | | </function-arg-def> |
| | | |
| | | </function-map-args> |
| | | <sequence> |
| | |
| | | </script> |
| | | <message log="1"> 'LdifDiffWithScript: %s' % msg </message> |
| | | <if expr="diffsFileSize < MAX_READABLE_SIZE"> |
| | | <sequence> |
| | | <sequence> |
| | | <call function="'getFile'"> |
| | | { 'location' : location, |
| | | 'filename' : outputLdif |
| | |
| | | LDIF file containing the changes to apply |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </function-arg-def> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="Help" type="optional"> |
| | | <function-arg-description> |
| | |
| | | </function-arg-def> |
| | | |
| | | </function-list-args> |
| | | <sequence> |
| | | <sequence> |
| | | <script> |
| | | myRC = 0 |
| | | myKnownIssue = knownIssue |
| | |
| | | 'dsPath' : dsPath, |
| | | 'dsInstanceHost' : referenceServer.getHostname(), |
| | | 'dsInstanceAdminPort' : referenceServer.getAdminPort(), |
| | | 'replicationDnList' : [synchroSuffix], |
| | | 'replicationDnList' : [treeSuffix], |
| | | 'noOfLoops' : 10, |
| | | 'noOfMilliSeconds' : 6000 |
| | | } |
| | |
| | | % (treeSuffix, referenceServerPath) |
| | | </message> |
| | | <!-- Retrieve the tree from the reference server --> |
| | | <call function="'exportLdif'"> |
| | | <call function="'exportLdifWithScript'"> |
| | | { 'location' : location, |
| | | 'dsPath' : dsPath, |
| | | 'dsInstanceHost' : referenceServer.getHostname(), |
| | | 'dsInstanceAdminPort' : referenceServer.getAdminPort(), |
| | | 'dsInstanceDn' : referenceServer.getRootDn(), |
| | | 'dsInstancePswd' : referenceServer.getRootPwd(), |
| | | 'ldifFile' : '%s/../%s' % (dsPath, referenceTree) |
| | | 'ldifFile' : '%s/../%s' % (dsPath, referenceTree), |
| | | 'includeBranches' : [treeSuffix] |
| | | } |
| | | </call> |
| | | |
| | |
| | | </script> |
| | | </else> |
| | | </if> |
| | | <call function="'exportLdif'"> |
| | | <call function="'exportLdifWithScript'"> |
| | | { 'location' : location, |
| | | 'dsPath' : dsPath, |
| | | 'dsInstanceHost' : server.getHostname(), |
| | | 'dsInstanceAdminPort' : server.getAdminPort(), |
| | | 'dsInstanceDn' : server.getRootDn(), |
| | | 'dsInstancePswd' : server.getRootPwd(), |
| | | 'ldifFile' : '%s/../%s' % (filePath, sampleTree) |
| | | 'ldifFile' : '%s/../%s' % (filePath, sampleTree), |
| | | 'includeBranches' : [treeSuffix] |
| | | } |
| | | </call> |
| | | |
| | | <if expr="RC == 0"> |
| | | <sequence> |
| | | |
| | | <if expr="not isSameLocation"> |
| | | <if expr="not isSameLocation"> |
| | | <!-- Copy sample tree file to reference server --> |
| | | <call function="'copyFile'"> |
| | | { 'location' : server.getHostname(), |
| | |
| | | </call> |
| | | <if expr="STAXResult != 0"> |
| | | <sequence> |
| | | <script> |
| | | <script> |
| | | failedServers.append('%s:%s' % \ |
| | | (server.getHostname(), server.getPort())) |
| | | </script> |
| | |
| | | <script> |
| | | if STAXResult != 0 : |
| | | failedServers.append('%s:%s' % (server.getHostname(), server.getPort())) |
| | | </script> |
| | | </script> |
| | | </sequence> |
| | | </iterate> |
| | | <if expr="len(failedServers) > 0"> |
| | |
| | | <function-prolog> |
| | | This function starts a list of servers. |
| | | </function-prolog> |
| | | <function-list-args> |
| | | <function-list-args> |
| | | <function-arg-def name="serverList" type="required"> |
| | | <function-arg-description> |
| | | List of the servers (instances of "Server" class) to be started. |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Server-list"/> |
| | | </function-arg-def> |
| | | </function-arg-def> |
| | | </function-list-args> |
| | | |
| | | <sequence> |
| | |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Server-list"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="noOfLoops" |
| | | type="optional" |
| | | default="10"> |
| | | <function-arg-description> |
| | | Number of iterations (for isStopped()) |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="integer"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="noOfMilliSeconds" |
| | | type="optional" |
| | | default="2000"> |
| | | <function-arg-description> |
| | | Number of seconds to wait between iterations (for isStopped()) |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="seconds"/> |
| | | </function-arg-def> |
| | | </function-list-args> |
| | | |
| | | <sequence> |
| | |
| | | |
| | | <!--- Stop DS --> |
| | | <call function="'StopDsWithScript'"> |
| | | { 'location' : server.getHostname(), |
| | | 'dsHost' : server.getHostname(), |
| | | 'dsPath' : '%s/%s' % (server.getDir(),OPENDSNAME), |
| | | 'dsAdminPort' : server.getAdminPort(), |
| | | 'dsBindDN' : server.getRootDn(), |
| | | 'dsBindPwd' : server.getRootPwd() |
| | | { 'location' : server.getHostname(), |
| | | 'dsHost' : server.getHostname(), |
| | | 'dsPath' : '%s/%s' % (server.getDir(),OPENDSNAME), |
| | | 'dsAdminPort' : server.getAdminPort(), |
| | | 'dsBindDN' : server.getRootDn(), |
| | | 'dsBindPwd' : server.getRootPwd(), |
| | | 'noOfLoops' : noOfLoops, |
| | | 'noOfMilliSeconds' : noOfMilliSeconds |
| | | } |
| | | </call> |
| | | </sequence> |
| | |
| | | The baseDN for the search operation |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="dn"/> |
| | | </function-arg-def> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsFilterFile" type="optional"> |
| | | <function-arg-description> |
| | | File containing a list of search filter strings |
| | |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filename"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsOverwriteExisting" |
| | | <function-arg-def name="dsOverwriteExisting" |
| | | type="optional" |
| | | default="True"> |
| | | <function-arg-description> |
| | |
| | | The scope of the search operation |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="option"/> |
| | | </function-arg-def> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsTimeLimit" type="optional"> |
| | | <function-arg-description> |
| | | Maximum length of time in seconds to allow for the search |
| | |
| | | Expected return code value. Default value is 0 |
| | | Wildcard 'noCheck' to not check the RC |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="integer"/> |
| | | </function-arg-def> |
| | | <function-arg-property name="type" value="integer"/> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | <!-- Build the Command --> |
| | |
| | | Pathname to installation root |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </function-arg-def> |
| | | </function-arg-def> |
| | | <function-arg-def name="authPwdSyntax" type="optional"> |
| | | <function-arg-description> |
| | | Use the authentication password syntax. |
| | |
| | | encoding a clear-text password. |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="option"/> |
| | | </function-arg-def> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsHelp" type="optional"> |
| | | <function-arg-description> |
| | | Display this usage information |
| | |
| | | Expected return code value. Default value is 0. |
| | | Wildcard 'noCheck' to not check the RC |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="integer"/> |
| | | <function-arg-property name="type" value="integer"/> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | |
| | | <return>STAXResult</return> |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <!-- This function check task execution--> |
| | | <function name="checkTaskExecution" scope="local"> |
| | | <function-prolog> |
| | | This functioncheck task execution |
| | | </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_BIN,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="outputToCheck" type="required"> |
| | | <function-arg-description> |
| | | The output result of the task |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsInstanceDn" type="required"> |
| | | <function-arg-description> |
| | | Bind DN |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="DN" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsInstanceAdminPort" |
| | | type="optional" |
| | | default="DIRECTORY_INSTANCE_ADMIN_PORT"> |
| | | <function-arg-description> |
| | | Directory server admin port number |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Port number" /> |
| | | </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="dsInstancePswd" type="required"> |
| | | <function-arg-description> |
| | | Bind password |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string" /> |
| | | </function-arg-def> |
| | | |
| | | </function-map-args> |
| | | <sequence> |
| | | <script> |
| | | resultString = outputToCheck |
| | | resultSplitted = resultString.split() |
| | | taskId = None |
| | | for str in resultSplitted: |
| | | if len(str) == 17: |
| | | taskId = str |
| | | </script> |
| | | |
| | | <message> |
| | | 'Command task Id : %s' % taskId |
| | | </message> |
| | | |
| | | <message> |
| | | 'Check ldif command successfully completed with manage-task' |
| | | </message> |
| | | |
| | | <script>checkRC=9999</script> |
| | | <loop from="1" to="10" var="loop" while="checkRC != 0"> |
| | | <sequence> |
| | | <message>'LOOP %s' % loop</message> |
| | | <call function="'manage-tasks'"> |
| | | { |
| | | 'dsPath' : dsPath, |
| | | 'dsInstanceHost' : dsInstanceHost , |
| | | 'dsInstanceAdminPort' : dsInstanceAdminPort, |
| | | 'dsInstanceDn' : dsInstanceDn , |
| | | 'dsInstancePswd' : dsInstancePswd , |
| | | 'dsInfo' : taskId , |
| | | 'dsQuiet' : 'True' |
| | | } |
| | | </call> |
| | | |
| | | <script> |
| | | returnString = STAXResult[0][1] |
| | | msg = 'Status Completed successfully' |
| | | </script> |
| | | |
| | | <call function="'searchString'"> |
| | | { |
| | | 'expectedString' : msg , |
| | | 'returnString' : returnString , |
| | | 'expectedRC' : 'noCheck' |
| | | } |
| | | </call> |
| | | |
| | | <script> |
| | | checkRC = STAXResult[0] |
| | | </script> |
| | | |
| | | <call function="'Sleep'"> |
| | | { 'sleepForMilliSeconds' : 2000 } |
| | | </call> |
| | | |
| | | </sequence> |
| | | </loop> |
| | | |
| | | <call function="'checktestRC'"> |
| | | { 'returncode' : checkRC , |
| | | 'result' : "Task succeeds" , |
| | | 'expected' : 0 |
| | | } |
| | | </call> |
| | | </sequence> |
| | | </function> |
| | | |
| | | <!-- This function compares two LDIF files using the ldif-diff script --> |
| | | <function name="LdifDiffWithScript-new" scope="local"> |
| | |
| | | Location of target host |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname"/> |
| | | </function-arg-def> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsPath" |
| | | type="optional" |
| | | default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)"> |
| | |
| | | Pathname to installation root |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </function-arg-def> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsVersion" type="optional"> |
| | | <function-arg-description> |
| | | Display Directory Server version information |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="option"/> |
| | | </function-arg-def> |
| | | </function-arg-def> |
| | | <function-arg-def name="sourceLdif" type="required"> |
| | | <function-arg-description> |
| | | LDIF file to use as the source data |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </function-arg-def> |
| | | </function-arg-def> |
| | | <function-arg-def name="targetLdif" type="required"> |
| | | <function-arg-description> |
| | | LDIF file to use as the target data |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </function-arg-def> |
| | | </function-arg-def> |
| | | <function-arg-def name="outputLdif" type="required"> |
| | | <function-arg-description> |
| | | File to which the diffs should be written |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </function-arg-def> |
| | | </function-arg-def> |
| | | <function-arg-def name="overwriteExisting" type="optional" default="True"> |
| | | <function-arg-description> |
| | | Overwrite existing output file rather than append to it |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="option"/> |
| | | </function-arg-def> |
| | | </function-arg-def> |
| | | <function-arg-def name="singleValueChanges" type="optional"> |
| | | <function-arg-description> |
| | | Write each attribute-level change as a separate modification |
| | | per attribute value rather than one modification per entry |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="option"/> |
| | | </function-arg-def> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsHelp" type="optional"> |
| | | <function-arg-description> |
| | | Help option |
| | |
| | | Expected return code value. Default value is 0. |
| | | Wildcard 'noCheck' to not check the RC |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="integer"/> |
| | | </function-arg-def> |
| | | <function-arg-property name="type" value="integer"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="knownIssue" type="optional" default="None"> |
| | | <function-arg-description> |
| | | Known issue. Corresponds to an issue number. |
| | |
| | | Location of target host |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname"/> |
| | | </function-arg-def> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsPath" |
| | | type="optional" |
| | | default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)"> |
| | |
| | | dsOperationValue is true or false |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="boolean"/> |
| | | </function-arg-def> |
| | | </function-arg-def> |
| | | |
| | | </function-map-args> |
| | | |
| | |
| | | |
| | | <call function="'Sleep'"> |
| | | { 'sleepForMilliSeconds' : 2000 } |
| | | </call> |
| | | </call> |
| | | |
| | | <!-- Check the update has been propagated --> |
| | | <paralleliterate var="otherServer" in="otherServersList"> |
| | |
| | | 'dsAttributes' : 'employeeNumber', |
| | | 'logStderr' : False |
| | | } |
| | | </call> |
| | | </call> |
| | | <script> |
| | | searchRC = STAXResult[0][0] |
| | | searchRC = RC |
| | | searchResult = STAXResult[0][1] |
| | | resultLength = len(searchResult) > 0 |
| | | </script> |
| | |
| | | searchResult) |
| | | </message> |
| | | </sequence> |
| | | <else> |
| | | <sequence> |
| | | <message> |
| | | <else> |
| | | <sequence> |
| | | <message> |
| | | 'verifyReplication: Entry %s NOT found in server %s:%s' % \ |
| | | (entryDn, otherServer.getHostname(), otherServer.getPort()) |
| | | </message> |
| | | <script> |
| | | </message> |
| | | <script> |
| | | failedServers.append('%s:%s' % \ |
| | | (otherServer.getHostname(), otherServer.getPort())) |
| | | </script> |
| | | </sequence> |
| | | </else> |
| | | </script> |
| | | </sequence> |
| | | </else> |
| | | </if> |
| | | </sequence> |
| | | </sequence> |
| | | </paralleliterate> |
| | | |
| | | <if expr="len(failedServers) > 0"> |
| | |
| | | 'expected' : 0, |
| | | 'issue' : myKnownIssue |
| | | } |
| | | </call> |
| | | </call> |
| | | |
| | | </sequence> |
| | | </iterate> |
| | | </sequence> |
| | | </iterate> |
| | | |
| | | </sequence> |
| | | </function> |