replication_schema.xml revision 66dc4ce14a68348f759dbd3263b7dcf3594a04b0
609N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
609N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
609N/A<!--
609N/A ! CDDL HEADER START
609N/A !
609N/A ! The contents of this file are subject to the terms of the
609N/A ! Common Development and Distribution License, Version 1.0 only
609N/A ! (the "License"). You may not use this file except in compliance
609N/A ! with the License.
609N/A !
609N/A ! You can obtain a copy of the license at
609N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
609N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
609N/A ! See the License for the specific language governing permissions
609N/A ! and limitations under the License.
609N/A !
609N/A ! When distributing Covered Code, include this CDDL HEADER in each
609N/A ! file and include the License file at
609N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
609N/A ! add the following below this CDDL HEADER, with the fields enclosed
609N/A ! by brackets "[]" replaced with your own identifying information:
609N/A ! Portions Copyright [yyyy] [name of copyright owner]
609N/A !
609N/A ! CDDL HEADER END
609N/A !
609N/A ! Portions Copyright 2006-2007 Sun Microsystems, Inc.
609N/A ! -->
609N/A<stax>
609N/A
609N/A <defaultcall function="replication_schema"/>
609N/A
609N/A <function name="replication_schema">
<sequence>
<block name="'schema'">
<sequence>
<script>
if not CurrentTestPath.has_key('group'):
CurrentTestPath['group']='replication'
CurrentTestPath['suite']=STAXCurrentBlock
</script>
<call function="'testSuite_Preamble'"/>
<!--- Test Suite information
#@TestSuiteName Replication Schema Replication Tests
#@TestSuitePurpose Verify that the schema is replicated as any other suffix in a replicated topology.
#@TestSuiteID Schema Replication Tests
#@TestSuiteGroup Schema Replication
#@TestGroup Replication
#@TestScript replication_schema.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'" />
<script>
synchroSuffix = master.getSynchronizedSuffixList()[0].getSuffixDn()
replServerList = master.getSynchronizedSuffixList()[0].getChangelogServerList()
</script>
<iterate var="server" in="_topologyServerList" indexvar="i">
<sequence>
<message>
'Create domain name for schema on server %s/%s' % (server.getDir(), OPENDSNAME)
</message>
<call function="'createMultimasterDomain'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' % (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'domainName' : 'schema',
'replicationDn' : 'cn=schema',
'serverId' : i + 1,
'replicationServerList' : replServerList }
</call>
</sequence>
</iterate>
<!--- Test Case information
#@TestMarker Replication Schema Replication Tests
#@TestName Replication: Schema Replication: Add objectclass
#@TestID Add objectclass
#@TestPurpose Check schema replication when a new objectclass is added
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<testcase name="getTestCaseName('Add objectclass')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Replication: Schema Replication: Add objectclass. Check schema replication when a new objectclass is added'
</message>
<!-- Load entries into "master" server -->
<call function="'addEntry'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : masterHost,
'dsInstancePort' : master.getPort(),
'dsInstanceDn' : master.getRootDn(),
'dsInstancePswd' : master.getRootPwd(),
'entryToBeAdded' : '%s/replication/Example.ldif' % clientDataDir }
</call>
<script>
newObjectclass = '( testobjectclass-oid NAME \'testobjectclass-0\' SUP person MAY ( street $ c ) X-ORIGIN \'user defined\' )'
</script>
<!-- Modify schema in "master" server -->
<call function="'modifyAnAttribute'">
{ 'dsPath' : masterPath,
'dsInstanceHost' : masterHost ,
'dsInstancePort' : master.getPort(),
'dsInstanceDn' : master.getRootDn(),
'dsInstancePswd' : master.getRootPwd(),
'DNToModify' : 'cn=schema',
'attributeName' : 'objectClasses',
'newAttributeValue' : newObjectclass,
'changetype' : 'add' }
</call>
<!-- Add entry to "master" server -->
<call function="'addEntry'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : masterHost,
'dsInstancePort' : master.getPort(),
'dsInstanceDn' : master.getRootDn(),
'dsInstancePswd' : master.getRootPwd(),
'entryToBeAdded' : '%s/replication/testuser-0.ldif' % clientDataDir }
</call>
<!-- Verify the synchronization of the schema among the servers in the topology -->
<call function="'verifySchemas'">
[ clientHost, clientPath, master, consumerList, '99-user.ldif' ]
</call>
<!-- 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 Schema Replication Tests
#@TestName Replication: Schema Replication: Add attributetype
#@TestID Add attributetype
#@TestPurpose Check schema replication when a new attributetype is added
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<testcase name="getTestCaseName('Add attributetype')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Replication: Schema Replication: Add attributetype Check schema replication when a new attributetype is added'
</message>
<script>
newObjectclass = '( testobjectclass1-oid NAME \'testobjectclass-1\' SUP person MAY ( street $ testattribute-1 $ c ) X-ORIGIN \'user defined\' )'
newAttributetype = '( testattribute1-oid NAME \'testattribute-1\' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN \'user defined\' )'
</script>
<!-- Modify schema in "master" server -->
<call function="'modifyAnAttribute'">
{ 'dsPath' : masterPath,
'dsInstanceHost' : masterHost ,
'dsInstancePort' : master.getPort(),
'dsInstanceDn' : master.getRootDn(),
'dsInstancePswd' : master.getRootPwd(),
'DNToModify' : 'cn=schema',
'attributeName' : 'attributeTypes',
'newAttributeValue' : newAttributetype,
'changetype' : 'add' }
</call>
<call function="'modifyAnAttribute'">
{ 'dsPath' : masterPath,
'dsInstanceHost' : masterHost ,
'dsInstancePort' : master.getPort(),
'dsInstanceDn' : master.getRootDn(),
'dsInstancePswd' : master.getRootPwd(),
'DNToModify' : 'cn=schema',
'attributeName' : 'objectClasses',
'newAttributeValue' : newObjectclass,
'changetype' : 'add' }
</call>
<!-- Add entry to "master" server -->
<call function="'addEntry'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : masterHost,
'dsInstancePort' : master.getPort(),
'dsInstanceDn' : master.getRootDn(),
'dsInstancePswd' : master.getRootPwd(),
'entryToBeAdded' : '%s/replication/testuser-1.ldif' % clientDataDir }
</call>
<!-- Verify the synchronization of the schema among the servers in the topology -->
<call function="'verifySchemas'">
[ clientHost, clientPath, master, consumerList, '99-user.ldif' ]
</call>
<!-- 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 Schema Replication Tests
#@TestName Replication: Schema Replication: Delete objectclass
#@TestID Delete objectclass
#@TestPurpose Check schema replication when an objectclass is deleted
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<testcase name="getTestCaseName('Delete objectclass')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Replication: Schema Replication: Delete objectclass Check schema replication when an objectclass is deleted'
</message>
<script>
newObjectclass = '( testobjectclass-oid NAME \'testobjectclass-0\' SUP person MAY ( street $ c ) X-ORIGIN \'user defined\' )'
</script>
<!-- Modify schema in "master" server -->
<call function="'modifyAnAttribute'">
{ 'dsPath' : masterPath,
'dsInstanceHost' : masterHost ,
'dsInstancePort' : master.getPort(),
'dsInstanceDn' : master.getRootDn(),
'dsInstancePswd' : master.getRootPwd(),
'DNToModify' : 'cn=schema',
'attributeName' : 'objectClasses',
'newAttributeValue' : newObjectclass,
'changetype' : 'delete' }
</call>
<!-- Try to add entry to servers; should be rejected with error 65 (objectclass violation) -->
<iterate var="server" in="_topologyServerList">
<call function="'addEntry'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'entryToBeAdded' : '%s/replication/testuser-0.ldif' % clientDataDir,
'expectedRC' : 65 }
</call>
</iterate>
<!-- Verify the synchronization of the schema among the servers in the topology -->
<call function="'verifySchemas'">
[ clientHost, clientPath, master, consumerList, '99-user.ldif' ]
</call>
<!-- 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>