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

mkeyes
26.19.2007 c729b1d84c1aeda63b4196480db7fe39a06c895f
Moved the functional-test shared/functions, shared/python, and shared/java directories to tests directory level.
The new location plus the modifications make up the merged libraries for the functional tests and the yet-to-be
committed stress tests.
3 files deleted
3 files added
24 files renamed
1 files modified
523 ■■■■■ changed files
opends/tests/functional-tests/shared/java/addAnEntry.class patch | view | raw | blame | history
opends/tests/functional-tests/shared/java/modifyAnAttribute.class patch | view | raw | blame | history
opends/tests/functional-tests/shared/java/modifyAnAttribute.java 214 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/staf-installer/config.py.stubs 4 ●●●● patch | view | raw | blame | history
opends/tests/shared/functions/baselib.xml patch | view | raw | blame | history
opends/tests/shared/functions/dsadm.xml 52 ●●●● patch | view | raw | blame | history
opends/tests/shared/functions/dsconfig.xml patch | view | raw | blame | history
opends/tests/shared/functions/environment.xml 2 ●●● patch | view | raw | blame | history
opends/tests/shared/functions/ldap.xml 151 ●●●●● patch | view | raw | blame | history
opends/tests/shared/functions/security.xml patch | view | raw | blame | history
opends/tests/shared/functions/signals.xml patch | view | raw | blame | history
opends/tests/shared/functions/stafcmd.xml patch | view | raw | blame | history
opends/tests/shared/functions/staxcmd.xml patch | view | raw | blame | history
opends/tests/shared/functions/tools.xml 100 ●●●●● patch | view | raw | blame | history
opends/tests/shared/functions/topology.xml patch | view | raw | blame | history
opends/tests/shared/functions/utils.xml patch | view | raw | blame | history
opends/tests/shared/java/addAnEntry.java patch | view | raw | blame | history
opends/tests/shared/java/parsingtool/ArrayData.java patch | view | raw | blame | history
opends/tests/shared/java/parsingtool/GenerateOpenDSTestSpecs.java patch | view | raw | blame | history
opends/tests/shared/java/parsingtool/ParseData.java patch | view | raw | blame | history
opends/tests/shared/java/parsingtool/README patch | view | raw | blame | history
opends/tests/shared/java/parsingtool/TestFileList.java patch | view | raw | blame | history
opends/tests/shared/java/parsingtool/WriteXMLFile_int.java patch | view | raw | blame | history
opends/tests/shared/java/parsingtool/WriteXMLFile_xml.java patch | view | raw | blame | history
opends/tests/shared/java/xmlToHtml/xmlToHtml.java patch | view | raw | blame | history
opends/tests/shared/python/common$py.class patch | view | raw | blame | history
opends/tests/shared/python/common.py patch | view | raw | blame | history
opends/tests/shared/python/replication$py.class patch | view | raw | blame | history
opends/tests/shared/python/replication.py patch | view | raw | blame | history
opends/tests/shared/python/security$py.class patch | view | raw | blame | history
opends/tests/shared/python/security.py patch | view | raw | blame | history
opends/tests/functional-tests/shared/java/addAnEntry.class
Binary files differ
opends/tests/functional-tests/shared/java/modifyAnAttribute.class
Binary files differ
opends/tests/functional-tests/shared/java/modifyAnAttribute.java
File was deleted
opends/tests/functional-tests/staf-installer/config.py.stubs
@@ -12,9 +12,9 @@
TESTS_ROOT                  = '%s/tests' % OPENDSDIR
TESTS_DIR                   = '%s/functional-tests' % TESTS_ROOT
TESTS_SHARED_DIR            = '%s/shared' % TESTS_DIR
TESTS_FUNCTIONS_DIR         = '%s/functions' % TESTS_SHARED_DIR
TESTS_FUNCTIONS_DIR         = '%s/shared/functions' % TESTS_ROOT
TESTS_DATA_DIR              = '%s/data' % TESTS_SHARED_DIR
TESTS_JAVA_DIR          = '%s/java' % TESTS_SHARED_DIR
TESTS_JAVA_DIR          = '%s/shared/java' % TESTS_ROOT
DIRECTORY_INSTANCE_DN       = '${opends.admin.dn}'
DIRECTORY_INSTANCE_PSWD     = '${opends.admin.pwd}'
DIRECTORY_INSTANCE_DIR      = '%s' % TMPDIR
opends/tests/shared/functions/baselib.xml
opends/tests/shared/functions/dsadm.xml
File was renamed from opends/tests/functional-tests/shared/functions/dsadm.xml
@@ -929,11 +929,15 @@
          'arguments' : STAFCmdParams
        }
      </call>
      <script>
        STAXCode=RC
        STAXReason=STAXResult
      </script>
      <call function="'checkRC'">
        { 'returncode' : RC ,
          'result'     : STAXResult }
        { 'returncode' : STAXCode ,
          'result'     : STAXReason }
      </call>
      <return>STAXReason</return>
    </sequence>
  </function>
