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

Gary Williams
02.41.2012 bedffabf7f46ecbfc00113bab603ecdb7947b053
Align fractional-replication tests to replication domain
2 files modified
67 ■■■■■ changed files
opends/tests/staf-tests/functional-tests/testcases/fractional-replication/basic.xml 35 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/fractional-replication/utils.xml 32 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/fractional-replication/basic.xml
@@ -24,7 +24,7 @@
 ! CDDL HEADER END
 !
 !      Copyright 2009-2010 Sun Microsystems, Inc.
 !      Portions Copyright 2011 ForgeRock AS.
 !      Portions Copyright 2011-2012 ForgeRock AS.
 ! -->
<stax>
  <defaultcall function="fractional-replication_basic"/>
@@ -100,14 +100,7 @@
                  </sequence>
                </paralleliterate>
                <script>
                  repMasterDomain = '%s %s,cn=o_example,%s' % \
                                    ("cn=Replication Domain",
                                      domainMap[ldapPservers[0]][1],
                                     "cn=replication,cn=monitor")
                  repClientDomain = '%s %s,cn=o_example,%s' % \
                                    ("cn=Replication Domain",
                                      domainMap[ldapPservers[1]][1],
                                     "cn=replication,cn=monitor")
                  replDomainSuffix = 'cn=o_example,cn=replication,cn=monitor'
                </script>
                <message level="'debug'">'domainMap=%s' % domainMap</message>
                <script>
@@ -174,8 +167,8 @@
        <sequence>
          <call function="'testCase_Preamble'"/>
          <call function="'replicationStatus'">
            { "server"            : Pservers[0],
              "replicationDomain" : repMasterDomain,
            { "server"                  : Pservers[0],
              "replicationDomainSuffix" : replDomainSuffix,
            }
          </call>
          <!-- set fractional-exclude on server 2 -->
@@ -198,8 +191,8 @@
          </script>
          <!-- verify we have Bad Generation ID -->
          <call function="'replicationStatus'">
            { "server"            : Pservers[1],
              "replicationDomain" : repClientDomain,
            { "server"                  : Pservers[1],
              "replicationDomainSuffix" : replDomainSuffix,
            }
          </call>
          <if expr="len(STAXResult) == 3 and STAXResult[1].find('Bad generation id') != -1">
@@ -259,8 +252,8 @@
        <sequence>
          <call function="'testCase_Preamble'"/>
          <call function="'replicationStatus'">
            { "server"            : Pservers[0],
              "replicationDomain" : repMasterDomain,
            { "server"                  : Pservers[0],
              "replicationDomainSuffix" : replDomainSuffix,
            }
          </call>
          <!-- set fractional-include on server 2 -->
@@ -281,8 +274,8 @@
          </script>
          <!-- verify we have Bad Generation ID -->
          <call function="'replicationStatus'">
            { "server"            : Pservers[1],
              "replicationDomain" : repClientDomain,
            { "server"                  : Pservers[1],
              "replicationDomainSuffix" : replDomainSuffix,
            }
          </call>
          <if expr="len(STAXResult) == 3 and STAXResult[1].find('Bad generation id') != -1">
@@ -447,8 +440,8 @@
          <call function="'testCase_Preamble'"/>
          <call function="'replicationStatus'">
            { "server"            : Pservers[1],
              "replicationDomain" : repClientDomain,
            { "server"                  : Pservers[1],
              "replicationDomainSuffix" : replDomainSuffix,
            }
          </call>
@@ -492,8 +485,8 @@
            }
          </call>
          <call function="'replicationStatus'">
            { "server"            : Pservers[1],
              "replicationDomain" : repClientDomain,
            { "server"                  : Pservers[1],
              "replicationDomainSuffix" : replDomainSuffix,
            }
          </call>
          <if expr="len(STAXResult) == 3 and STAXResult[1].find('Bad generation id') != -1">
opends/tests/staf-tests/functional-tests/testcases/fractional-replication/utils.xml
@@ -24,6 +24,7 @@
 ! CDDL HEADER END
 !
 !      Copyright 2009-2010 Sun Microsystems, Inc.
 !      Portions Copyright 2012 ForgeRock AS.
 ! -->
<stax>
  <function name="get-fractional-replication-attributes" scope="local">
@@ -293,10 +294,12 @@
    </function-prolog>
    <function-map-args>
      <function-required-arg name="server"/>
      <function-required-arg name="replicationDomain"/>
      <function-required-arg name="replicationDomainSuffix"/>
      <function-optional-arg name="expectedRC" default="0"/>
    </function-map-args>
    <sequence>
      <!-- Search for the DN of the Replication Domain -->
      <call function="'ldapSearchWithScript'">
        { 'location'            : server.getHostname(),
          'dsPath'              : '%s/%s' \
@@ -305,10 +308,35 @@
          'dsInstancePort'      : server.getPort(),
          'dsInstanceDn'        : server.getRootDn(),
          'dsInstancePswd'      : server.getRootPwd(),
          'dsBaseDN'            : replicationDomain,
          'dsBaseDN'            : replicationDomainSuffix,
          'dsFilter'            : 'objectclass=*',
          'dsAttributes'        : 'status last-status-change-date',
          'dsDontWrap'          : 'true',
        }
      </call>
      <!-- Get the DN of the Replication Domain -->
      <script>
        replicationDomainDN = replicationDomainSuffix
        for l in STAXResult[0][1].splitlines():
          if l.startswith('dn: cn=Replication Domain'):
            replicationDomainDN = l.replace('dn: ','')
      </script>
      <!-- Search the Replication Domain for status last-status-change-date -->
      <call function="'ldapSearchWithScript'">
        { 'location'            : server.getHostname(),
          'dsPath'              : '%s/%s' \
                                  % (server.getDir(),OPENDSNAME),
          'dsInstanceHost'      : server.getHostname(),
          'dsInstancePort'      : server.getPort(),
          'dsInstanceDn'        : server.getRootDn(),
          'dsInstancePswd'      : server.getRootPwd(),
          'dsBaseDN'            : replicationDomainDN,
          'dsFilter'            : 'objectclass=*',
          'dsAttributes'        : 'status last-status-change-date',
          'dsScope'             : 'base',
          'dsDontWrap'          : 'true',
        }
      </call>
      <if expr='RC == 0'>