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

Gary Williams
05.00.2011 98f3a3355544dcd53ed37adcfa200f2fc736de0f
align ecl included attributes tests with issue OPENDJ-194
2 files modified
57 ■■■■ changed files
opends/tests/staf-tests/shared/functions/ldap.xml 2 ●●● patch | view | raw | blame | history
opends/tests/staf-tests/shared/functions/utils.xml 55 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/shared/functions/ldap.xml
@@ -3584,7 +3584,7 @@
        if attributes:
          STAFCmdParamsList.append('%s' % attributes)
        else:
          STAFCmdParamsList.append('"*" changeLogCookie targetEntryUUID')
          STAFCmdParamsList.append('"*" +')
 
        STAFCmdParams=' '.join(STAFCmdParamsList)
      </script>
opends/tests/staf-tests/shared/functions/utils.xml
@@ -3404,6 +3404,7 @@
        ecl_deleteOldRDN      = None
        ecl_newSuperior       = None
        ecl_changes           = None         
        ecl_includedttributes  = None
                
        if 'replicationcsn' in changelogEntry.keys():
          ecl_replicationCSN = changelogEntry['replicationcsn'][0]
@@ -3419,6 +3420,8 @@
          ecl_newSuperior = changelogEntry['newsuperior'][0]
        if 'changes' in changelogEntry.keys():
          ecl_changes = changelogEntry['changes'][0]
        if 'includedattributes' in changelogEntry.keys():
          ecl_includedAttributes = changelogEntry['includedattributes'][0]
      </script>
      
      <message>
@@ -3846,20 +3849,54 @@
      </if>
      
      <if expr="includeAttrs">
        <if expr="ecl_includedAttributes">
          <sequence>
            <!-- Decode the changes that are encoded in base64 -->
            <message>
              'checkChangelogEntry: Decode external changelog included attributes'
            </message>
            <call function="'Base64WithScript'">
              { 'location'    : myLocation,
                'dsPath'      : myPath,
                'subcommand'  : 'decode',
                'encodedData' : ecl_includedAttributes
              }
            </call>
            <!-- STAXResult is not always a list-->
            <script>
              try:
                decodeRC, decodedChanges = STAXResult[0]
              except AttributeError, details:
                decodedChanges = 'AttributeError: can not parse STAXResult %s' \
                                 % details
                decodeRC = '1'
            </script>
            <message>
              'checkChangelogEntry: Decoded changes:\n%s' % decodedChanges
            </message>
            <if expr="decodeRC == 0">
              <sequence>
                <call function="'parseLdifEntry'">
                  { 'ldifEntry' : decodedChanges }
                </call>
                <script>
                  ecl_includeAttrsMap = STAXResult
                </script>
                <message>
                  'Parsed changelog entry changes:  \n%s' % ecl_includeAttrsMap
                </message>
              </sequence>
            </if>
        <iterate var="attr" in="includeAttrs.keys()">
          <sequence>
            <message>
              'checkChangelogEntry: Checking include-attribute: %s' % attr
            </message>
                <message>'Matching included attribute %s.' % attr</message>
            <script>
              # included-attributes are preceded by 'target' prefix in the
              # changelog entry, e.g.: 'description' -> 'targetdescription'
              targetAttr    = 'target%s' % attr
                  targetAttr    = attr
              valueList     = includeAttrs[attr]
              ecl_valueList = None
              
              if targetAttr in changelogEntry.keys():
                ecl_valueList = changelogEntry[targetAttr]
                  if targetAttr in ecl_includeAttrsMap.keys():
                    ecl_valueList = ecl_includeAttrsMap[targetAttr]
                ecl_valueList.sort()
                valueList.sort()
            </script>
@@ -3932,6 +3969,8 @@
            </if>                    
          </sequence>
        </iterate>
          </sequence>
        </if>
      </if>
      
    </sequence>