@@ -1075,6 +1079,19 @@
        </function-arg-description>
        <function-arg-property name="type" value="option"/>
      </function-arg-def>
      <function-arg-def name="numLdapCheckTries" type="optional" default="10">
        <function-arg-description>
          Number of ldap check tries when checking if task is complete
        </function-arg-description>
        <function-arg-property name="type" value="option"/>
      </function-arg-def>
      <function-arg-def name="sleepBetweenLdapCheckTries" type="optional" default="2000">
        <function-arg-description>
          Sleep time in milliseconds between ldap check tries
        </function-arg-description>
        <function-arg-property name="type" value="option"/>
      </function-arg-def>
    </function-map-args>
    <sequence>
    
@@ -1172,7 +1189,9 @@
              'dsHost'     : dsInstanceHost,
              'dsPort'     : dsInstancePort,
              'dsBindDn'   : dsInstanceDn,
              'dsBindPswd' : dsInstancePswd }
              'dsBindPswd'        : dsInstancePswd,
              'noOfLoops'         : numLdapCheckTries,
              'sleepMilliSeconds' : sleepBetweenLdapCheckTries }
          </call>
        </sequence>
      </if>
@@ -2953,6 +2972,19 @@
        </function-arg-description>
        <function-arg-property name="type" value="string"/>
      </function-arg-def> 
      <function-arg-def name="noOfLoops" type="optional" default="10">
        <function-arg-description>
          Number of ldap check tries when checking if task is complete
        </function-arg-description>
        <function-arg-property name="type" value="integer"/>
      </function-arg-def>
      <function-arg-def name="sleepMilliSeconds" type="optional" default="2000">
        <function-arg-description>
          Sleep time in milliseconds between ldap check tries
        </function-arg-description>
        <function-arg-property name="type" value="integer"/>
      </function-arg-def>
    </function-map-args>
    <sequence>
@@ -3003,15 +3035,16 @@
      <script> 
        successPattern = re.compile('ds-task-state: COMPLETED_SUCCESSFULLY')
        stopErrPattern = re.compile('ds-task-state: STOPPED_BY_ERROR') 
        myCounter=1
      </script>
             
      <!-- Wait for the task to be COMPLETED_SUCCESSFULLY -->
      <script>taskRC=1</script>
      <loop from="1" to="10" while="taskRC != 0">
      <loop from="1" to="noOfLoops" while="taskRC != 0">
        <sequence>
        
          <message>
            '%s %s' % (STAFCmd, STAFCmdParams)
            'LOOP number %s - %s %s' % (myCounter, STAFCmd, STAFCmdParams)
          </message>
          <!-- Search for task status -->
