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

ludovicp
28.47.2010 6da4b9ae01dc9d49246ee506abf520e6d1ce85df
Update tests
8 files modified
242 ■■■■■ changed files
opends/tests/staf-tests/functional-tests/testcases/backends/restore-tasks/restore-tasks_tests.xml 3 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/indexes/indexes.xml 187 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/replication/externalchangelog/externalchangelog_common_ecl_tests.xml 2 ●●● patch | view | raw | blame | history
opends/tests/staf-tests/shared/functions/security.xml 11 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/shared/functions/tools.xml 29 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/shared/functions/utils.xml 6 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/shared/java/ldapjdk/PSearch.java patch | view | raw | blame | history
opends/tests/staf-tests/shared/java/ldapjdk/PSearchOperations.java 4 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/backends/restore-tasks/restore-tasks_tests.xml
@@ -85,7 +85,8 @@
              'dsInstanceDn'        : DIRECTORY_INSTANCE_DN,
              'dsInstancePswd'      : DIRECTORY_INSTANCE_PSWD,
              'backupDir'           : '%s/backends/backup1' % remote.data,
              'extraParams'         : '--completionNotify foo@example.com'
              'extraParams'         : '--completionNotify foo@example.com',
              'knownIssue'          : '6947587'
            }
          </call>
          
opends/tests/staf-tests/functional-tests/testcases/indexes/indexes.xml
@@ -42,10 +42,10 @@
        <script>
          CurrentTestPath['group'] = 'indexes'
          envAlreadyLoaded='true'
          _testSteps=['indexes_setup','indexes_search','indexes_dynamic_modify',
                      'indexes_dynamic_add','indexes_remove','indexes_add',
                      'indexes_modify','indexes_entry_limit',
                      'indexes_vlv_add', 'indexes_cleanup']
          _testSteps=['indexes_setup','indexes_search','indexes_modify',
                      'indexes_dynamic_modify','indexes_add',
                      'indexes_dynamic_add','indexes_remove',
                      'indexes_entry_limit','indexes_vlv_add','indexes_cleanup']
        </script>
        <!---
          #@TestSuiteName      Indexes
@@ -191,6 +191,55 @@
            <call function="'loopThroughFilters'">
                { 'filters' : 'after-modify' }
            </call>
            <testcase name="getTestCaseName('Restore and rebuild uid index')">
              <sequence>
                <call function="'testCase_Preamble'"/>
                <call function="'runFunction'">
                  { 'functionName'      : 'modifyIndex',
                    'functionMessage'   : 'Adding substring index to attribute uid',
                    'functionArguments' : { 'operation'          : 'remove',
                                            'indexAttribute'     : 'uid',
                                            'indexProperty'      : 'index-type',
                                            'indexPropertyValue' : 'substring'
                                          }
                  }
                </call>
                <call function="'runFunction'">
                  { 'functionName'      : 'StopDsWithScript',
                    'functionArguments' : { 'location'    : STAF_REMOTE_HOSTNAME,
                                            'dsHost'      : DIRECTORY_INSTANCE_HOST,
                                            'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
                                            'dsBindDN'    : DIRECTORY_INSTANCE_DN  ,
                                            'dsBindPwd'   : DIRECTORY_INSTANCE_PSWD }
                  }
                </call>
                <call function="'runFunction'">
                  { 'functionName'      : 'rebuildIndexWithScript' ,
                    'functionArguments' : { 'dsBaseDN'    : DIRECTORY_INSTANCE_SFX ,
                                            'dsIndexList' : [ 'uid' ] ,
                                            'knownIssue'  : '6931704'
                                          }
                  }
                </call>
                <call function="'runFunction'">
                  { 'functionName'      : 'StartDsWithScript',
                    'functionArguments' : { 'location' : STAF_REMOTE_HOSTNAME }
                  }
                </call>
                <!--- Check that DS started -->
                <call function="'isAlive'">
                  {
                  'noOfLoops'        : 10 ,
                  'noOfMilliSeconds' : 2000
                  }
                </call>
                <call function="'testCase_Postamble'"/>
              </sequence>
            </testcase>
          </sequence>
          <catch exception="'STAXException.LDAP.ModifyException'">
            <message log="1" level="'fatal'">
