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

al_xipe
29.20.2007 f3f0db71ca1b8185be5125cd597c1367095edf9e
1. fix for wrapping log lines around. Now take pre-existing \n into account
2. removed python unused Matcher class
3. fix for testcase identification to start dumping the STAX log into test-log.xml
4. fix for indexes test cases (added -n to dsconfig)

2 files modified
35 ■■■■■ changed files
opends/tests/functional-tests/shared/functions/dsconfig.xml 6 ●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/functions/utils.xml 29 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/functions/dsconfig.xml
@@ -1308,7 +1308,7 @@
        dsconfigCmd=''
        dsBinPath='%s/%s' % (dsPath,fileFolder)
        dsconfigCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
        dsconfigParams = 'create-je-index -h %s -p %s -D "%s" -w %s --backend-name %s --index-name %s --set index-type:%s' % (host,port,rootDN,rootPwd,backendID, indexAttribute, ' --set index-type:'.join(indexTypes))
        dsconfigParams = 'create-je-index -n -h %s -p %s -D "%s" -w %s --backend-name %s --index-name %s --set index-type:%s' % (host,port,rootDN,rootPwd,backendID, indexAttribute, ' --set index-type:'.join(indexTypes))
      </script>
      
      <call function="'_dsconfigCommonArgs'" />
@@ -1439,7 +1439,7 @@
        operationArguments = indexProperty
        if indexPropertyValue:
          operationArguments = '%s:%s' % (indexProperty, indexPropertyValue)
        dsconfigParams = 'set-je-index-prop -h %s -p %s -D "%s" -w %s --backend-name %s --index-name %s --%s %s' % ( host, port, rootDN, rootPwd, backendID, indexAttribute, operation, operationArguments )
        dsconfigParams = 'set-je-index-prop -n -h %s -p %s -D "%s" -w %s --backend-name %s --index-name %s --%s %s' % ( host, port, rootDN, rootPwd, backendID, indexAttribute, operation, operationArguments )
      </script>
      <call function="'_dsconfigCommonArgs'" />
      <call function="'runCommand'">
@@ -1537,7 +1537,7 @@
        dsconfigCmd=''
        dsBinPath='%s/%s' % (dsPath,fileFolder)
        dsconfigCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
        dsconfigParams = 'delete-je-index -h %s -p %s -D "%s" -w %s --backend-name %s --index-name %s' % (host,port,rootDN,rootPwd,backendID, indexAttribute)
        dsconfigParams = 'delete-je-index -n -h %s -p %s -D "%s" -w %s --backend-name %s --index-name %s' % (host,port,rootDN,rootPwd,backendID, indexAttribute)
      </script>
      <call function="'_dsconfigCommonArgs'" />
      <call function="'runCommand'">
opends/tests/functional-tests/shared/functions/utils.xml
@@ -117,7 +117,7 @@
            </sequence>
          </if>        
          <message log="1">
            'SUCCESS: RC=%s, Expected %s, Result=%s' % (returncode,expected,result)
            'SUCCESS: RC=%s, Expected %s' % (returncode,expected)
          </message>
          <script>
            RC=0
@@ -626,16 +626,6 @@
          'endat'     : testcaseEndTime }
      </call>
      <script>
        import re
        class Matcher:
          def search(self, r,s):
            _tmp = re.compile(r)
            self.value = _tmp.match(s)
            return self.value
          def __getitem__(self, i):
            return self.value.group(i)
        class Test:
          def __init__(self, group, suite, fullname, start, stop, failures, successes, issues, duration):
            self.log=''
@@ -692,14 +682,15 @@
            return xml
          
          def appendLog(self, category, log):
            _leftPadding=''
            wrappedLog=''
            while len(log)>100:
              _logChunk=log[:100]
              log=log[100:]
              wrappedLog+='%s%s%s' % (_leftPadding,_logChunk,newLine)
              _leftPadding='...    '
            wrappedLog += '%s%s%s' % (_leftPadding,log,newLine)
            for _line in log.splitlines():
              _leftPadding=''
              while len(_line)>100:
                _logChunk=line[:100]
                _line=_line[100:]
                wrappedLog+='%s%s%s' % (_leftPadding,_logChunk,newLine)
                _leftPadding='...    '
              wrappedLog += '%s%s%s' % (_leftPadding,log,newLine)
            if category == 'access':
              self.access+=wrappedLog
            elif category == 'error':
@@ -737,7 +728,7 @@
            # test case. this is especially useful for tests that execute
            # within the same second (that is the resolution of the STAF
            # log facility)
            if tmp[3] == thisTest.getName():
            if thisTest.getName().startswith(tmp[3]):
              doLog=True
        
        # parse the server's error log