@@ -3027,6 +3060,7 @@
          <script>
            STAFCmdRC=RC
            STAFCmdResult=STAXResult
            myCounter=myCounter+1
          </script>
            
          <if expr='re.search(successPattern, STAFCmdResult[0][1]) != None'>
@@ -3057,8 +3091,12 @@
                'result'     : STAFCmdResult }
          </call>
        
          <message>
            'Sleeping for %s ms' % sleepMilliSeconds
          </message>
          <call function="'Sleep'">
            { 'sleepForMilliSeconds' : '2000' }
            { 'sleepForMilliSeconds' : sleepMilliSeconds }
          </call>
          
        </sequence>
opends/tests/shared/functions/dsconfig.xml
opends/tests/shared/functions/environment.xml
File was renamed from opends/tests/functional-tests/shared/functions/environment.xml
@@ -97,7 +97,7 @@
      <!-- Load in the local shared python objects from libraries -->
      <script>
        sys.path.append("%s/python" % TESTS_SHARED_DIR )
        sys.path.append("%s/shared/python" % TESTS_ROOT )
        from common import *
        from security import *
        from replication import *
opends/tests/shared/functions/ldap.xml
File was renamed from opends/tests/functional-tests/shared/functions/ldap.xml
@@ -2687,6 +2687,13 @@
        <function-arg-property name="type" value="string"/>
    </function-arg-def>
   
    <function-arg-def name="suppressTestStatus" type="optional" default="0">
        <function-arg-description>
          Supress the call to checkTestRC
        </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
@@ -2756,18 +2763,160 @@
        STAXCode=RC
        STAXReason=STAXResult
      </script>
      <if expr="suppressTestStatus != '1'">
        <sequence>
      <call function="'checktestRC'">
        { 'returncode' : STAXCode ,
          'result'     : STAXReason,
          'expected'   : expectedRC }
      </call>
        </sequence>
      </if>
      <return>
        STAXReason
        [STAXCode,STAXReason]
      </return>
    </sequence>
    
  </function>
  
  <!-- Create a load on Directory with modifies -->
  <function name="loadOfModifies">
    <function-prolog>
      This function creates a load of modifies against Directory. It is only for entries with uid=user.xxx.
    </function-prolog>
    <function-map-args>
      <function-arg-def name="location" type="optional" default="STAF_REMOTE_HOSTNAME">
        <function-arg-description>
          Location of target host
        </function-arg-description>
        <function-arg-property name="type" value="hostname"/>
      </function-arg-def>
      <function-arg-def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
        <function-arg-description>
          Pathname to installation root
        </function-arg-description>
        <function-arg-property name="type" value="filepath"/>
      </function-arg-def>
      <function-arg-def name="dsInstanceHost" type="optional" default="STAF_REMOTE_HOSTNAME">
        <function-arg-description>
          Directory server hostname or IP address
        </function-arg-description>
    <function-arg-property name="type" value="hostname"/>
      </function-arg-def>
      <function-arg-def name="dsInstancePort" type="required">
        <function-arg-description>
          Directory server port number
        </function-arg-description>
        <function-arg-property name="type" value="Port number"/>
      </function-arg-def>
      <function-arg-def name="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="dsInstancePswd" type="required">
        <function-arg-description>
          Bind password
        </function-arg-description>
        <function-arg-property name="type" value="string"/>
      </function-arg-def>
     <function-arg-def name="partialDNToModify" type="required">
        <function-arg-description>
          partial DN to modify, all but the uid=user.xxxx
        </function-arg-description>
        <function-arg-property name="type" value="DN"/>
      </function-arg-def>
      <function-arg-def name="attributeName" type="optional">
        <function-arg-description>
          Attribute to modify
        </function-arg-description>
        <function-arg-property name="type" value="string"/>
      </function-arg-def>
     <function-arg-def name="newAttributeValue" type="optional">
        <function-arg-description>
          New Attribute Value
        </function-arg-description>
        <function-arg-property name="type" value="string"/>
      </function-arg-def>
     <function-arg-def name="listAttributes" type="optional" default="' '">
       <function-arg-description>
         List of attributes name and value to modify. The format is name:value
       </function-arg-description>
       <function-arg-property name="type" value="string"/>
     </function-arg-def>
    <function-arg-def name="changetype" type="required">
        <function-arg-description>
          Type of modification, can be delete, add, replace
        </function-arg-description>
        <function-arg-property name="type" value="string"/>
    </function-arg-def>
    <function-arg-def name="numEntries" type="required">
        <function-arg-description>
          Number of entries to modify
        </function-arg-description>
        <function-arg-property name="type" value="string"/>
    </function-arg-def>
    <function-arg-def name="clientID" type="optional">
        <function-arg-description>
          ID for the client doing the modify
        </function-arg-description>
        <function-arg-property name="type" value="string"/>
    </function-arg-def>
    <function-arg-def name="expectedRC" type="optional" default="0">
      <function-arg-description>
        Expected return code value. Default value is 0
      </function-arg-description>
      <function-arg-property name="type" value="string"/>
    </function-arg-def>
    </function-map-args>
    <sequence>
      <script>
        import random
        curr_rdn_num=random.randint(0,99)
        curr_dn="uid=user.%s,%s" % (curr_rdn_num, partialDNToModify)
      </script>
      <message>
        '****From client, %s, Modifying %s' % (clientID,curr_dn)
      </message>
      <call function="'modifyAnAttribute'">
            { 'dsInstanceHost'         : DIRECTORY_INSTANCE_HOST ,
              'dsInstancePort'         : DIRECTORY_INSTANCE_PORT ,
              'dsInstanceDn'           : DIRECTORY_INSTANCE_DN ,
              'dsInstancePswd'         : DIRECTORY_INSTANCE_PSWD ,
              'DNToModify'             : curr_dn ,
              'attributeName'          : 'description' ,
              'newAttributeValue'      : 'New description for %s' % curr_dn ,
              'changetype'             : 'replace'  ,
              'suppressTestStatus'     : '1' }
       </call>
       <return>
        [STAXCode,STAXReason]
       </return>
    </sequence>
  </function>
  
  <!-- Add a New entry-->
  <function name="addAnEntry">