@@ -273,6 +322,55 @@
            <call function="'loopThroughFilters'">
              { 'filters' : 'after-modify' }
            </call>
            <testcase name="getTestCaseName('Restore and rebuild uid index')">
              <sequence>
                <call function="'testCase_Preamble'"/>
                <call function="'runFunction'">
                  { 'functionName'      : 'modifyIndex',
                    'functionMessage'   : 'Adding substring index to attribute uid',
                    'functionArguments' : { 'operation'          : 'remove',
                                            'indexAttribute'     : 'uid',
                                            'indexProperty'      : 'index-type',
                                            'indexPropertyValue' : 'substring'
                                          }
                  }
                </call>
                <call function="'runFunction'">
                  { 'functionName'      : 'StopDsWithScript',
                    'functionArguments' : { 'location'    : STAF_REMOTE_HOSTNAME,
                                            'dsHost'      : DIRECTORY_INSTANCE_HOST,
                                            'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
                                            'dsBindDN'    : DIRECTORY_INSTANCE_DN  ,
                                            'dsBindPwd'   : DIRECTORY_INSTANCE_PSWD }
                  }
                </call>
                <call function="'runFunction'">
                  { 'functionName'      : 'rebuildIndexWithScript' ,
                    'functionArguments' : { 'dsBaseDN'    : DIRECTORY_INSTANCE_SFX ,
                                            'dsIndexList' : [ 'uid' ] ,
                                            'knownIssue'  : '6931704'
                                          }
                  }
                </call>
                <call function="'runFunction'">
                  { 'functionName'      : 'StartDsWithScript',
                    'functionArguments' : { 'location' : STAF_REMOTE_HOSTNAME }
                  }
                </call>
                <!--- Check that DS started -->
                <call function="'isAlive'">
                  {
                  'noOfLoops'        : 10 ,
                  'noOfMilliSeconds' : 2000
                  }
                </call>
                <call function="'testCase_Postamble'"/>
              </sequence>
            </testcase>
          </sequence>
          <catch exception="'STAXException.LDAP.ModifyException'">
            <message log="1" level="'fatal'">
@@ -321,7 +419,7 @@
              { 'filters' : 'before-add' }
            </call>
            <testcase name="getTestCaseName('Add and rebuild uid index')">
            <testcase name="getTestCaseName('Add and rebuild l index')">
              <sequence>
                <call function="'testCase_Preamble'"/>
@@ -373,6 +471,21 @@
            <call function="'loopThroughFilters'">
              { 'filters' : 'after-add' }
            </call>
            <testcase name="getTestCaseName('Remove l index and rebuild all indexes')">
              <sequence>
                <call function="'testCase_Preamble'"/>
                <call function="'runFunction'">
                  { 'functionName'      : 'removeIndex',
                    'functionMessage'   : 'Removing index on attribute l' ,
                    'functionArguments' : { 'indexAttribute'    : 'l' }
                  }
                </call>
                <call function="'testCase_Postamble'"/>
              </sequence>
            </testcase>
          </sequence>
          <catch exception="'STAXException.LDAP.AddIndexException'">
            <message log="1" level="'fatal'">
@@ -458,6 +571,21 @@
            <call function="'loopThroughFilters'">
                { 'filters' : 'after-add' }
            </call>
            <testcase name="getTestCaseName('Remove l index and rebuild all indexes')">
              <sequence>
                <call function="'testCase_Preamble'"/>
                <call function="'runFunction'">
                  { 'functionName'      : 'removeIndex',
                    'functionMessage'   : 'Removing index on attribute l' ,
                    'functionArguments' : { 'indexAttribute'    : 'l' }
                  }
                </call>
                <call function="'testCase_Postamble'"/>
              </sequence>
            </testcase>
          </sequence>
          <catch exception="'STAXException.LDAP.AddIndexException'">
            <message log="1" level="'fatal'">
@@ -501,6 +629,55 @@
        <try>
          <sequence>
            <testcase name="getTestCaseName('Add and rebuild l index')">
              <sequence>
                <call function="'testCase_Preamble'"/>
                <call function="'runFunction'">
                  { 'functionName'      : 'addIndex',
                    'functionMessage'   : 'Adding presence and equality index to \
                                           attribute l',
                    'functionArguments' : { 'indexAttribute'    : 'l',
                                            'indexTypes'        : [ 'presence',
                                                                    'equality' ]
                                          }
                  }
                </call>
                <call function="'runFunction'">
                  { 'functionName'      : 'StopDsWithScript',
                    'functionArguments' : { 'location'    : STAF_REMOTE_HOSTNAME,
                                            'dsHost'      : DIRECTORY_INSTANCE_HOST,
                                            'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
                                            'dsBindDN'    : DIRECTORY_INSTANCE_DN,
                                            'dsBindPwd'   : DIRECTORY_INSTANCE_PSWD
                                          }
                  }
                </call>
                <call function="'runFunction'">
                  { 'functionName'      : 'rebuildIndexWithScript' ,
                    'functionArguments' : { 'dsBaseDN'    : DIRECTORY_INSTANCE_SFX ,
                                            'dsIndexList' : [ 'l' ] ,
                                            'knownIssue'  : '6931704'
                                          }
                  }
                </call>
                <call function="'runFunction'">
                  { 'functionName'      : 'StartDsWithScript',
                    'functionArguments' : { 'location' : STAF_REMOTE_HOSTNAME }
                  }
                </call>
                <!--- Check that DS started -->
                <call function="'isAlive'">
                  {
                  'noOfLoops'        : 10 ,
                  'noOfMilliSeconds' : 2000
                  }
                </call>
                <call function="'testCase_Postamble'"/>
              </sequence>
            </testcase>
            <call function="'loopThroughFilters'">
              { 'filters' : 'before-remove' }
            </call>
