<?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 legal-notices/CDDLv1_0.txt
|
! or http://forgerock.org/license/CDDLv1.0.html.
|
! 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 legal-notices/CDDLv1_0.txt.
|
! 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
|
!
|
! Copyright 2012-2013 ForgeRock AS.
|
! -->
|
<stax>
|
<defaultcall function="replication_conflict"/>
|
<function name="replication_conflict" scope="local">
|
<sequence>
|
<block name="'replication_conflict'">
|
<try>
|
<sequence>
|
<script>
|
if not CurrentTestPath.has_key('group'):
|
CurrentTestPath['group']='replication'
|
CurrentTestPath['suite'] = 'conflict'
|
|
_groupdir='%s/testcases/replication' % TESTS_DIR
|
_label = 'Replication Conflict'
|
</script>
|
|
<!--- Test Suite information
|
#@TestSuiteName Replication Conflict Tests
|
#@TestSuitePurpose Verify that the conflict operations are replicated
|
correctly between two servers.
|
#@TestSuiteID Conflict Tests
|
#@TestSuiteGroup Conflict
|
#@TestGroup Replication
|
#@TestScript replication_conflict.xml
|
#@TestHTMLLink http://www.forgerock.org/
|
-->
|
|
<call function="'testSuite_Preamble'"/>
|
|
<try>
|
<sequence>
|
|
<import machine="STAF_LOCAL_HOSTNAME"
|
file="'%s/testcases/replication/replication_setup.xml'
|
% (TESTS_DIR)"/>
|
<call function="'replication_setup'">
|
{ 'topologyFile' : '%s/basic_topology.txt' \
|
% REPLICATION_CONFIG_DIR,
|
'dataFile' : 'Short_Example.ldif',
|
'isolateLdapServers' : True,
|
'enableDebugLogs' : False,
|
'label' : _label
|
}
|
</call>
|
|
<!-- List of Import of Test Functions -->
|
<script>
|
importList=[]
|
importList.append('conflict/conflict_tests')
|
</script>
|
|
<!-- Import the files for this test suite -->
|
<iterate var="_import" in="importList">
|
<import machine="STAF_LOCAL_HOSTNAME"
|
file="'%s/%s.xml' % (_groupdir,_import)"/>
|
</iterate>
|
|
<!-- Specific to replication tests -->
|
<script>
|
msg1 = 'Replication: Conflict:'
|
server1 = _topologyServerList[0]
|
server2 = _topologyServerList[1]
|
server1Host = server1.getHostname()
|
server2Host = server2.getHostname()
|
server1Path = '%s/%s' % (server1.getDir(), OPENDSNAME)
|
server2Path = '%s/%s' % (server2.getDir(), OPENDSNAME)
|
server1name = '%s:%s' % (server1Host, server1.getPort())
|
server2name = '%s:%s' % (server2Host, server2.getPort())
|
|
if globalSplitServers:
|
replServer1 = _topologyReplServerList[0]
|
replServer2 = _topologyReplServerList[1]
|
else:
|
replServer1 = server1
|
replServer2 = server2
|
|
# Filter used for retrieving conflict counters from cn=monitor
|
filter0 = '(base-dn=%s)' % synchroSuffix
|
filter1 = '(cn=Replication Plugin*)'
|
monitorFilter = '&%s%s' % (filter0, filter1)
|
monitorCounters = 'resolved-naming-conflicts \
|
unresolved-naming-conflicts \
|
resolved-modify-conflicts'
|
|
addedEntries = STAXGlobal( [[], []] )
|
|
class Entry:
|
def __init__(self, rdn):
|
self.userDn = '%s, ou=People, %s' \
|
% (rdn, synchroSuffix)
|
self.listAttr = []
|
self.listAttr.append('objectclass:top')
|
self.listAttr.append('objectclass:organizationalperson')
|
self.listAttr.append('objectclass:inetorgperson')
|
self.listAttr.append('objectclass:person')
|
self.listAttr.append('sn:User')
|
self.listAttr.append('cn:Test User')
|
def getDn(self):
|
return self.userDn
|
def getAttrList(self):
|
return self.listAttr
|
def addAttr(self, attrType, attrValue):
|
self.listAttr.append('%s:%s' % (attrType, attrValue))
|
|
</script>
|
|
<!-- List of Test Cases -->
|
<script>
|
testsList=[]
|
testsList.append('replication_conflict_001')
|
testsList.append('replication_conflict_002')
|
testsList.append('replication_conflict_003')
|
testsList.append('replication_conflict_004')
|
testsList.append('replication_conflict_005')
|
testsList.append('replication_conflict_006')
|
testsList.append('replication_conflict_007')
|
testsList.append('replication_conflict_008')
|
testsList.append('replication_conflict_009')
|
testsList.append('replication_conflict_010')
|
testsList.append('replication_conflict_011')
|
testsList.append('replication_conflict_012')
|
testsList.append('replication_conflict_013')
|
testsList.append('replication_conflict_014')
|
testsList.append('replication_conflict_015')
|
testsList.append('replication_conflict_016')
|
testsList.append('replication_conflict_017')
|
testsList.append('replication_conflict_018')
|
testsList.append('replication_conflict_019')
|
</script>
|
|
<!-- Execute the Tests -->
|
<iterate var="__test" in="testsList">
|
<sequence>
|
<call function="'%s' % (__test)" />
|
</sequence>
|
</iterate>
|
|
</sequence>
|
|
<catch exception="'STAFException.TestSuite.SetupException'">
|
<sequence>
|
<message log="1" level="'fatal'">
|
'Setup of test suite failed.'
|
</message>
|
<rethrow/>
|
</sequence>
|
</catch>
|
|
<finally>
|
<message>'Test Cases Completed.'</message>
|
</finally>
|
|
</try>
|
|
</sequence>
|
|
<finally>
|
<sequence>
|
<!-- Test Suite Cleanup -->
|
<message>'Finally: Replication Cleanup.'</message>
|
<try>
|
<sequence>
|
<import machine="STAF_LOCAL_HOSTNAME"
|
file="'%s/testcases/replication/replication_cleanup.xml'
|
% (TESTS_DIR)"/>
|
<call function="'replication_cleanup'">
|
{ 'label' : _label }
|
</call>
|
</sequence>
|
<catch exception="'STAFException'">
|
<sequence>
|
<message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
|
</sequence>
|
</catch>
|
<finally>
|
<call function="'testSuite_Postamble'"/>
|
</finally>
|
</try>
|
</sequence>
|
</finally>
|
|
</try>
|
</block>
|
</sequence>
|
</function>
|
</stax>
|