opends/tests/shared/functions/security.xml
opends/tests/shared/functions/signals.xml
old mode 100644 new mode 100755
opends/tests/shared/functions/stafcmd.xml
opends/tests/shared/functions/staxcmd.xml
opends/tests/shared/functions/tools.xml
old mode 100644 new mode 100755
File was renamed from opends/tests/functional-tests/shared/functions/tools.xml
@@ -103,7 +103,7 @@
          STAFCmdParamsList.append('-t %s' % templateFile)
        
        if ldifFile:
          STAFCmdParamsList.append('-o "%s"' % ldifFile)
          STAFCmdParamsList.append('-o %s' % ldifFile)
        
        if randomSeed:
          STAFCmdParamsList.append('-s "%s"' % randomSeed)
@@ -121,7 +121,8 @@
        }
      </call>
      <script>
        STAXCode, STAXReason=STAXResult
         STAXCode=RC
         STAXReason=STAXResult
      </script>
      <if expr="STAXCode != 0">
        <sequence>
@@ -130,11 +131,106 @@
          </message>
        </sequence>
      </if>
      <call function="'checktestRC'">
       { 'returncode' : STAXCode ,
         'result'     : STAXReason }
      </call>
      <return>[STAXCode, STAXReason]</return>
    </sequence>
  </function> 
  
  
  <!-- This function uses make ldif to generate LDIF data files -->
  <function name="MakeAMakeLdifTemplate">
    <function-prolog>
      This function makes a make-ldif template file
    </function-prolog>
    <function-map-args>
      <function-arg-def name="numEntries" type="required">
        <function-arg-description>
          Number of entries
        </function-arg-description>
        <function-arg-property name="type" value="string"/>
      </function-arg-def>
      <function-arg-def name="templateFile" type="required">
        <function-arg-description>
          Template file name
        </function-arg-description>
        <function-arg-property name="type" value="filename"/>
      </function-arg-def>
      <function-arg-def name="extraLine" type="optional">
        <function-arg-description>
          Extra line to add to the mkae-ldif template
        </function-arg-description>
        <function-arg-property name="type" value="string"/>
      </function-arg-def>
    </function-map-args>
    <sequence>
      <!-- Build the import task configuration object -->
      <script>
        ldifLines=[]
        ldifLines.append('define suffix=%s' % DIRECTORY_INSTANCE_SFX)
        ldifLines.append('define maildomain=example.com')
        ldifLines.append('define numusers=%s' % numEntries )
        ldifLines.append('')
        ldifLines.append('branch: [suffix]')
        ldifLines.append('')
        ldifLines.append('branch: ou=People,[suffix]')
        ldifLines.append('subordinateTemplate: person:[numusers]')
        ldifLines.append('')
        ldifLines.append('template: person')
        ldifLines.append('rdnAttr: uid')
        ldifLines.append('objectClass: top')
        ldifLines.append('objectClass: person')
        ldifLines.append('objectClass: organizationalPerson')
        ldifLines.append('objectClass: inetOrgPerson')
        ldifLines.append('givenName: &lt;first&gt;')
        ldifLines.append('sn: &lt;last&gt;')
        ldifLines.append('employeeNumber: &lt;sequential:0&gt;')
        ldifLines.append('cn: {givenName} {sn} {employeeNumber}')
        ldifLines.append('uid: user.{employeeNumber}')
        ldifLines.append('mail: {uid}@[maildomain]')
        ldifLines.append('telephoneNumber: &lt;random:telephone&gt;')
        ldifLines.append('description: This is the description for user.{employeeNumber}.')
        if extraLine:
          ldifLines.append('%s' % extraLine)
      </script>
      <!-- Write out the make-ldif template file -->
      <script>
        outfile = open(templateFile,"w")
        for line in ldifLines:
          outfile.write("%s\n" % line)
        outfile.close()
      </script>
      <script>
        STAXCode=RC
        STAXReason=STAXResult
      </script>
      <if expr="STAXCode != 0">
        <sequence>
          <message level="'error'">
            'creation of a make-ldif template failed (Code=%s,Reason=%s).' % (STAXCode,STAXReason)
          </message>
        </sequence>
      </if>
      <call function="'checktestRC'">
      { 'returncode' : STAXCode ,
        'result'     : STAXReason }
      </call>
      <return>[STAXCode, STAXReason]</return>
    </sequence>
  </function>
  <!-- This function compares two LDIF files using the ldif-diff script -->
  <function name="LdifDiffWithScript">
    <function-prolog>
opends/tests/shared/functions/topology.xml
opends/tests/shared/functions/utils.xml
opends/tests/shared/java/addAnEntry.java
opends/tests/shared/java/parsingtool/ArrayData.java
opends/tests/shared/java/parsingtool/GenerateOpenDSTestSpecs.java
opends/tests/shared/java/parsingtool/ParseData.java
opends/tests/shared/java/parsingtool/README
opends/tests/shared/java/parsingtool/TestFileList.java
opends/tests/shared/java/parsingtool/WriteXMLFile_int.java
opends/tests/shared/java/parsingtool/WriteXMLFile_xml.java
opends/tests/shared/java/xmlToHtml/xmlToHtml.java
opends/tests/shared/python/common$py.class
Binary files differ
opends/tests/shared/python/common.py
opends/tests/shared/python/replication$py.class
Binary files differ
opends/tests/shared/python/replication.py
opends/tests/shared/python/security$py.class
Binary files differ
opends/tests/shared/python/security.py