| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| | | <!DOCTYPE stax SYSTEM "../../../shared/stax.dtd"> |
| | | <!-- |
| | | ! CDDL HEADER START |
| | | ! |
| | | ! The contents of this file are subject to the terms of the |
| | | ! Common Development and Distribution License, Version 1.0 only |
| | | ! (the "License"). You may not use this file except in compliance |
| | | ! with the License. |
| | | ! |
| | | ! You can obtain a copy of the license at |
| | | ! trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | ! or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | ! See the License for the specific language governing permissions |
| | | ! and limitations under the License. |
| | | ! |
| | | ! When distributing Covered Code, include this CDDL HEADER in each |
| | | ! file and include the License file at |
| | | ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | ! add the following below this CDDL HEADER, with the fields enclosed |
| | | ! by brackets "[]" replaced with your own identifying information: |
| | | ! Portions Copyright [yyyy] [name of copyright owner] |
| | | ! |
| | | ! CDDL HEADER END |
| | | ! |
| | | ! Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | ! --> |
| | | <stax> |
| | | |
| | | <defaultcall function="replication_failover"/> |
| | | |
| | | <function name="replication_failover"> |
| | | |
| | | <sequence> |
| | | |
| | | <block name="'failover'"> |
| | | |
| | | <sequence> |
| | | |
| | | <script> |
| | | if not CurrentTestPath.has_key('group'): |
| | | CurrentTestPath['group']='replication' |
| | | CurrentTestPath['suite']=STAXCurrentBlock |
| | | </script> |
| | | |
| | | <call function="'testSuite_Preamble'"/> |
| | | |
| | | <!--- Test Suite information |
| | | #@TestSuiteName Replication Failover Tests |
| | | #@TestSuitePurpose Verify that the failover of a replication server does not affect replication. |
| | | #@TestSuiteID Failover Tests |
| | | #@TestSuiteGroup Failover |
| | | #@TestGroup Replication |
| | | #@TestScript replication_failover.xml |
| | | #@TestHTMLLink http://opends.dev.java.net/ |
| | | --> |
| | | |
| | | |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/replication/replication_setup.xml' % (TESTS_DIR)"/> |
| | | <call function="'replication_setup'"> |
| | | { 'topologyFile' : '%s/config/replication/3server_topology.txt' % TESTS_DIR } |
| | | </call> |
| | | |
| | | <script> |
| | | synchroSuffix = master.getSynchronizedSuffixList()[0].getSuffixDn() |
| | | replServerList = master.getSynchronizedSuffixList()[0].getChangelogServerList() |
| | | </script> |
| | | |
| | | |
| | | <!-- Load entries into "master" server --> |
| | | <!-- Stop "master" Directory Server --> |
| | | <call function="'StopDsWithScript'"> |
| | | { 'location' : masterHost, |
| | | 'dsPath' : masterPath, |
| | | 'dsHost' : masterHost, |
| | | 'dsPort' : master.getPort(), |
| | | 'dsBindDN' : master.getRootDn(), |
| | | 'dsBindPwd' : master.getRootPwd() |
| | | } |
| | | </call> |
| | | |
| | | <!-- Import data into "master" Directory Server --> |
| | | <call function="'ImportLdifWithScript'"> |
| | | { 'location' : masterHost, |
| | | 'dsPath' : masterPath, |
| | | 'dsBackEnd' : 'userRoot', |
| | | 'dsLdifFile' : '%s/replication/Example.ldif' % masterDataDir |
| | | } |
| | | </call> |
| | | |
| | | <!-- Start the Directory Server --> |
| | | <call function="'StartDsWithScript'"> |
| | | { 'location' : masterHost, |
| | | 'dsPath' : masterPath |
| | | } |
| | | </call> |
| | | |
| | | <!-- Wait for DS to start --> |
| | | <call function="'isAlive'"> |
| | | { 'location' : masterHost, |
| | | 'dsPath' : masterPath, |
| | | 'dsInstanceHost' : masterHost, |
| | | 'dsInstancePort' : master.getPort() , |
| | | 'dsInstanceDn' : master.getRootDn() , |
| | | 'dsInstancePswd' : master.getRootPwd() , |
| | | 'noOfLoops' : 10 , |
| | | 'noOfMilliSeconds' : 2000 |
| | | } |
| | | </call> |
| | | |
| | | <!-- Initialise the servers in the topology --> |
| | | <!-- |
| | | <call function="'initializeReplication'"> |
| | | { 'location' : clientHost, |
| | | 'dsPath' : clientPath, |
| | | 'sourceInstanceHost' : masterHost, |
| | | 'sourceInstancePort' : master.getPort(), |
| | | 'replicationDnList' : ['o=example'] |
| | | } |
| | | </call> |
| | | --> |
| | | <iterate var="server" in="consumerList"> |
| | | <!-- Perform the total update --> |
| | | <call function="'initializeReplication'"> |
| | | { 'location' : clientHost, |
| | | 'dsPath' : clientPath, |
| | | 'dsInstanceHost' : server.getHostname(), |
| | | 'dsInstancePort' : server.getPort(), |
| | | 'sourceInstanceHost' : masterHost, |
| | | 'sourceInstancePort' : master.getPort(), |
| | | 'replicationDnList' : ['o=example'] |
| | | } |
| | | </call> |
| | | </iterate> |
| | | |
| | | |
| | | <!--- Test Case information |
| | | #@TestMarker Replication Failover Tests |
| | | #@TestName Replication: Failover: One server down |
| | | #@TestID One server down |
| | | #@TestPurpose Check replication when one server fails |
| | | #@TestPreamble |
| | | #@TestSteps |
| | | #@TestPostamble |
| | | #@TestResult |
| | | --> |
| | | <testcase name="getTestCaseName('One server down')"> |
| | | <sequence> |
| | | <call function="'testCase_Preamble'"/> |
| | | <message> |
| | | 'Replication: Failover: One server down. Check replication when one server fails' |
| | | </message> |
| | | |
| | | <iterate var="server" in="_topologyServerList" indexvar="i"> |
| | | <sequence> |
| | | |
| | | <script> |
| | | serverPath = '%s/%s' % (server.getDir(), OPENDSNAME) |
| | | nbOfServers = len(_topologyServerList) |
| | | nextServer = _topologyServerList[(i + 1) % nbOfServers] |
| | | nextServerPath = '%s/%s' % (nextServer.getDir(), OPENDSNAME) |
| | | userDn = 'uid=iabizen-%s, ou=People, %s' % (i, synchroSuffix) |
| | | </script> |
| | | |
| | | <!-- Stop server (simulate failover?) --> |
| | | <call function="'StopDsWithScript'"> |
| | | { 'location' : server.getHostname(), |
| | | 'dsPath' : serverPath, |
| | | 'dsHost' : server.getHostname(), |
| | | 'dsPort' : server.getPort(), |
| | | 'dsBindDN' : server.getRootDn(), |
| | | 'dsBindPwd' : server.getRootPwd() |
| | | } |
| | | </call> |
| | | |
| | | <!-- Add entry to one of the other servers --> |
| | | <script> |
| | | listAttr = [] |
| | | listAttr.append('objectclass:top') |
| | | listAttr.append('objectclass:organizationalperson') |
| | | listAttr.append('objectclass:inetorgperson') |
| | | listAttr.append('objectclass:person') |
| | | listAttr.append('givenname:Izen-%s' % i) |
| | | listAttr.append('sn:Abizen-%s' % i) |
| | | listAttr.append('cn:Izen-%s Abizen-%s' % (i, i)) |
| | | </script> |
| | | |
| | | <call function="'addAnEntry'"> |
| | | { 'location' : nextServer.getHostname(), |
| | | 'dsPath' : nextServerPath, |
| | | 'dsInstanceHost' : nextServer.getHostname(), |
| | | 'dsInstancePort' : nextServer.getPort(), |
| | | 'dsInstanceDn' : nextServer.getRootDn(), |
| | | 'dsInstancePswd' : nextServer.getRootPwd(), |
| | | 'DNToAdd' : userDn, |
| | | 'listAttributes' : listAttr, |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | <!-- Start the server again --> |
| | | <call function="'StartDsWithScript'"> |
| | | { 'location' : server.getHostname(), |
| | | 'dsPath' : serverPath |
| | | } |
| | | </call> |
| | | </sequence> |
| | | </iterate> |
| | | |
| | | |
| | | <!-- Verify the synchronization of the trees among the servers in the topology --> |
| | | <call function="'verifyTrees'"> |
| | | [ clientHost, clientPath, master, consumerList, synchroSuffix ] |
| | | </call> |
| | | |
| | | <call function="'testCase_Postamble'"/> |
| | | </sequence> |
| | | </testcase> |
| | | |
| | | |
| | | |
| | | <!--- Test Case information |
| | | #@TestMarker Replication Failover Tests |
| | | #@TestName Replication: Failover: All but one servers down |
| | | #@TestID One server down |
| | | #@TestPurpose Check replication when all but one servers fail |
| | | #@TestPreamble |
| | | #@TestSteps |
| | | #@TestPostamble |
| | | #@TestResult |
| | | --> |
| | | <testcase name="getTestCaseName('All but one servers down')"> |
| | | <sequence> |
| | | <call function="'testCase_Preamble'"/> |
| | | <message> |
| | | 'Replication: Failover: All but one servers down. Check replication when all but one servers fail' |
| | | </message> |
| | | |
| | | <paralleliterate var="server" in="consumerList"> |
| | | <sequence> |
| | | <script> |
| | | serverPath = '%s/%s' % (server.getDir(), OPENDSNAME) |
| | | </script> |
| | | |
| | | <!-- Stop server (simulate failover?) --> |
| | | <call function="'StopDsWithScript'"> |
| | | { 'location' : server.getHostname(), |
| | | 'dsPath' : serverPath, |
| | | 'dsHost' : server.getHostname(), |
| | | 'dsPort' : server.getPort(), |
| | | 'dsBindDN' : server.getRootDn(), |
| | | 'dsBindPwd' : server.getRootPwd() |
| | | } |
| | | </call> |
| | | </sequence> |
| | | </paralleliterate> |
| | | |
| | | |
| | | <!-- Add entry to master servers --> |
| | | <script> |
| | | userDn = 'uid=iabizen-berri, ou=People, %s' % synchroSuffix |
| | | |
| | | listAttr = [] |
| | | listAttr.append('objectclass:top') |
| | | listAttr.append('objectclass:organizationalperson') |
| | | listAttr.append('objectclass:inetorgperson') |
| | | listAttr.append('objectclass:person') |
| | | listAttr.append('givenname:Izen-berri') |
| | | listAttr.append('sn:Abizen-berri') |
| | | listAttr.append('cn:Izen-berri Abizen-berri') |
| | | </script> |
| | | |
| | | <call function="'addAnEntry'"> |
| | | { 'location' : masterHost, |
| | | 'dsPath' : masterPath, |
| | | 'dsInstanceHost' : masterHost, |
| | | 'dsInstancePort' : master.getPort(), |
| | | 'dsInstanceDn' : master.getRootDn(), |
| | | 'dsInstancePswd' : master.getRootPwd(), |
| | | 'DNToAdd' : userDn, |
| | | 'listAttributes' : listAttr, |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | <paralleliterate var="server" in="consumerList"> |
| | | <sequence> |
| | | <script> |
| | | serverPath = '%s/%s' % (server.getDir(), OPENDSNAME) |
| | | </script> |
| | | |
| | | <!-- Start the server again --> |
| | | <call function="'StartDsWithScript'"> |
| | | { 'location' : server.getHostname(), |
| | | 'dsPath' : serverPath |
| | | } |
| | | </call> |
| | | </sequence> |
| | | </paralleliterate> |
| | | |
| | | |
| | | <!-- Verify the synchronization of the trees among the servers in the topology --> |
| | | <call function="'verifyTrees'"> |
| | | [ clientHost, clientPath, master, consumerList, synchroSuffix ] |
| | | </call> |
| | | |
| | | <call function="'testCase_Postamble'"/> |
| | | </sequence> |
| | | </testcase> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/replication/replication_cleanup.xml' % (TESTS_DIR)"/> |
| | | <call function="'replication_cleanup'" /> |
| | | |
| | | <call function="'testSuite_Postamble'"/> |
| | | |
| | | </sequence> |
| | | |
| | | </block> |
| | | |
| | | </sequence> |
| | | |
| | | </function> |
| | | |
| | | </stax> |