| | |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="outputFile" type="optional" default="'None'"> |
| | | <function-arg-description> |
| | | Output file containing the command output |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="file"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="outputPath" type="optional"> |
| | | <function-arg-description> |
| | | Path containing the outputFile |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | |
| | | <sequence> |
| | |
| | | Known issue. Corresponds to an issue number. |
| | | </function-arg-description> |
| | | </function-arg-def> |
| | | <function-arg-def name="outputFile" type="optional" default="'None'"> |
| | | <function-arg-description> |
| | | Output file containing the command output |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="file"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="outputPath" type="optional"> |
| | | <function-arg-description> |
| | | Path containing the outputFile |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | <!-- Local variables --> |
| | |
| | | |
| | | STAFCmdParams=' '.join(STAFCmdParamsList) |
| | | </script> |
| | | <call function="'runCommand'"> |
| | | { 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : mylocation, |
| | | 'name' : 'authrate', |
| | | 'expectedRC' : expectedRC, |
| | | 'knownIssue' : knownIssue |
| | | } |
| | | </call> |
| | | <if expr="outputFile != 'None'"> |
| | | <call function="'runCommand'" > |
| | | { 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : location, |
| | | 'name' : 'authrate', |
| | | 'outputFile': '%s/%s' % (outputPath, outputFile), |
| | | 'expectedRC': expectedRC, |
| | | 'knownIssue': knownIssue |
| | | } |
| | | </call> |
| | | <else> |
| | | <call function="'runCommand'"> |
| | | { 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : mylocation, |
| | | 'name' : 'authrate', |
| | | 'expectedRC' : expectedRC, |
| | | 'knownIssue' : knownIssue |
| | | } |
| | | </call> |
| | | </else> |
| | | </if> |
| | | |
| | | <script> |
| | | for line in STAXResult[0][1].split('\n'): |
| | |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="dn"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="outputFile" type="optional" default="'None'"> |
| | | <function-arg-description> |
| | | Output file containing the command output |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="file"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="outputPath" type="optional"> |
| | | <function-arg-description> |
| | | Path containing the outputFile |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | <!-- Local variables --> |
| | |
| | | |
| | | STAFCmdParams=' '.join(STAFCmdParamsList) |
| | | </script> |
| | | <call function="'runCommand'"> |
| | | { 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : mylocation, |
| | | 'name' : 'searchrate', |
| | | 'expectedRC' : expectedRC, |
| | | 'knownIssue' : knownIssue |
| | | } |
| | | </call> |
| | | <if expr="outputFile != 'None'"> |
| | | <call function="'runCommand'" > |
| | | { 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : location, |
| | | 'name' : 'searchrate', |
| | | 'outputFile': '%s/%s' % (outputPath, outputFile), |
| | | 'expectedRC': expectedRC, |
| | | 'knownIssue': knownIssue |
| | | } |
| | | </call> |
| | | <else> |
| | | <call function="'runCommand'"> |
| | | { 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : mylocation, |
| | | 'name' : 'searchrate', |
| | | 'expectedRC' : expectedRC, |
| | | 'knownIssue' : knownIssue |
| | | } |
| | | </call> |
| | | </else> |
| | | </if> |
| | | |
| | | <script> |
| | | for line in STAXResult[0][1].split('\n'): |
| | |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="outputFile" type="optional" default="'None'"> |
| | | <function-arg-description> |
| | | Output file containing the command output |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="file"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="outputPath" type="optional"> |
| | | <function-arg-description> |
| | | Path containing the outputFile |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | <!-- Local variables --> |
| | |
| | | |
| | | STAFCmdParams=' '.join(STAFCmdParamsList) |
| | | </script> |
| | | <call function="'runCommand'"> |
| | | { 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : mylocation, |
| | | 'name' : 'modrate', |
| | | 'expectedRC' : expectedRC, |
| | | 'knownIssue' : knownIssue |
| | | } |
| | | </call> |
| | | <if expr="outputFile != 'None'"> |
| | | <call function="'runCommand'" > |
| | | { 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : location, |
| | | 'name' : 'modrate', |
| | | 'outputFile': '%s/%s' % (outputPath, outputFile), |
| | | 'expectedRC': expectedRC, |
| | | 'knownIssue': knownIssue |
| | | } |
| | | </call> |
| | | <else> |
| | | <call function="'runCommand'"> |
| | | { 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : mylocation, |
| | | 'name' : 'modrate', |
| | | 'expectedRC' : expectedRC, |
| | | 'knownIssue' : knownIssue |
| | | } |
| | | </call> |
| | | </else> |
| | | </if> |
| | | |
| | | <script> |
| | | for line in STAXResult[0][1].split('\n'): |
| | |
| | | </sequence> |
| | | </function> |
| | | |
| | | <function name="addRate"> |
| | | <function-prolog> |
| | | This function runs ldap searchrate tool from OpenDJ SDK |
| | | </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="sdkBinPath" type="optional" default="'%s' % SDK_BIN"> |
| | | <function-arg-description> |
| | | Pathname to installation of sdk binaries |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </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="dsInstanceHost" type="optional"> |
| | | <function-arg-description> |
| | | Directory server hostname or IP address |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsInstancePort" type="optional"> |
| | | <function-arg-description> |
| | | Directory server port number |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Port number"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsInstanceDn" type="optional"> |
| | | <function-arg-description> |
| | | Bind DN |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="DN"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsInstancePswd" type="optional"> |
| | | <function-arg-description> |
| | | Bind password |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="extraParams" type="optional"> |
| | | <function-arg-description> |
| | | Optional extra parameters for specific test cases |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="expectedRC" type="optional" default="0"> |
| | | <function-arg-description> |
| | | Expected return code value. Default value is 0 |
| | | Wildcard 'noCheck' to not check the RC |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="integer"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="verbose" type="optional" default="True"> |
| | | <function-arg-description> |
| | | Display (or not) output. |
| | | </function-arg-description> |
| | | <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. |
| | | </function-arg-description> |
| | | </function-arg-def> |
| | | <function-arg-def name="templateFile" type="optional"> |
| | | <function-arg-description> |
| | | The template file |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="dn"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="outputFile" type="optional" default="'None'"> |
| | | <function-arg-description> |
| | | Output file containing the command output |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="file"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="outputPath" type="optional"> |
| | | <function-arg-description> |
| | | Path containing the outputFile |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | <!-- Local variables --> |
| | | <script> |
| | | mylocation=location |
| | | </script> |
| | | |
| | | <!-- Build the Command --> |
| | | <script> |
| | | STAFCmdParamsList=[] |
| | | STAFCmdParams='' |
| | | |
| | | if dsPath: |
| | | dsBinPath='%s/%s' % (dsPath,fileFolder) |
| | | |
| | | STAFCmd='%s/addrate%s' % (sdkBinPath,fileExt) |
| | | </script> |
| | | |
| | | <!-- Set common ldap arguments --> |
| | | <call function="'_ldapCommonArgs'" /> |
| | | |
| | | <script> |
| | | if templateFile: |
| | | STAFCmdParamsList.append('-l %s' % templateFile) |
| | | |
| | | if extraParams: |
| | | STAFCmdParamsList.append('%s' % extraParams) |
| | | |
| | | STAFCmdParams=' '.join(STAFCmdParamsList) |
| | | </script> |
| | | <if expr="outputFile != 'None'"> |
| | | <call function="'runCommand'" > |
| | | { 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : location, |
| | | 'name' : 'addrate', |
| | | 'outputFile': '%s/%s' % (outputPath, outputFile), |
| | | 'expectedRC': expectedRC, |
| | | 'knownIssue': knownIssue |
| | | } |
| | | </call> |
| | | <else> |
| | | <call function="'runCommand'"> |
| | | { 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : mylocation, |
| | | 'name' : 'addrate', |
| | | 'expectedRC' : expectedRC, |
| | | 'knownIssue' : knownIssue |
| | | } |
| | | </call> |
| | | </else> |
| | | </if> |
| | | |
| | | <script> |
| | | for line in STAXResult[0][1].split('\n'): |
| | | print line |
| | | </script> |
| | | |
| | | <return> |
| | | STAXResult |
| | | </return> |
| | | </sequence> |
| | | </function> |
| | | |
| | | <function name="delRate"> |
| | | <function-prolog> |
| | | This function runs ldap delrate tool from OpenDJ SDK |
| | | </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="sdkBinPath" type="optional" default="'%s' % SDK_BIN"> |
| | | <function-arg-description> |
| | | Pathname to installation of sdk binaries |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </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="dsInstanceHost" type="optional"> |
| | | <function-arg-description> |
| | | Directory server hostname or IP address |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsInstancePort" type="optional"> |
| | | <function-arg-description> |
| | | Directory server port number |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Port number"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsInstanceDn" type="optional"> |
| | | <function-arg-description> |
| | | Bind DN |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="DN"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsInstancePswd" type="optional"> |
| | | <function-arg-description> |
| | | Bind password |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="extraParams" type="optional"> |
| | | <function-arg-description> |
| | | Optional extra parameters for specific test cases |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="expectedRC" type="optional" default="0"> |
| | | <function-arg-description> |
| | | Expected return code value. Default value is 0 |
| | | Wildcard 'noCheck' to not check the RC |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="integer"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="verbose" type="optional" default="True"> |
| | | <function-arg-description> |
| | | Display (or not) output. |
| | | </function-arg-description> |
| | | <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. |
| | | </function-arg-description> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsBaseDN" type="optional"> |
| | | <function-arg-description> |
| | | The baseDN for the search operation |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="dn"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="outputFile" type="optional" default="'None'"> |
| | | <function-arg-description> |
| | | Output file containing the command output |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="file"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="outputPath" type="optional"> |
| | | <function-arg-description> |
| | | Path containing the outputFile |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | <!-- Local variables --> |
| | | <script> |
| | | mylocation=location |
| | | </script> |
| | | |
| | | <!-- Build the Command --> |
| | | <script> |
| | | STAFCmdParamsList=[] |
| | | STAFCmdParams='' |
| | | |
| | | if dsPath: |
| | | dsBinPath='%s/%s' % (dsPath,fileFolder) |
| | | |
| | | STAFCmd='%s/delrate%s' % (sdkBinPath,fileExt) |
| | | </script> |
| | | |
| | | <!-- Set common ldap arguments --> |
| | | <call function="'_ldapCommonArgs'" /> |
| | | |
| | | <script> |
| | | if dsBaseDN: |
| | | STAFCmdParamsList.append('-b %s' % dsBaseDN) |
| | | |
| | | if extraParams: |
| | | STAFCmdParamsList.append('%s' % extraParams) |
| | | |
| | | STAFCmdParams=' '.join(STAFCmdParamsList) |
| | | </script> |
| | | <if expr="outputFile != 'None'"> |
| | | <call function="'runCommand'" > |
| | | { 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : location, |
| | | 'name' : 'delrate', |
| | | 'outputFile': '%s/%s' % (outputPath, outputFile), |
| | | 'expectedRC': expectedRC, |
| | | 'knownIssue': knownIssue |
| | | } |
| | | </call> |
| | | <else> |
| | | <call function="'runCommand'"> |
| | | { 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : mylocation, |
| | | 'name' : 'delrate', |
| | | 'expectedRC' : expectedRC, |
| | | 'knownIssue' : knownIssue |
| | | } |
| | | </call> |
| | | </else> |
| | | </if> |
| | | |
| | | <script> |
| | | for line in STAXResult[0][1].split('\n'): |
| | | print line |
| | | </script> |
| | | |
| | | <return> |
| | | STAXResult |
| | | </return> |
| | | </sequence> |
| | | </function> |
| | | |
| | | <function name="LdifDiffSdk"> |
| | | <function-prolog> |
| | | This function runs ldap delrate tool from OpenDJ SDK |
| | | </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="sdkBinPath" type="optional" default="'%s' % SDK_BIN"> |
| | | <function-arg-description> |
| | | Pathname to installation of sdk binaries |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </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="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 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 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 name="expectedRC" type="optional" default="0"> |
| | | <function-arg-description> |
| | | 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-def name="knownIssue" type="optional" default="None"> |
| | | <function-arg-description> |
| | | Known issue. Corresponds to an issue number. |
| | | </function-arg-description> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | <!-- Local variables --> |
| | | <script> |
| | | mylocation=location |
| | | </script> |
| | | |
| | | <!-- Build the Command --> |
| | | <script> |
| | | STAFCmdParamsList=[] |
| | | STAFCmdParams='' |
| | | |
| | | if dsPath: |
| | | dsBinPath='%s/%s' % (dsPath,fileFolder) |
| | | |
| | | STAFCmd='%s/ldifdiff%s' % (sdkBinPath,fileExt) |
| | | </script> |
| | | |
| | | <script> |
| | | if outputLdif: |
| | | STAFCmdParamsList.append('-o %s' % outputLdif) |
| | | |
| | | STAFCmdParamsList.append(sourceLdif) |
| | | STAFCmdParamsList.append(targetLdif) |
| | | |
| | | STAFCmdParams=' '.join(STAFCmdParamsList) |
| | | </script> |
| | | |
| | | <call function="'runCommand'"> |
| | | { 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : mylocation, |
| | | 'name' : 'ldifdiff', |
| | | 'expectedRC' : expectedRC, |
| | | 'knownIssue' : knownIssue |
| | | } |
| | | </call> |
| | | |
| | | <script> |
| | | savSTAXResult = STAXResult |
| | | for line in savSTAXResult[0][1].split('\n'): |
| | | print line |
| | | |
| | | if len(savSTAXResult[0][1]) > 0: |
| | | savSTAXResult[0][0] = 1 |
| | | else: |
| | | savSTAXResult[0][0] = 0 |
| | | </script> |
| | | |
| | | <return> |
| | | STAXResult |
| | | </return> |
| | | </sequence> |
| | | </function> |
| | | </stax> |
| | |
| | | <return> diffRC </return> |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <!-- This function modifies an LDIF file using ldifmodify script --> |
| | | <function name="LdifModifyWithScript"> |
| | | <function-prolog> |
| | |
| | | <return>[myRC, failedServers]</return> |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <function name="verifyTreesSdk"> |
| | | <function-prolog> |
| | | This function verifies that the trees in a group of ldap servers are |
| | | synchronized. |
| | | </function-prolog> |
| | | <function-list-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="referenceServer" type="required"> |
| | | <function-arg-description> |
| | | Server that should be taken as reference. |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Server"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="serverList" type="required"> |
| | | <function-arg-description> |
| | | List of the servers to verify against the referenceServer. |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Server-list"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="treeSuffix" type="required"> |
| | | <function-arg-description> |
| | | Suffix of the tree to verify. |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="DN"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="knownIssue" type="optional" default="None"> |
| | | <function-arg-description> |
| | | Known issue. Corresponds to an issue number. |
| | | </function-arg-description> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="ignoreAttrsFile" |
| | | type="optional" |
| | | default="None"> |
| | | <function-arg-description> |
| | | File containing a list of attributes to ignore when computing the |
| | | difference |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </function-arg-def> |
| | | </function-list-args> |
| | | <sequence> |
| | | <script> |
| | | myRC = 0 |
| | | myKnownIssue = knownIssue |
| | | failedServers = [] |
| | | failingServerList = '' |
| | | referenceServerPath = '%s/%s' % (referenceServer.getDir(), OPENDSNAME) |
| | | referenceTree = 'referenceTree.ldif' |
| | | sampleTree = 'sampleTree.ldif' |
| | | treeDiffs = 'treeDiffs.ldif' |
| | | </script> |
| | | |
| | | <!-- Verify the synchronization of the trees among the servers in |
| | | the topology --> |
| | | <call function="'getReplicationStatus'"> |
| | | { 'location' : location, |
| | | 'dsPath' : dsPath, |
| | | 'dsInstanceHost' : referenceServer.getHostname(), |
| | | 'dsInstanceAdminPort' : referenceServer.getAdminPort(), |
| | | 'replicationDnList' : [treeSuffix], |
| | | 'noOfLoops' : 10, |
| | | 'noOfMilliSeconds' : 6000 |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | | 'Verify tree %s taking %s as reference.' \ |
| | | % (treeSuffix, referenceServerPath) |
| | | </message> |
| | | <!-- Retrieve the tree from the reference server --> |
| | | <call function="'exportLdifWithScript'"> |
| | | { 'location' : location, |
| | | 'dsPath' : dsPath, |
| | | 'dsInstanceHost' : referenceServer.getHostname(), |
| | | 'dsInstanceAdminPort' : referenceServer.getAdminPort(), |
| | | 'dsInstanceDn' : referenceServer.getRootDn(), |
| | | 'dsInstancePswd' : referenceServer.getRootPwd(), |
| | | 'ldifFile' : '%s/../%s' % (dsPath, referenceTree), |
| | | 'includeBranches' : [treeSuffix] |
| | | } |
| | | </call> |
| | | |
| | | <if expr="RC != 0"> |
| | | <!-- If the reference tree could not be retrieved, return an error --> |
| | | <return> [1, None] </return> |
| | | </if> |
| | | <iterate var="server" in="serverList"> |
| | | <sequence> |
| | | <!-- Retrieve the same tree for every other server in the list --> |
| | | <if expr="server.getHostname() == location"> |
| | | <script> |
| | | filePath = dsPath |
| | | isSameLocation = True |
| | | </script> |
| | | <else> |
| | | <script> |
| | | filePath = '%s/%s' % (server.getDir(), OPENDSNAME) |
| | | isSameLocation = False |
| | | </script> |
| | | </else> |
| | | </if> |
| | | <call function="'exportLdifWithScript'"> |
| | | { 'location' : location, |
| | | 'dsPath' : dsPath, |
| | | 'dsInstanceHost' : server.getHostname(), |
| | | 'dsInstanceAdminPort' : server.getAdminPort(), |
| | | 'dsInstanceDn' : server.getRootDn(), |
| | | 'dsInstancePswd' : server.getRootPwd(), |
| | | 'ldifFile' : '%s/../%s' % (filePath, sampleTree), |
| | | 'includeBranches' : [treeSuffix] |
| | | } |
| | | </call> |
| | | |
| | | <if expr="RC == 0"> |
| | | <sequence> |
| | | |
| | | <if expr="not isSameLocation"> |
| | | <!-- Copy sample tree file to reference server --> |
| | | <call function="'copyFile'"> |
| | | { 'location' : server.getHostname(), |
| | | 'remotehost' : location, |
| | | 'srcfile' : '%s/../%s' % (filePath, sampleTree), |
| | | 'destfile' : '%s/../%s' % (dsPath, sampleTree) |
| | | } |
| | | </call> |
| | | </if> |
| | | |
| | | <!-- Compare this tree to the reference one --> |
| | | <call function="'LdifDiffSdk'"> |
| | | { 'location' : location, |
| | | 'dsPath' : dsPath, |
| | | 'sourceLdif' : '%s/../%s' % (dsPath, sampleTree), |
| | | 'targetLdif' : '%s/../%s' % (dsPath, referenceTree), |
| | | 'outputLdif' : '%s/../%s' % (dsPath, treeDiffs) |
| | | } |
| | | </call> |
| | | <if expr="STAXResult[0][0] != 0"> |
| | | <sequence> |
| | | <script> |
| | | failedServers.append('%s:%s' % \ |
| | | (server.getHostname(), server.getPort())) |
| | | </script> |
| | | <message log="1" level="'Error'"> |
| | | 'Tree is DIFFERENT for %s:%s compared to %s:%s' % \ |
| | | (server.getHostname(), server.getPort(), |
| | | referenceServer.getHostname(), referenceServer.getPort()) |
| | | </message> |
| | | </sequence> |
| | | </if> |
| | | </sequence> |
| | | <else> |
| | | <script> |
| | | failedServers.append('%s:%s' % \ |
| | | (server.getHostname(), server.getPort())) |
| | | </script> |
| | | </else> |
| | | </if> |
| | | </sequence> |
| | | </iterate> |
| | | <if expr="len(failedServers) > 0"> |
| | | <!-- If at least one server failed to successfully compare to the |
| | | ! reference tree, return an error, along with the list of the |
| | | ! servers that failed to do so --> |
| | | <script> |
| | | myRC = 1 |
| | | comma = ',' |
| | | failingServerList = \ |
| | | 'List of non-synchronized servers (tree verify FAILED): %s ' \ |
| | | % comma.join(failedServers) |
| | | </script> |
| | | <else> |
| | | <message> |
| | | 'All servers synchronized (tree verify SUCCEEDED).' |
| | | </message> |
| | | </else> |
| | | </if> |
| | | <call function="'checktestRC'"> |
| | | { 'returncode' : myRC, |
| | | 'result' : failingServerList, |
| | | 'expected' : 0, |
| | | 'issue' : myKnownIssue |
| | | } |
| | | </call> |
| | | <return>[myRC, failedServers]</return> |
| | | </sequence> |
| | | </function> |
| | | |
| | | <function name="verifySchemas"> |
| | | <function-prolog> |
| New file |
| | |
| | | dn: uid=user.%d,ou=People,dc=com |
| | | objectClass: top |
| | | objectClass: person |
| | | objectClass: organizationalPerson |
| | | objectClass: inetOrgPerson |
| | | givenName: %s |
| | | sn: %s |
| | | cn: %s %s |
| | | #initials: {givenName:1}<random:chars:ABCDEFGHIJKLMNOPQRSTUVWXYZ:1>{sn:1} |
| | | #employeeNumber: <sequential:0> |
| | | #uid: user.{employeeNumber} |
| | | #mail: {uid}@[maildomain] |
| | | #userPassword: password |
| | | #telephoneNumber: <random:telephone> |
| | | #homePhone: <random:telephone> |
| | | #pager: <random:telephone> |
| | | #mobile: <random:telephone> |
| | | #street: <random:numeric:5> <file:streets> Street |
| | | #l: <file:cities> |
| | | #st: <file:states> |
| | | #postalCode: <random:numeric:5> |
| | | #postalAddress: {cn}${street}${l}, {st} {postalCode} |
| | | #description: This is the description for {cn}. |
| New file |
| | |
| | | dn: uid=user.%d,ou=People,o=example |
| | | objectClass: top |
| | | objectClass: person |
| | | objectClass: organizationalPerson |
| | | objectClass: inetOrgPerson |
| | | givenName: %s |
| | | sn: %s |
| | | cn: %s %s |
| | | #initials: {givenName:1}<random:chars:ABCDEFGHIJKLMNOPQRSTUVWXYZ:1>{sn:1} |
| | | #employeeNumber: <sequential:0> |
| | | #uid: user.{employeeNumber} |
| | | #mail: {uid}@[maildomain] |
| | | #userPassword: password |
| | | #telephoneNumber: <random:telephone> |
| | | #homePhone: <random:telephone> |
| | | #pager: <random:telephone> |
| | | #mobile: <random:telephone> |
| | | #street: <random:numeric:5> <file:streets> Street |
| | | #l: <file:cities> |
| | | #st: <file:states> |
| | | #postalCode: <random:numeric:5> |
| | | #postalAddress: {cn}${street}${l}, {st} {postalCode} |
| | | #description: This is the description for {cn}. |
| | |
| | | 'subcommand' : 'create-local-db-index' , |
| | | 'objectType' : 'backend-name' , |
| | | 'objectName' : 'userRoot', |
| | | 'optionsString' : '--index-name employeeNumber --set index-type:approximate --set index-type:equality --set index-type:ordering --set index-type:presence --set index-type:substring ' , |
| | | 'optionsString' : '--index-name description --set index-type:approximate --set index-type:equality --set index-type:presence --set index-type:substring ' , |
| | | 'expectedRC' : 0 } |
| | | </call> |
| | | |
| | |
| | | 'subcommand' : 'create-local-db-index' , |
| | | 'objectType' : 'backend-name' , |
| | | 'objectName' : 'userRoot', |
| | | 'optionsString' : '--index-name employeeNumber --add index-type:approximate --add index-type:equality --add index-type:ordering --add index-type:presence --add index-type:substring ' , |
| | | 'optionsString' :'--index-name employeeNumber --set index-type:approximate --set index-type:equality --set index-type:ordering --set index-type:presence --set index-type:substring ' , |
| | | 'expectedRC' : 0 } |
| | | </call> |
| | | |
| | |
| | | ! |
| | | ! CDDL HEADER END |
| | | ! |
| | | ! Copyright 2011-2012 ForgeRock AS. |
| | | ! Copyright 2011-2013 ForgeRock AS. |
| | | ! --> |
| | | <stax> |
| | | <defaultcall function="main_operations_basic"/> |
| | |
| | | <call function="'common_setup'"> |
| | | { |
| | | 'quickStart' : False , |
| | | 'startServer' : False , |
| | | 'loadData' : True , |
| | | 'ldifFile' : '%s/operations/ldapauthusers.ldif' % remote.data , |
| | | 'generateLDIF' : True , |
| | | 'ldifTemplate' : '%s/operations/ldapauthusers.template' % remote.data , |
| | | 'stopServer' : False |
| | | 'startServer' : False |
| | | } |
| | | </call> |
| | | |
| | |
| | | </iterate> |
| | | |
| | | <!-- Specific to basic operations tests --> |
| | | |
| | | <script> |
| | | timerDuration = '2h' |
| | | numberOfEntries = 100000 |
| | | addTemplate = '%s/operations/add_template.ldif' % remote.data |
| | | ldifFile = '%s/import_Entries_100k.ldif' % remote.temp |
| | | </script> |
| | | |
| | | <!-- List of Test Cases --> |
| | | <script> |
| | | testsList=[] |
| | | testsList.append('basic_operations_000') |
| | | testsList.append('basic_operations_001') |
| | | testsList.append('basic_operations_002') |
| | | testsList.append('basic_operations_003') |
| | | testsList.append('basic_operations_004') |
| | | </script> |
| | | |
| | | <!-- Execute the Tests --> |
| | |
| | | <!-- Test Suite Cleanup --> |
| | | <message>'Finally: Global Cleanup.'</message> |
| | | <try> |
| | | <call function="'common_cleanup'" /> |
| | | <!--<call function="'common_cleanup'" />--> |
| | | <message>'gfgd'</message> |
| | | <catch exception="'STAFException'"> |
| | | <sequence> |
| | | <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message> |
| | |
| | | ! |
| | | ! CDDL HEADER END |
| | | ! |
| | | ! Copyright 2011 ForgeRock AS |
| | | ! Copyright 2011-2013 ForgeRock AS |
| | | ! --> |
| | | <stax> |
| | | |
| | | <!-- Definition of Test Cases --> |
| | | <!-- Definition of Test Cases --> |
| | | |
| | | <!--- Test Cases : Basic : Operations --> |
| | | |
| | | <!--- Test Case information |
| | | #@TestMarker Basic: operations |
| | | #@TestName Basic: operations |
| | | #@TestID basic_operations_000 |
| | | #@TestPurpose Preamble |
| | | #@TestPreamble Common Setup |
| | | #@TestStep Import sample data |
| | | #@TestPostamble Common Cleanup |
| | | #@TestResult Test is successful if the result code is 0 |
| | | --> |
| | | <function name="basic_operations_000" scope="local"> |
| | | <testcase name="getTestCaseName('Preamble')"> |
| | | <sequence> |
| | | <call function="'testCase_Preamble'"/> |
| | | |
| | | <script> |
| | | ldifTemplate = '%s/import_Entries_100k.template' % remote.temp |
| | | </script> |
| | | |
| | | <message> |
| | | 'Preamble: Stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT) |
| | | </message> |
| | | |
| | | <call function="'StopDsWithScript'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME, |
| | | 'dsHost' : DIRECTORY_INSTANCE_HOST, |
| | | 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT, |
| | | 'dsBindDN' : DIRECTORY_INSTANCE_DN, |
| | | 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD } |
| | | </call> |
| | | |
| | | <!-- Check if 'ldifFile' exists --> |
| | | <call function="'GetEntry'"> |
| | | { |
| | | 'location' : STAF_REMOTE_HOSTNAME , |
| | | 'entry' : ldifFile , |
| | | 'attribute' : 'TYPE' |
| | | } |
| | | </call> |
| | | <if expr="RC == 48"> |
| | | <sequence> |
| | | <message> |
| | | 'Preamble: File %s does not exist, create it' % ldifFile |
| | | </message> |
| | | |
| | | <message> |
| | | 'Preamble: Make an make-ldif template file' |
| | | </message> |
| | | |
| | | <call function="'MakeAMakeLdifTemplate'"> |
| | | { |
| | | 'numEntries' : numberOfEntries , |
| | | 'additionalAttributes' : True , |
| | | 'extraLine' : 'userpassword: password' , |
| | | 'templateFile' : ldifTemplate , |
| | | 'templateLocation' : STAF_REMOTE_HOSTNAME |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | | 'Preamble: Make the ldif file' |
| | | </message> |
| | | |
| | | <call function="'MakeLdifWithScript'"> |
| | | { |
| | | 'location' : STAF_REMOTE_HOSTNAME , |
| | | 'templateFile' : ldifTemplate , |
| | | 'ldifFile' : ldifFile |
| | | } |
| | | </call> |
| | | </sequence> |
| | | <else> |
| | | <message> |
| | | 'Preamble: File %s exists, do nothing' % ldifFile |
| | | </message> |
| | | </else> |
| | | </if> |
| | | |
| | | <message> |
| | | 'Preamble: Import the ldif file' |
| | | </message> |
| | | |
| | | <call function="'ImportLdifWithScript'"> |
| | | { |
| | | 'location' : STAF_REMOTE_HOSTNAME , |
| | | 'ldifFile' : ldifFile , |
| | | 'backEnd' : 'userRoot' |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | | 'Preamble: Start DS to run on port %s' % DIRECTORY_INSTANCE_PORT |
| | | </message> |
| | | |
| | | <call function="'StartDsWithScript'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME } |
| | | </call> |
| | | |
| | | <call function="'testCase_Postamble'"/> |
| | | |
| | | </sequence> |
| | | </testcase> |
| | | </function> |
| | | |
| | | <!--- Test Case information |
| | | #@TestMarker Basic: operations |
| | | #@TestName Basic: operations |
| | | #@TestID basic_operations_001 |
| | | #@TestPurpose Verify basic LDAP authentication operations |
| | | #@TestPreamble Common Setup |
| | |
| | | 'Test Name = %s' % STAXCurrentTestcase |
| | | </message> |
| | | |
| | | <script> |
| | | BINDUSERS='%s/operations/binduser.ref' % remote.data |
| | | </script> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'Authrate.' } |
| | | </call> |
| | | |
| | | <call function="'authRate'"> |
| | | { 'dsInstanceHost' : server.host, |
| | | 'dsInstancePort' : server.port, |
| | | 'dsInstanceDn' : '"%s"', |
| | | 'dsInstancePswd' : server.password, |
| | | 'extraParams' : '-g "rand(%s)" -c 10 -m 2000 -M 100' % BINDUSERS |
| | | |
| | | <timer duration="timerDuration"> |
| | | <sequence> |
| | | <call function="'authRate'"> |
| | | { 'dsInstanceHost' : server.host, |
| | | 'dsInstancePort' : server.port, |
| | | 'dsInstanceDn' : '"uid=user.%s,ou=People,dc=com"', |
| | | 'dsInstancePswd' : 'password', |
| | | 'extraParams' : '-g "rand(0,%s)" -c 10' % (numberOfEntries - 1), |
| | | 'outputFile' : 'authrate.res', |
| | | 'outputPath' : remote.temp |
| | | } |
| | | </call> |
| | | </sequence> |
| | | </timer> |
| | | |
| | | <call function="'getFile'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME , |
| | | 'filename' : '%s/authrate.res' % remote.temp |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | | cmdResult |
| | | </message> |
| | | |
| | | <script> |
| | | import re |
| | | f=open('%s/authrate.res' % remote.temp) |
| | | errorFound=False |
| | | for line in f.readlines(): |
| | | line = line.replace('\n','') |
| | | if re.search('^[0-9].*', line) is not None: |
| | | if line.split()[7] != '0.0': |
| | | errorFound=True |
| | | </script> |
| | | <if expr="errorFound == False"> |
| | | <tcstatus result="'pass'"/> |
| | | <else> |
| | | <sequence> |
| | | <message>'Error found during authrate'</message> |
| | | <tcstatus result="'fail'"/> |
| | | </sequence> |
| | | </else> |
| | | </if> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'Do search on the server.' } |
| | | </call> |
| | | |
| | | <call function="'ldapSearchWithScript'"> |
| | | { |
| | | 'dsInstanceHost' : server.host, |
| | | 'dsInstancePort' : server.port, |
| | | 'dsInstanceDn' : server.dn, |
| | | 'dsInstancePswd' : server.password, |
| | | 'dsBaseDN' : 'dc=com', |
| | | 'dsFilter' : 'objectclass=*', |
| | | 'dsAttributes' : 'dn' |
| | | } |
| | | </call> |
| | | </sequence> |
| | | |
| | | <catch exception="'STAXException'" typevar="eType" var="eInfo"> |
| | |
| | | #@TestResult Test is successful if the result code is 0 |
| | | --> |
| | | <function name="basic_operations_002" scope="local"> |
| | | <testcase name="getTestCaseName('search')"> |
| | | <testcase name="getTestCaseName('searchrate')"> |
| | | <sequence> |
| | | <try> |
| | | <sequence> |
| | |
| | | 'Test Name = %s' % STAXCurrentTestcase |
| | | </message> |
| | | |
| | | <script> |
| | | SEARCHUSERS='%s/operations/binduser.ref' % remote.data |
| | | </script> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'SearchRate.' } |
| | | </call> |
| | | |
| | | <call function="'searchRate'"> |
| | | { 'dsInstanceHost' : server.host, |
| | | 'dsInstancePort' : server.port, |
| | | 'dsInstanceDn' : server.dn, |
| | | 'dsInstancePswd' : server.password, |
| | | 'dsBaseDN' : '"%s"', |
| | | 'extraParams' : '-g "rand(%s)" -m 2000 -M 100 "objectclass=*"' % SEARCHUSERS |
| | | <timer duration="timerDuration"> |
| | | <sequence> |
| | | <call function="'searchRate'"> |
| | | { 'dsInstanceHost' : server.host, |
| | | 'dsInstancePort' : server.port, |
| | | 'dsInstanceDn' : server.dn, |
| | | 'dsInstancePswd' : server.password, |
| | | 'dsBaseDN' : '"uid=user.%s,ou=People,dc=com"', |
| | | 'extraParams' : '-g "rand(0,%s)" -c 10 "objectclass=*"' % (numberOfEntries - 1), |
| | | 'outputFile' : 'searchrate.res', |
| | | 'outputPath' : remote.temp |
| | | } |
| | | </call> |
| | | </sequence> |
| | | </timer> |
| | | |
| | | <call function="'getFile'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME , |
| | | 'filename' : '%s/searchrate.res' % remote.temp |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | | cmdResult |
| | | </message> |
| | | |
| | | <script> |
| | | import re |
| | | f=open('%s/searchrate.res' % remote.temp) |
| | | errorFound=False |
| | | for line in f.readlines(): |
| | | line = line.replace('\n','') |
| | | if re.search('^[0-9].*', line) is not None: |
| | | if line.split()[7] != '0.0': |
| | | errorFound=True |
| | | </script> |
| | | <if expr="errorFound == False"> |
| | | <tcstatus result="'pass'"/> |
| | | <else> |
| | | <sequence> |
| | | <message>'Error found during searchrate'</message> |
| | | <tcstatus result="'fail'"/> |
| | | </sequence> |
| | | </else> |
| | | </if> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'Do search on the server.' } |
| | | </call> |
| | | |
| | | <call function="'ldapSearchWithScript'"> |
| | | { |
| | | 'dsInstanceHost' : server.host, |
| | | 'dsInstancePort' : server.port, |
| | | 'dsInstanceDn' : server.dn, |
| | | 'dsInstancePswd' : server.password, |
| | | 'dsBaseDN' : 'dc=com', |
| | | 'dsFilter' : 'objectclass=*', |
| | | 'dsAttributes' : 'dn' |
| | | } |
| | | </call> |
| | | </sequence> |
| | | |
| | | <catch exception="'STAXException'" typevar="eType" var="eInfo"> |
| | |
| | | 'Test Name = %s' % STAXCurrentTestcase |
| | | </message> |
| | | |
| | | <script> |
| | | MODUSERS='%s/operations/binduser.ref' % remote.data |
| | | </script> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'ModRate.' } |
| | | </call> |
| | | |
| | | <call function="'modRate'"> |
| | | { 'dsInstanceHost' : server.host, |
| | | 'dsInstancePort' : server.port, |
| | | 'dsInstanceDn' : server.dn, |
| | | 'dsInstancePswd' : server.password, |
| | | 'dsBaseDN' : '"%s"', |
| | | 'extraParams' : '-g "rand(%s)" -g "rand(10,20)" -m 2000 -M 100' % MODUSERS, |
| | | 'attribute' : 'description' , |
| | | 'formatString' : '"%s"' |
| | | <timer duration="timerDuration"> |
| | | <sequence> |
| | | <call function="'modRate'"> |
| | | { 'dsInstanceHost' : server.host, |
| | | 'dsInstancePort' : server.port, |
| | | 'dsInstanceDn' : server.dn, |
| | | 'dsInstancePswd' : server.password, |
| | | 'dsBaseDN' : '"uid=user.%s,ou=People,dc=com"', |
| | | 'extraParams' : '-g "rand(0,%s)" -g "randstr(40)" -c 10' % (numberOfEntries - 1), |
| | | 'attribute' : 'description' , |
| | | 'formatString' : '"%s"', |
| | | 'outputFile' : 'modrate.res', |
| | | 'outputPath' : remote.temp |
| | | } |
| | | </call> |
| | | </sequence> |
| | | </timer> |
| | | |
| | | <call function="'getFile'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME , |
| | | 'filename' : '%s/modrate.res' % remote.temp |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | | cmdResult |
| | | </message> |
| | | |
| | | <script> |
| | | import re |
| | | f=open('%s/modrate.res' % remote.temp) |
| | | errorFound=False |
| | | for line in f.readlines(): |
| | | line = line.replace('\n','') |
| | | if re.search('^[0-9].*', line) is not None: |
| | | if line.split()[7] != '0.0': |
| | | errorFound=True |
| | | </script> |
| | | <if expr="errorFound == False"> |
| | | <tcstatus result="'pass'"/> |
| | | <else> |
| | | <sequence> |
| | | <message>'Error found during modrate'</message> |
| | | <tcstatus result="'fail'"/> |
| | | </sequence> |
| | | </else> |
| | | </if> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'Do search on the server.' } |
| | | </call> |
| | | |
| | | <call function="'ldapSearchWithScript'"> |
| | | { |
| | | 'dsInstanceHost' : server.host, |
| | | 'dsInstancePort' : server.port, |
| | | 'dsInstanceDn' : server.dn, |
| | | 'dsInstancePswd' : server.password, |
| | | 'dsBaseDN' : 'dc=com', |
| | | 'dsFilter' : 'objectclass=*', |
| | | 'dsAttributes' : 'dn' |
| | | } |
| | | </call> |
| | | </sequence> |
| | | |
| | | <catch exception="'STAXException'" typevar="eType" var="eInfo"> |
| | | <message log="1" level="'fatal'"> |
| | | '%s: Test failed. eInfo(%s)' % (eType,eInfo) |
| | | </message> |
| | | </catch> |
| | | <finally> |
| | | <sequence> |
| | | <call function="'testCase_Postamble'"/> |
| | | </sequence> |
| | | </finally> |
| | | </try> |
| | | </sequence> |
| | | </testcase> |
| | | </function> |
| | | |
| | | <!--- Test Case information |
| | | #@TestMarker Basic: operations |
| | | #@TestName Basic: operations |
| | | #@TestID basic_operations_004 |
| | | #@TestPurpose Verify basic LDAP modify operations |
| | | #@TestPreamble Common Setup |
| | | #@TestStep Run LDAP add/delete operations |
| | | #@TestPostamble Common Cleanup |
| | | #@TestResult Test is successful if the result code is 0 |
| | | --> |
| | | <function name="basic_operations_004" scope="local"> |
| | | <testcase name="getTestCaseName('addrate-delrate')"> |
| | | <sequence> |
| | | <try> |
| | | <sequence> |
| | | <call function="'testCase_Preamble'"/> |
| | | <message> |
| | | 'Test Name = %s' % STAXCurrentTestcase |
| | | </message> |
| | | |
| | | <parallel> |
| | | <block name="'addRate'"> |
| | | <sequence> |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'AddRate.' } |
| | | </call> |
| | | |
| | | <timer duration="timerDuration"> |
| | | <sequence> |
| | | <call function="'addRate'"> |
| | | { 'dsInstanceHost' : server.host, |
| | | 'dsInstancePort' : server.port, |
| | | 'dsInstanceDn' : server.dn, |
| | | 'dsInstancePswd' : server.password, |
| | | 'templateFile' : addTemplate, |
| | | 'extraParams' : '-g "inc(%s,%s)" -g "randstr(5)" -g "randstr(5)" -g "randstr(5)" -g "randstr(5)" -m 100000' \ |
| | | % (numberOfEntries, 2 * numberOfEntries), |
| | | 'outputFile' : 'addrate.res', |
| | | 'outputPath' : remote.temp |
| | | } |
| | | </call> |
| | | </sequence> |
| | | </timer> |
| | | |
| | | <call function="'getFile'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME , |
| | | 'filename' : '%s/addrate.res' % remote.temp |
| | | } |
| | | </call> |
| | | <message> |
| | | cmdResult |
| | | </message> |
| | | |
| | | <script> |
| | | import re |
| | | f=open('%s/addrate.res' % remote.temp) |
| | | errorFound=False |
| | | for line in f.readlines(): |
| | | line = line.replace('\n','') |
| | | if re.search('^[0-9].*', line) is not None: |
| | | if line.split()[7] != '0.0': |
| | | errorFound=True |
| | | </script> |
| | | <if expr="errorFound == False"> |
| | | <tcstatus result="'pass'"/> |
| | | <else> |
| | | <sequence> |
| | | <message>'Error found during addrate'</message> |
| | | <tcstatus result="'fail'"/> |
| | | </sequence> |
| | | </else> |
| | | </if> |
| | | </sequence> |
| | | </block> |
| | | |
| | | <block name="'delRate'"> |
| | | <sequence> |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'DelRate.' } |
| | | </call> |
| | | |
| | | <timer duration="timerDuration"> |
| | | <sequence> |
| | | <call function="'delRate'"> |
| | | { 'dsInstanceHost' : server.host, |
| | | 'dsInstancePort' : server.port, |
| | | 'dsInstanceDn' : server.dn, |
| | | 'dsInstancePswd' : server.password, |
| | | 'dsBaseDN' : '"uid=user.%s,ou=People,dc=com"', |
| | | 'extraParams' : '-g "inc(0,%s)" -m 100000' % (numberOfEntries - 1), |
| | | 'outputFile' : 'delrate.res', |
| | | 'outputPath' : remote.temp |
| | | } |
| | | </call> |
| | | </sequence> |
| | | </timer> |
| | | |
| | | <call function="'getFile'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME , |
| | | 'filename' : '%s/delrate.res' % remote.temp |
| | | } |
| | | </call> |
| | | <message> |
| | | cmdResult |
| | | </message> |
| | | |
| | | <script> |
| | | import re |
| | | f=open('%s/delrate.res' % remote.temp) |
| | | errorFound=False |
| | | for line in f.readlines(): |
| | | line = line.replace('\n','') |
| | | if re.search('^[0-9].*', line) is not None: |
| | | if line.split()[7] != '0.0': |
| | | errorFound=True |
| | | </script> |
| | | <if expr="errorFound == False"> |
| | | <tcstatus result="'pass'"/> |
| | | <else> |
| | | <sequence> |
| | | <message>'Error found during delrate'</message> |
| | | <tcstatus result="'fail'"/> |
| | | </sequence> |
| | | </else> |
| | | </if> |
| | | </sequence> |
| | | </block> |
| | | </parallel> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'Do search on the server and check number of entries.' } |
| | | </call> |
| | | |
| | | <call function="'ldapSearchWithScript'"> |
| | | { |
| | | 'dsInstanceHost' : server.host, |
| | | 'dsInstancePort' : server.port, |
| | | 'dsInstanceDn' : server.dn, |
| | | 'dsInstancePswd' : server.password, |
| | | 'dsCountEntries' : 'True' , |
| | | 'dsBaseDN' : 'dc=com', |
| | | 'dsFilter' : 'objectclass=*', |
| | | 'dsAttributes' : 'dn', |
| | | 'outputFile' : 'ldapsearch_add_del.out', |
| | | 'outputPath' : remote.temp |
| | | } |
| | | </call> |
| | | |
| | | <call function="'grep'"> |
| | | { |
| | | 'location' : STAF_REMOTE_HOSTNAME , |
| | | 'filename' : '%s/ldapsearch_add_del.out' % remote.temp , |
| | | 'testString': 'Total number of matching entries: 100002' |
| | | } |
| | | </call> |
| | | </sequence> |
| | | |
| | | <catch exception="'STAXException'" typevar="eType" var="eInfo"> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| | | <!DOCTYPE stax SYSTEM "../../../../shared/stax.dtd"> |
| | | <!-- |
| | | ! CDDL HEADER START |
| | | ! |
| | | ! The contents of this file are subject to the terms of the |
| | | ! Common Development and Distribution License, Version 1.0 only |
| | | ! (the "License"). You may not use this file except in compliance |
| | | ! with the License. |
| | | ! |
| | | ! You can obtain a copy of the license at |
| | | ! trunk/opends/resource/legal-notices/CDDLv1_0.txt |
| | | ! or http://forgerock.org/license/CDDLv1.0.html. |
| | | ! See the License for the specific language governing permissions |
| | | ! and limitations under the License. |
| | | ! |
| | | ! When distributing Covered Code, include this CDDL HEADER in each |
| | | ! file and include the License file at |
| | | ! trunk/opends/resource/legal-notices/CDDLv1_0.txt. If applicable, |
| | | ! add the following below this CDDL HEADER, with the fields enclosed |
| | | ! by brackets "[]" replaced with your own identifying information: |
| | | ! Portions Copyright [yyyy] [name of copyright owner] |
| | | ! |
| | | ! CDDL HEADER END |
| | | ! |
| | | ! Copyright 2013 ForgeRock AS. |
| | | ! --> |
| | | <stax> |
| | | <defaultcall function="main_replication_operations_basic"/> |
| | | <function name="main_replication_operations_basic" scope="local"> |
| | | <sequence> |
| | | <block name="'main_replication_operations_basic'"> |
| | | <try> |
| | | <sequence> |
| | | <script> |
| | | CurrentTestPath['group']='replication_operations' |
| | | CurrentTestPath['suite']='basic' |
| | | |
| | | __group=CurrentTestPath['group'] |
| | | __groupdir='%s/testcases/%s' % (TESTS_DIR,__group) |
| | | </script> |
| | | |
| | | <!--- Test Suite information |
| | | #@TestSuiteName Basic replication operations suite |
| | | #@TestSuitePurpose Verify basic replication operations |
| | | #@TestSuiteID Suite |
| | | #@TestSuiteGroup Basic |
| | | #@TestGroup Basic |
| | | #@TestScript operations.xml |
| | | #@TestHTMLLink http://www.forgerock.org/ |
| | | --> |
| | | <call function="'testSuite_Preamble'"/> |
| | | |
| | | <try> |
| | | <sequence> |
| | | |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/../functional-tests/testcases/replication/replication_setup.xml' % (TESTS_DIR)"/> |
| | | <call function="'replication_setup'"/> |
| | | |
| | | <!-- List of Import of Test Functions --> |
| | | <script> |
| | | importList=[] |
| | | importList.append('basic/replication_operations_basic_tests') |
| | | </script> |
| | | |
| | | <!-- Import the files for this test suite --> |
| | | <iterate var="__import" in="importList"> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/%s.xml' % (__groupdir,__import)"/> |
| | | </iterate> |
| | | |
| | | <!-- Specific to basic operations tests --> |
| | | <script> |
| | | timerDuration = '2h' |
| | | numberOfEntries = 100000 |
| | | addTemplate = '%s/replication_operations/add_template.ldif' % remote.data |
| | | ldifFile = '%s/import_Entries_100k.ldif' % remote.temp |
| | | </script> |
| | | |
| | | <!-- List of Test Cases --> |
| | | <script> |
| | | testsList=[] |
| | | testsList.append('basic_replication_operations_000') |
| | | #testsList.append('basic_replication_operations_001') |
| | | testsList.append('basic_replication_operations_002') |
| | | testsList.append('basic_replication_operations_003') |
| | | </script> |
| | | |
| | | <!-- Execute the Tests --> |
| | | <iterate var="__test" in="testsList"> |
| | | <sequence> |
| | | <call function="'%s' % (__test)" /> |
| | | </sequence> |
| | | </iterate> |
| | | |
| | | </sequence> |
| | | <catch exception="'STAFException.TestSuite.SetupException'"> |
| | | <sequence> |
| | | <message log="1" level="'fatal'"> |
| | | 'Setup of test suite failed.' |
| | | </message> |
| | | <rethrow/> |
| | | </sequence> |
| | | </catch> |
| | | |
| | | <finally> |
| | | <message>'Test Cases Completed.'</message> |
| | | </finally> |
| | | |
| | | </try> |
| | | |
| | | </sequence> |
| | | |
| | | <finally> |
| | | <sequence> |
| | | <!-- Test Suite Cleanup --> |
| | | <message>'Finally: Global Cleanup.'</message> |
| | | <try> |
| | | <sequence> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/../functional-tests/testcases/replication/replication_cleanup.xml' % (TESTS_DIR)"/> |
| | | <call function="'replication_cleanup'"/> |
| | | </sequence> |
| | | <catch exception="'STAFException'"> |
| | | <sequence> |
| | | <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message> |
| | | </sequence> |
| | | </catch> |
| | | <finally> |
| | | <call function="'testSuite_Postamble'"/> |
| | | </finally> |
| | | </try> |
| | | </sequence> |
| | | </finally> |
| | | |
| | | </try> |
| | | </block> |
| | | </sequence> |
| | | </function> |
| | | </stax> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| | | <!DOCTYPE stax SYSTEM "../../../../shared/stax.dtd"> |
| | | <!-- |
| | | ! CDDL HEADER START |
| | | ! |
| | | ! The contents of this file are subject to the terms of the |
| | | ! Common Development and Distribution License, Version 1.0 only |
| | | ! (the "License"). You may not use this file except in compliance |
| | | ! with the License. |
| | | ! |
| | | ! You can obtain a copy of the license at |
| | | ! trunk/opends/resource/legal-notices/CDDLv1_0.txt |
| | | ! or http://forgerock.org/license/CDDLv1.0.html. |
| | | ! See the License for the specific language governing permissions |
| | | ! and limitations under the License. |
| | | ! |
| | | ! When distributing Covered Code, include this CDDL HEADER in each |
| | | ! file and include the License file at |
| | | ! trunk/opends/resource/legal-notices/CDDLv1_0.txt. If applicable, |
| | | ! add the following below this CDDL HEADER, with the fields enclosed |
| | | ! by brackets "[]" replaced with your own identifying information: |
| | | ! Portions Copyright [yyyy] [name of copyright owner] |
| | | ! |
| | | ! CDDL HEADER END |
| | | ! |
| | | ! Copyright 2013 ForgeRock AS |
| | | ! --> |
| | | <stax> |
| | | |
| | | <!-- Definition of Test Cases --> |
| | | |
| | | <!--- Test Cases : Basic : Replication Operations --> |
| | | |
| | | <!--- Test Case information |
| | | #@TestMarker Basic: replication operations |
| | | #@TestName Basic: replication operations |
| | | #@TestID basic_replication_operations_000 |
| | | #@TestPurpose Preamble |
| | | #@TestPreamble Common Setup |
| | | #@TestStep Import sample data |
| | | #@TestPostamble Common Cleanup |
| | | #@TestResult Test is successful if the result code is 0 |
| | | --> |
| | | <function name="basic_replication_operations_000" scope="local"> |
| | | <testcase name="getTestCaseName('Preamble')"> |
| | | <sequence> |
| | | <call function="'testCase_Preamble'"/> |
| | | |
| | | <script> |
| | | ldifTemplate = '%s/import_Entries_100k.template' % remote.temp |
| | | </script> |
| | | |
| | | <message> |
| | | 'Preamble: Stop DS running on port %s' % master.getPort() |
| | | </message> |
| | | |
| | | <call function="'StopDsWithScript'"> |
| | | { 'location' : masterHost, |
| | | 'dsPath' : masterPath, |
| | | 'dsHost' : masterHost, |
| | | 'dsAdminPort' : master.getAdminPort(), |
| | | 'dsBindDN' : master.getRootDn(), |
| | | 'dsBindPwd' : master.getRootPwd() } |
| | | </call> |
| | | |
| | | <!-- Check if 'ldifFile' exists --> |
| | | <call function="'GetEntry'"> |
| | | { |
| | | 'location' : masterHost , |
| | | 'entry' : ldifFile , |
| | | 'attribute' : 'TYPE' |
| | | } |
| | | </call> |
| | | <if expr="RC == 48"> |
| | | <sequence> |
| | | <message> |
| | | 'Preamble: File %s does not exist, create it' % ldifFile |
| | | </message> |
| | | |
| | | <message> |
| | | 'Preamble: Make an make-ldif template file' |
| | | </message> |
| | | |
| | | <call function="'MakeAMakeLdifTemplate'"> |
| | | { |
| | | 'suffix' : synchroSuffix, |
| | | 'numEntries' : numberOfEntries , |
| | | 'additionalAttributes' : True , |
| | | 'extraLine' : 'userpassword: password' , |
| | | 'templateFile' : ldifTemplate , |
| | | 'templateLocation' : masterHost |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | | 'Preamble: Make the ldif file' |
| | | </message> |
| | | |
| | | <call function="'MakeLdifWithScript'"> |
| | | { |
| | | 'location' : masterHost, |
| | | 'dsPath' : masterPath, |
| | | 'templateFile' : ldifTemplate , |
| | | 'ldifFile' : ldifFile |
| | | } |
| | | </call> |
| | | </sequence> |
| | | <else> |
| | | <message> |
| | | 'Preamble: File %s exists, do nothing' % ldifFile |
| | | </message> |
| | | </else> |
| | | </if> |
| | | |
| | | <message> |
| | | 'Preamble: Import the ldif file' |
| | | </message> |
| | | |
| | | <call function="'ImportLdifWithScript'"> |
| | | { |
| | | 'location' : masterHost , |
| | | 'dsPath' : masterPath, |
| | | 'ldifFile' : ldifFile , |
| | | 'backEnd' : 'userRoot' |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | | 'Preamble: Start DS to run on port %s' % master.getPort() |
| | | </message> |
| | | |
| | | <call function="'StartDsWithScript'"> |
| | | { 'location' : masterHost, |
| | | 'dsPath' : masterPath } |
| | | </call> |
| | | |
| | | <message> |
| | | 'Preamble: Perform the total update' |
| | | </message> |
| | | |
| | | <call function="'initializeReplication'"> |
| | | { 'location' : clientHost, |
| | | 'dsPath' : clientPath, |
| | | 'sourceInstanceHost' : masterHost, |
| | | 'sourceInstanceAdminPort' : master.getAdminPort(), |
| | | 'replicationDnList' : [synchroSuffix] |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | | 'Preamble: Verify the tree synchronization' |
| | | </message> |
| | | |
| | | <call function="'verifyTreesSdk'"> |
| | | [ clientHost, clientPath, master, consumerList, synchroSuffix ] |
| | | </call> |
| | | |
| | | <call function="'testCase_Postamble'"/> |
| | | |
| | | </sequence> |
| | | </testcase> |
| | | </function> |
| | | |
| | | <!--- Test Case information |
| | | #@TestMarker Basic: replication operations |
| | | #@TestName Basic: replication operations |
| | | #@TestID basic_replication_operations_001 |
| | | #@TestPurpose Verify basic LDAP modify operations |
| | | #@TestPreamble Common Setup |
| | | #@TestStep Run LDAP modify operations |
| | | #@TestPostamble Common Cleanup |
| | | #@TestResult Test is successful if the result code is 0 |
| | | --> |
| | | <function name="basic_replication_operations_001" scope="local"> |
| | | <testcase name="getTestCaseName('modrate')"> |
| | | <sequence> |
| | | <try> |
| | | <sequence> |
| | | <call function="'testCase_Preamble'"/> |
| | | <message> |
| | | 'Test Name = %s' % STAXCurrentTestcase |
| | | </message> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'ModRate.' } |
| | | </call> |
| | | |
| | | <timer duration="timerDuration"> |
| | | <sequence> |
| | | <call function="'modRate'"> |
| | | { 'dsPath' : masterPath, |
| | | 'dsInstanceHost' : masterHost, |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'dsBaseDN' : '"uid=user.%s,ou=People,o=example"', |
| | | 'extraParams' : '-g "rand(0,%s)" -g "randstr(40)" -c 10' % (numberOfEntries - 1), |
| | | 'attribute' : 'description' , |
| | | 'formatString' : '"%s"', |
| | | 'outputFile' : 'replication_modrate.res', |
| | | 'outputPath' : remote.temp |
| | | } |
| | | </call> |
| | | </sequence> |
| | | </timer> |
| | | |
| | | <call function="'getFile'"> |
| | | { 'location' : masterHost , |
| | | 'filename' : '%s/replication_modrate.res' % remote.temp |
| | | } |
| | | </call> |
| | | <message> |
| | | cmdResult |
| | | </message> |
| | | |
| | | <script> |
| | | import re |
| | | f=open('%s/replication_modrate.res' % remote.temp) |
| | | errorFound=False |
| | | for line in f.readlines(): |
| | | line = line.replace('\n','') |
| | | if re.search('^[0-9].*', line) is not None: |
| | | if line.split()[7] != '0.0': |
| | | errorFound=True |
| | | </script> |
| | | <if expr="errorFound == False"> |
| | | <tcstatus result="'pass'"/> |
| | | <else> |
| | | <sequence> |
| | | <message>'Error found during modrate'</message> |
| | | <tcstatus result="'fail'"/> |
| | | </sequence> |
| | | </else> |
| | | </if> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'Do search on the master.' } |
| | | </call> |
| | | |
| | | <call function="'ldapSearchWithScript'"> |
| | | { |
| | | 'dsPath' : masterPath, |
| | | 'dsInstanceHost' : masterHost, |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'dsBaseDN' : synchroSuffix, |
| | | 'dsFilter' : 'objectclass=*', |
| | | 'dsAttributes' : 'dn' |
| | | } |
| | | </call> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'Do search on the client.' } |
| | | </call> |
| | | |
| | | <call function="'ldapSearchWithScript'"> |
| | | { |
| | | 'dsPath' : clientPath, |
| | | 'dsInstanceHost' : clientHost, |
| | | 'dsInstancePort' : client.getPort(), |
| | | 'dsInstanceDn' : client.getRootDn(), |
| | | 'dsInstancePswd' : client.getRootPwd(), |
| | | 'dsBaseDN' : synchroSuffix, |
| | | 'dsFilter' : 'objectclass=*', |
| | | 'dsAttributes' : 'dn' |
| | | } |
| | | </call> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'Verify the tree synchronization.' } |
| | | </call> |
| | | |
| | | <call function="'verifyTreesSdk'"> |
| | | [ clientHost, clientPath, master, consumerList, synchroSuffix ] |
| | | </call> |
| | | </sequence> |
| | | |
| | | <catch exception="'STAXException'" typevar="eType" var="eInfo"> |
| | | <message log="1" level="'fatal'"> |
| | | '%s: Test failed. eInfo(%s)' % (eType,eInfo) |
| | | </message> |
| | | </catch> |
| | | <finally> |
| | | <sequence> |
| | | <call function="'testCase_Postamble'"/> |
| | | </sequence> |
| | | </finally> |
| | | </try> |
| | | </sequence> |
| | | </testcase> |
| | | </function> |
| | | |
| | | <!--- Test Case information |
| | | #@TestMarker Basic: replication operations |
| | | #@TestName Basic: replication operations |
| | | #@TestID basic_replication_operations_002 |
| | | #@TestPurpose Verify basic LDAP authentication operations |
| | | #@TestPreamble Common Setup |
| | | #@TestStep Run LDAP authentication operations |
| | | #@TestPostamble Common Cleanup |
| | | #@TestResult Test is successful if the result code is 0 |
| | | --> |
| | | <function name="basic_replication_operations_002" scope="local"> |
| | | <testcase name="getTestCaseName('addrate')"> |
| | | <sequence> |
| | | <try> |
| | | <sequence> |
| | | <call function="'testCase_Preamble'"/> |
| | | <message> |
| | | 'Test Name = %s' % STAXCurrentTestcase |
| | | </message> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'Addrate.' } |
| | | </call> |
| | | |
| | | <timer duration="timerDuration"> |
| | | <sequence> |
| | | <call function="'addRate'"> |
| | | { 'dsPath' : masterPath, |
| | | 'dsInstanceHost' : masterHost, |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'templateFile' : addTemplate, |
| | | 'extraParams' : '-g "inc(%s,%s)" -g "randstr(5)" -g "randstr(5)" -g "randstr(5)" -g "randstr(5)" -m 100000' \ |
| | | % (numberOfEntries, 2 * numberOfEntries), |
| | | 'outputFile' : 'replication_addrate.res', |
| | | 'outputPath' : remote.temp |
| | | } |
| | | </call> |
| | | </sequence> |
| | | </timer> |
| | | |
| | | <call function="'getFile'"> |
| | | { 'location' : masterHost , |
| | | 'filename' : '%s/replication_addrate.res' % remote.temp |
| | | } |
| | | </call> |
| | | <message> |
| | | cmdResult |
| | | </message> |
| | | |
| | | <script> |
| | | import re |
| | | f=open('%s/replication_addrate.res' % remote.temp) |
| | | errorFound=False |
| | | for line in f.readlines(): |
| | | line = line.replace('\n','') |
| | | if re.search('^[0-9].*', line) is not None: |
| | | if line.split()[7] != '0.0': |
| | | errorFound=True |
| | | </script> |
| | | <if expr="errorFound == False"> |
| | | <tcstatus result="'pass'"/> |
| | | <else> |
| | | <sequence> |
| | | <message>'Error found during addrate'</message> |
| | | <tcstatus result="'fail'"/> |
| | | </sequence> |
| | | </else> |
| | | </if> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'Do search on the master and check number of entries.' } |
| | | </call> |
| | | |
| | | <call function="'ldapSearchWithScript'"> |
| | | { |
| | | 'dsPath' : masterPath, |
| | | 'dsInstanceHost' : masterHost, |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'dsCountEntries' : 'True' , |
| | | 'dsBaseDN' : synchroSuffix, |
| | | 'dsFilter' : 'objectclass=*', |
| | | 'dsAttributes' : 'dn', |
| | | 'outputFile' : 'ldapsearch_add_master.out' , |
| | | 'outputPath' : remote.temp |
| | | } |
| | | </call> |
| | | |
| | | <call function="'grep'"> |
| | | { |
| | | 'location' : STAF_REMOTE_HOSTNAME , |
| | | 'filename' : '%s/ldapsearch_add_master.out' % remote.temp , |
| | | 'testString': 'Total number of matching entries: 200002' |
| | | } |
| | | </call> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'Do search on the client and check number of entries.' } |
| | | </call> |
| | | |
| | | <call function="'ldapSearchWithScript'"> |
| | | { |
| | | 'dsPath' : clientPath, |
| | | 'dsInstanceHost' : clientHost, |
| | | 'dsInstancePort' : client.getPort(), |
| | | 'dsInstanceDn' : client.getRootDn(), |
| | | 'dsInstancePswd' : client.getRootPwd(), |
| | | 'dsCountEntries' : 'True' , |
| | | 'dsBaseDN' : synchroSuffix, |
| | | 'dsFilter' : 'objectclass=*', |
| | | 'dsAttributes' : 'dn', |
| | | 'outputFile' : 'ldapsearch_add_client.out' , |
| | | 'outputPath' : remote.temp |
| | | } |
| | | </call> |
| | | |
| | | <call function="'grep'"> |
| | | { |
| | | 'location' : STAF_REMOTE_HOSTNAME , |
| | | 'filename' : '%s/ldapsearch_add_client.out' % remote.temp , |
| | | 'testString': 'Total number of matching entries: 200002' |
| | | } |
| | | </call> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'Verify the tree synchronization.' } |
| | | </call> |
| | | |
| | | <call function="'verifyTreesSdk'"> |
| | | [ clientHost, clientPath, master, consumerList, synchroSuffix ] |
| | | </call> |
| | | </sequence> |
| | | |
| | | <catch exception="'STAXException'" typevar="eType" var="eInfo"> |
| | | <message log="1" level="'fatal'"> |
| | | '%s: Test failed. eInfo(%s)' % (eType,eInfo) |
| | | </message> |
| | | </catch> |
| | | <finally> |
| | | <sequence> |
| | | <call function="'testCase_Postamble'"/> |
| | | </sequence> |
| | | </finally> |
| | | </try> |
| | | </sequence> |
| | | </testcase> |
| | | </function> |
| | | |
| | | <!--- Test Case information |
| | | #@TestMarker Basic: replication operations |
| | | #@TestName Basic: replication operations |
| | | #@TestID basic_replication_operations_003 |
| | | #@TestPurpose Verify basic LDAP search operations |
| | | #@TestPreamble Common Setup |
| | | #@TestStep Run LDAP search operations |
| | | #@TestPostamble Common Cleanup |
| | | #@TestResult Test is successful if the result code is 0 |
| | | --> |
| | | <function name="basic_replication_operations_003" scope="local"> |
| | | <testcase name="getTestCaseName('delrate')"> |
| | | <sequence> |
| | | <try> |
| | | <sequence> |
| | | <call function="'testCase_Preamble'"/> |
| | | <message> |
| | | 'Test Name = %s' % STAXCurrentTestcase |
| | | </message> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'DelRate.' } |
| | | </call> |
| | | |
| | | <timer duration="timerDuration"> |
| | | <sequence> |
| | | <call function="'delRate'"> |
| | | { 'dsPath' : masterPath, |
| | | 'dsInstanceHost' : masterHost, |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'dsBaseDN' : '"uid=user.%s,ou=People,o=example"', |
| | | 'extraParams' : '-g "inc(0,%s)" -m 100000' % (numberOfEntries - 1), |
| | | 'outputFile' : 'replication_delrate.res', |
| | | 'outputPath' : remote.temp |
| | | } |
| | | </call> |
| | | </sequence> |
| | | </timer> |
| | | |
| | | <call function="'getFile'"> |
| | | { 'location' : masterHost , |
| | | 'filename' : '%s/replication_delrate.res' % remote.temp |
| | | } |
| | | </call> |
| | | <message> |
| | | cmdResult |
| | | </message> |
| | | |
| | | <script> |
| | | import re |
| | | f=open('%s/replication_delrate.res' % remote.temp) |
| | | errorFound=False |
| | | for line in f.readlines(): |
| | | line = line.replace('\n','') |
| | | if re.search('^[0-9].*', line) is not None: |
| | | if line.split()[7] != '0.0': |
| | | errorFound=True |
| | | </script> |
| | | <if expr="errorFound == False"> |
| | | <tcstatus result="'pass'"/> |
| | | <else> |
| | | <sequence> |
| | | <message>'Error found during delrate'</message> |
| | | <tcstatus result="'fail'"/> |
| | | </sequence> |
| | | </else> |
| | | </if> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'Do search on the master and check number of entries.' } |
| | | </call> |
| | | |
| | | <call function="'ldapSearchWithScript'"> |
| | | { |
| | | 'dsPath' : masterPath, |
| | | 'dsInstanceHost' : masterHost, |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'dsCountEntries' : 'True' , |
| | | 'dsBaseDN' : synchroSuffix, |
| | | 'dsFilter' : 'objectclass=*', |
| | | 'dsAttributes' : 'dn', |
| | | 'outputFile' : 'ldapsearch_del_master.out' , |
| | | 'outputPath' : remote.temp |
| | | } |
| | | </call> |
| | | |
| | | <call function="'grep'"> |
| | | { |
| | | 'location' : STAF_REMOTE_HOSTNAME , |
| | | 'filename' : '%s/ldapsearch_del_master.out' % remote.temp , |
| | | 'testString': 'Total number of matching entries: 100002' |
| | | } |
| | | </call> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'Do search on the client and check number of entries.' } |
| | | </call> |
| | | |
| | | <call function="'ldapSearchWithScript'"> |
| | | { |
| | | 'dsPath' : clientPath, |
| | | 'dsInstanceHost' : clientHost, |
| | | 'dsInstancePort' : client.getPort(), |
| | | 'dsInstanceDn' : client.getRootDn(), |
| | | 'dsInstancePswd' : client.getRootPwd(), |
| | | 'dsCountEntries' : 'True' , |
| | | 'dsBaseDN' : synchroSuffix, |
| | | 'dsFilter' : 'objectclass=*', |
| | | 'dsAttributes' : 'dn', |
| | | 'outputFile' : 'ldapsearch_del_client.out' , |
| | | 'outputPath' : remote.temp |
| | | } |
| | | </call> |
| | | |
| | | <call function="'grep'"> |
| | | { |
| | | 'location' : STAF_REMOTE_HOSTNAME , |
| | | 'filename' : '%s/ldapsearch_del_client.out' % remote.temp , |
| | | 'testString': 'Total number of matching entries: 100002' |
| | | } |
| | | </call> |
| | | |
| | | <call function="'testStep'"> |
| | | { 'stepMessage' : 'Verify the tree synchronization.' } |
| | | </call> |
| | | |
| | | <call function="'verifyTreesSdk'"> |
| | | [ clientHost, clientPath, master, consumerList, synchroSuffix ] |
| | | </call> |
| | | </sequence> |
| | | |
| | | <catch exception="'STAXException'" typevar="eType" var="eInfo"> |
| | | <message log="1" level="'fatal'"> |
| | | '%s: Test failed. eInfo(%s)' % (eType,eInfo) |
| | | </message> |
| | | </catch> |
| | | <finally> |
| | | <sequence> |
| | | <call function="'testCase_Postamble'"/> |
| | | </sequence> |
| | | </finally> |
| | | </try> |
| | | </sequence> |
| | | </testcase> |
| | | </function> |
| | | </stax> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| | | <!DOCTYPE stax SYSTEM "../../../shared/stax.dtd"> |
| | | <!-- |
| | | ! CDDL HEADER START |
| | | ! |
| | | ! The contents of this file are subject to the terms of the |
| | | ! Common Development and Distribution License, Version 1.0 only |
| | | ! (the "License"). You may not use this file except in compliance |
| | | ! with the License. |
| | | ! |
| | | ! You can obtain a copy of the license at |
| | | ! trunk/opends/resource/legal-notices/CDDLv1_0.txt |
| | | ! or http://forgerock.org/license/CDDLv1.0.html. |
| | | ! See the License for the specific language governing permissions |
| | | ! and limitations under the License. |
| | | ! |
| | | ! When distributing Covered Code, include this CDDL HEADER in each |
| | | ! file and include the License file at |
| | | ! trunk/opends/resource/legal-notices/CDDLv1_0.txt. If applicable, |
| | | ! add the following below this CDDL HEADER, with the fields enclosed |
| | | ! by brackets "[]" replaced with your own identifying information: |
| | | ! Portions Copyright [yyyy] [name of copyright owner] |
| | | ! |
| | | ! CDDL HEADER END |
| | | ! |
| | | ! Copyright 2013 ForgeRock AS. |
| | | ! --> |
| | | <stax> |
| | | <defaultcall function="main_replication_operations" /> |
| | | |
| | | <function name="main_replication_operations"> |
| | | <function-list-args> |
| | | <function-required-arg name="STAXParentID"/> |
| | | </function-list-args> |
| | | |
| | | <sequence> |
| | | <try> |
| | | <block name="'replication_operations'"> |
| | | <sequence> |
| | | <!--- Load the job environment for the test group execution --> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" /> |
| | | <call function="'loadJobEnvironment'"> |
| | | { 'parent' : STAXParentID } |
| | | </call> |
| | | <script> |
| | | CurrentTestPath['group']='replication_operations' |
| | | _group=CurrentTestPath['group'] |
| | | |
| | | </script> |
| | | <call function="'testGroup_Preamble'" /> |
| | | <script> |
| | | globalAssuredReplication = None |
| | | |
| | | if (REPLICATION_SPLIT_SERVERS == 'true'): |
| | | globalSplitServers = True |
| | | globalTestExternalChangelog = False |
| | | globalExternalChangelogMode = 'n/a' |
| | | else: |
| | | globalSplitServers = False |
| | | globalTestExternalChangelog = False |
| | | globalExternalChangelogMode = 'n/a' |
| | | |
| | | suiteList = [] |
| | | suiteList.append('basic') |
| | | </script> |
| | | |
| | | <!-- Run the test suites --> |
| | | <iterate var="_suite" in="suiteList"> |
| | | <sequence> |
| | | <try> |
| | | <sequence> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/%s/%s/%s_%s.xml' % (TESTS_DIR,_group,_suite,_group,_suite)"/> |
| | | <call function="'main_%s_%s' % (_group,_suite)" /> |
| | | </sequence> |
| | | <catch exception="'STAFException.TestSuite.SetupException'"> |
| | | <sequence> |
| | | <message log="1" level="'fatal'">'Setup of test suite %s failed.' % _suite</message> |
| | | </sequence> |
| | | </catch> |
| | | <catch exception="'STAFException.TestSuite.MainException'"> |
| | | <sequence> |
| | | <message log="1" level="'fatal'">'Main part of test suite %s failed.' % _suite</message> |
| | | </sequence> |
| | | </catch> |
| | | <catch exception="'STAFException.TestSuite.CleanupException'"> |
| | | <sequence> |
| | | <message log="1" level="'fatal'">'Cleanup of test suite %s failed.' % _suite</message> |
| | | </sequence> |
| | | </catch> |
| | | </try> |
| | | </sequence> |
| | | </iterate> |
| | | |
| | | </sequence> |
| | | </block> |
| | | <catch exception="'STAXException.TestGroupException'"> |
| | | <sequence> |
| | | <message log="1" level="'fatal'">'Execution of Test Group Failed'</message> |
| | | </sequence> |
| | | </catch> |
| | | <finally> |
| | | <!-- Test Group postamble --> |
| | | <call function="'testGroup_Postamble'"/> |
| | | </finally> |
| | | </try> |
| | | </sequence> |
| | | </function> |
| | | </stax> |