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

Christophe Sovant
07.46.2013 b1688574f485d74bdc24a169b3a672489e9ce5cc
CR-1382 Fix for fractional-replication testsuite on Windows
2 files modified
99 ■■■■ changed files
opends/tests/staf-tests/functional-tests/testcases/clu/clu_rebuild-index_checkbehavior.xml 30 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/fractional-replication/config.xml 69 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/clu/clu_rebuild-index_checkbehavior.xml
@@ -759,7 +759,7 @@
              #@TestMarker          rebuild-index check behavior tests
              #@TestName            rebuild-index: clearDegradedState option in 
                                    offline mode
              #@TestIssue           OPENDJ-770
              #@TestIssue           none
              #@TestPurpose         Verify that rebuild-index command succeeds
                                    and that the output is correct.
              #@TestPreamble        none
@@ -931,13 +931,12 @@
                </script>
                <script>
                  msg = 'Degraded state for index(es) l, homePhone has been removed'
                  msg = 'Degraded state of index\(es\) \[l, homePhone\] has been cleared'
                </script>
                <call function="'searchString'">
                  {
                  'returnString'   : returnString ,
                  'expectedString' : msg ,
                  'knownIssue'     : 'OPENDJ-770'
                  'expectedString' : msg
                  }
                </call>
                
@@ -1120,7 +1119,7 @@
              #@TestMarker          rebuild-index check behavior tests
              #@TestName            rebuild-index: clearDegradedState option in 
                                    online mode
              #@TestIssue           OPENDJ-770
              #@TestIssue           OPENDJ-802
              #@TestPurpose         Verify that rebuild-index command succeeds
                                    and that the output is correct.
              #@TestPreamble        none
@@ -1240,16 +1239,29 @@
                </script>
                <script>
                  msg = 'Degraded state for index pager has been removed'
                  msg = 'Degraded state of index\(es\) \[pager\] has been cleared'
                </script>
                <call function="'searchString'">
                  {
                  'returnString'   : returnString ,
                  'expectedString' : msg
                  }
                </call>
                <script>
                  msg = 'The backend userRoot is now taken offline'
                </script>
                <call function="'searchString'">
                  {
                  'returnString'   : returnString ,
                  'expectedString' : msg ,
                  'knownIssue'     : 'OPENDJ-770'
                  'expectedRC'     : 1 ,
                  'knownIssue'     : 'OPENDJ-802'
                  }
                </call>
                <call function="'testStep'">
                    { 'stepMessage' : 'Check index status using dbtest command after rebuild' }
                </call>            
@@ -1416,7 +1428,7 @@
                <script>
                  msg1 = 'Option \"--rebuildAll\" cannot be specified with'
                  msg2 = 'the \"--clearDegradedState\"\noption'
                  msg2 = 'the \"--clearDegradedState\"%soption' % newLine
                </script>
                <call function="'searchString'">
                  {
@@ -1480,7 +1492,7 @@
                <script>
                  msg1 = 'Option \"--rebuildDegraded\" cannot be specified with'
                  msg2 = 'the \"--clearDegradedState\"\noption'
                  msg2 = 'the \"--clearDegradedState\"%soption' % newLine
                </script>
                <call function="'searchString'">
                  {
opends/tests/staf-tests/functional-tests/testcases/fractional-replication/config.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "../../../../shared/stax.dtd">
<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
<!--
 ! CDDL HEADER START
 !
@@ -24,7 +24,7 @@
 ! CDDL HEADER END
 !
 !      Copyright 2009 Sun Microsystems, Inc.
 !      Portions Copyright 2012 ForgeRock AS
 !      Portions Copyright 2012-2013 ForgeRock AS
 ! -->
<stax>
  <defaultcall function="fractional-replication_config"/>
@@ -649,25 +649,61 @@
            'server'            : server,
          }
        </call>
        <script>
          # generating fractional-exclude option for all optional regardless of objectClass
          excludeAllOptional = '*:'+','.join(schemaMap[ldapServer].allmay)
          excludeAllOptional = schemaMap[ldapServer].allmay
        </script>
        <message>'%s' % len(excludeAllOptional)</message>
        <!-- On Windows, we will add attribtues split the list to avoid command line too long -->
        <if expr="is_windows_platform(server.getHostname())">
          <sequence>
        <call function="'set-ops-fractional-replication-attributes'">
          {
            "server"            : server,
            "replicationDomain" : domainMap[ldapServer][0],
            "include"           : [('reset',None)],
            "exclude"           : [('set',excludeAllOptional)],
                "exclude"           : [('set','*:' + excludeAllOptional[0])],
            "expectedRC"        : 0
          }
        </call>
            <script>
              lenSubList = 10
            </script>
            <iterate var="attrs" in="[excludeAllOptional[x:x+lenSubList] for x in xrange(1, len(excludeAllOptional), lenSubList)]">
                <call function="'set-ops-fractional-replication-attributes'">
                  {
                    "server"            : server,
                    "replicationDomain" : domainMap[ldapServer][0],
                    "include"           : [('reset',None)],
                    "exclude"           : [('add','*:' + attr) for attr in attrs],
                    "expectedRC"        : 0
                  }
                </call>
            </iterate>
          </sequence>
          <else>
            <call function="'set-ops-fractional-replication-attributes'">
              {
                "server"            : server,
                "replicationDomain" : domainMap[ldapServer][0],
                "include"           : [('reset',None)],
                "exclude"           : [('set','*:'+','.join(excludeAllOptional))],
                "expectedRC"        : 0
              }
            </call>
          </else>
        </if>
        <call function="'get-fractional-replication-attributes'">
          {
            "replicationDomain" : domainMap[ldapServer][0],
            "server"            : server,
          }
        </call>
        <script>
          # generating fractional-exclude option for all optional regardless of objectClass
          from java.util import Random
@@ -687,8 +723,28 @@
              objClassesMay.append(schemaMap[ldapServer].objDict[objClass] + ':' + ','.join(mixMayAttrs))
            else:
              objClassesMay.append(objClass + ':' + ','.join(mixMayAttrs))
          excludeAllObjClassesMay = ','.join(objClassesMay)
        </script>
        <message>'%s' % len(objClassesMay)</message>
        <!-- On Windows, we will add attribtues split the list to avoid command line too long -->
        <if expr="is_windows_platform(server.getHostname())">
          <sequence>
            <script>
              lenSubList = 10
            </script>
            <iterate var="ocs" in="[objClassesMay[x:x+lenSubList] for x in xrange(0, len(objClassesMay), lenSubList)]">
              <call function="'set-ops-fractional-replication-attributes'">
                {
                  "server"            : server,
                  "replicationDomain" : domainMap[ldapServer][0],
                  "include"           : [('reset',None)],
                  "exclude"           : [('add',oc) for oc in ocs],
                  "expectedRC"        : 0
                }
              </call>
            </iterate>
          </sequence>
          <else>
        <call function="'set-ops-fractional-replication-attributes'">
          {
            "server"            : server,
@@ -698,6 +754,9 @@
            "expectedRC"        : 0
          }
        </call>
          </else>
        </if>
        <call function="'get-fractional-replication-attributes'">
          {
            "replicationDomain" : domainMap[ldapServer][0],