<?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_totalupdate"/>
|
<function name="replication_totalupdate">
|
<sequence>
|
<block name="'total-update'">
|
<sequence>
|
<script>
|
if not CurrentTestPath.has_key('group'):
|
CurrentTestPath['group']='replication'
|
CurrentTestPath['suite']=STAXCurrentBlock
|
</script>
|
|
<call function="'testSuite_Preamble'"/>
|
|
<import machine="STAF_LOCAL_HOSTNAME"
|
file="'%s/testcases/replication/replication_setup.xml' % (TESTS_DIR)"/>
|
<call function="'replication_setup'" />
|
|
<script>
|
server1DataDir = '%s/%s' % (server1.getDir(),relativeDataDir)
|
</script>
|
|
<!--- Test Case : Total Update -->
|
<testcase name="getTestCaseName('Simple LDIF')">
|
<sequence>
|
|
<call function="'testCase_Preamble'"/>
|
|
<!-- Stop "master" Directory Server -->
|
<call function="'StopDsWithScript'">
|
{ 'location' : masterHost,
|
'dsPath' : masterPath,
|
'dsHost' : masterHost,
|
'dsPort' : master.getPort(),
|
'dsBindDN' : master.getRootDn(),
|
'dsBindPwd' : master.getRootPwd()
|
}
|
</call>
|
|
<!-- Check that the Directory Server is stopped -->
|
|
<!-- Import data into "master" Directory Server -->
|
<call function="'ImportLdifWithScript'">
|
{ 'location' : masterHost,
|
'dsPath' : masterPath,
|
'dsBackEnd' : 'userRoot',
|
'dsLdifFile' : '%s/replication/Example.ldif' % masterDataDir
|
}
|
</call>
|
|
<!-- Check some data was imported into Directory Server -->
|
<call function="'checkImport'">
|
{ 'location' : masterHost,
|
'dsPath' : masterPath,
|
'dsHost' : masterHost,
|
'dsPort' : master.getPort(),
|
'dsDn' : master.getRootDn(),
|
'dsPswd' : master.getRootPwd(),
|
'expectedEntries' : ['uid=scarter,ou=People,o=example',
|
'uid=dmiller, ou=People, o=example',
|
'uid=rhunt, ou=People, o=example']
|
}
|
</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>
|
|
|
<iterate var="server" in="consumerList">
|
<sequence>
|
<!-- 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>
|
|
<!-- Verify the total update -->
|
<call function="'checkImport'">
|
{ 'location' : server.getHostname(),
|
'dsPath' : '%s/%s' % (server.getDir(),OPENDSNAME),
|
'dsHost' : server.getHostname(),
|
'dsPort' : server.getPort(),
|
'dsDn' : server.getRootDn(),
|
'dsPswd' : server.getRootPwd(),
|
'expectedEntries' : ['uid=scarter,ou=People,o=example',
|
'uid=dmiller, ou=People, o=example',
|
'uid=rhunt, ou=People, o=example'],
|
'startDS' : 'no'
|
}
|
</call>
|
</sequence>
|
</iterate>
|
|
<!-- Verify the synchronization of the trees among the servers in the topology -->
|
<call function="'verifyTrees'">
|
[ clientHost, clientPath, master, consumerList, 'o=example' ]
|
</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>
|