opends/tests/staf-tests/functional-tests/testcases/replication/externalchangelog/externalchangelog_common_ecl_tests.xml
@@ -10930,7 +10930,7 @@
                # 'employeenumber' contained no value prior to the modify op, so
                # expect NO 'targetemployeenumber' include-attr to be present
                # in the changelog entry
                myMissingIncAttrs      = [incAttr[0]]
                myMissingIncAttrs      = [incAttrs[0]]
                
                if ecl_mode != 'opends':
                  myChangeNumber       = searchIndex
opends/tests/staf-tests/shared/functions/security.xml
@@ -393,7 +393,9 @@
        listAttr.append('userCertificate;binary:: %s' % ret_str)
      </script>
      <!-- Create the ldif -->
      <message>
        'Create %s/client.ldif' % local.temp
      </message>
      <script>
        addCertificateldif='%s/client.ldif' % local.temp
        outfile = open(addCertificateldif,"w")
@@ -402,10 +404,13 @@
        outfile.close()
      </script>
      <message>
        'Copy  %s/client.ldif to %s' % (local.temp,ldif_path)
      </message>
      <call function="'copyFile'">
        {
        'location'   : STAXServiceMachine,
        'srcfile'    : '%s/client-cert.ldif' % local.temp,
        'srcfile'    : '%s/client.ldif' % local.temp,
        'destfile'   : ldif_path,
        'remotehost' : STAF_REMOTE_HOSTNAME
        }
@@ -417,7 +422,7 @@
          'dsInstancePort'    : DIRECTORY_INSTANCE_PORT,
          'dsInstanceDn'      : DIRECTORY_INSTANCE_DN,
          'dsInstancePswd'    : DIRECTORY_INSTANCE_PSWD,
          'entryToBeModified' : addCertificateldif,
          'entryToBeModified' : ldif_path,
          'expectedRC'        :  0
        }
      </call>
opends/tests/staf-tests/shared/functions/tools.xml
@@ -1038,14 +1038,26 @@
    </function-list-args>
      
    <sequence>
      <!-- Check if using coverage in which case we'll avoid doing parallele iterate -->
      <!-- Check if 'emma.jar' exists -->
      <call function="'GetEntry'">
        {
        'location'  : STAF_REMOTE_HOSTNAME ,
        'entry'     : '%s/%s/lib/emma.jar' % (serverList[0].getDir(),OPENDSNAME) ,
        'attribute' : 'TYPE'
        }
      </call>
      <if expr="RC != 48">
        <!-- 'emma.jar' exists -->
        <script>coverage = True</script>
        <else>
          <script>coverage = False</script>
        </else>
      </if>
      <message>'tools.xml - coverage=%s' % coverage</message>
      <!-- Start the servers in the list -->    
      <script>
        # check if using coverage in which case we'll avoid doing parallele iterate
        coverage = False
        if os.path.exists(os.path.join(serverList[0].getDir(),OPENDSNAME,'lib','emma.jar')):
          coverage = True
        print 'tools.xml - coverage=%s' % coverage
      </script>
      <if expr="coverage == True">
        <sequence>
          <message>'starting servers in sequence using "iterate"'</message>
@@ -1595,7 +1607,8 @@
              'dsInstanceDn'        : dsInstanceDn ,
              'dsInstancePswd'      : dsInstancePswd ,
              'dsInfo'              : taskId ,
              'dsQuiet'             : 'True'
              'dsQuiet'             : 'True' ,
              'expectedRC'          : 'noCheck'
            }
          </call>
          
opends/tests/staf-tests/shared/functions/utils.xml
@@ -4017,13 +4017,13 @@
          STAFCmdParamsList.append('-p %s' % dsInstancePort)
        if dsInstanceDn:
          STAFCmdParamsList.append('-D %s' % dsInstanceDn)
          STAFCmdParamsList.append('-D "%s"' % dsInstanceDn)
        if dsBaseDn:
          STAFCmdParamsList.append('-b %s' % dsBaseDn)
          STAFCmdParamsList.append('-b "%s"' % dsBaseDn)
        if dsInstancePswd:
          STAFCmdParamsList.append('-w %s' % dsInstancePswd)
          STAFCmdParamsList.append('-w "%s"' % dsInstancePswd)
        if display:
          STAFCmdParamsList.append('-s')
opends/tests/staf-tests/shared/java/ldapjdk/PSearch.java
opends/tests/staf-tests/shared/java/ldapjdk/PSearchOperations.java
@@ -139,7 +139,7 @@
              write("[Thread id: " + threadId + "] \n" + getDate() + connection);
        } catch (LDAPException ex) {
            System.out.println("[Thread id: " + threadId + "]Connection :" + ex.getMessage());
            System.exit(0);
            System.exit(1);
        }
    }
    /**
@@ -190,7 +190,7 @@
            res = connection.search(suffix, LDAPv3.SCOPE_SUB, "(objectclass=*)", null, false, cons);
        } catch (LDAPException ex) {
            System.out.println("[Thread id: " + threadId + "]LDAPSearch :" + ex.getMessage());
            System.exit(0);
            System.exit(1);
        }
        return res;
    }