<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
! 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
! 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-2009 Sun Microsystems, Inc.
! Portions Copyright 2011-2013 ForgeRock AS.
! -->
<stax>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict: Basic check
#@TestID Basic check
#@TestPurpose Check replication assures synchronization after
a simultaneous conflictuous modify on 2
different servers (regardless of the prevailing
modify)
#@TestPreamble
#@TestSteps Add entry to server1 with employeeNumber:0
#@TestSteps Parallel replace
server1: employeeNumber -> 1
server2: employeeNumber -> 2
#@TestSteps Check entry consistent on both servers
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_001" scope="local">
<testcase name="getTestCaseName('Basic check')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: Basic check 0. \
Check replication assures synchronization after a simultaneous \
conflictuous modify on 2 different servers (regardless of the \
prevailing modify)'
</message>
<!-- Add entry to server1 -->
<script>
myEntry = Entry('uid=tuser-0')
myEntry.addAttr('employeeNumber', '0')
</script>
<call function="'addAnEntry'">
{ 'location' : server1Host,
'dsPath' : server1Path,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'DNToAdd' : myEntry.getDn(),
'listAttributes' : myEntry.getAttrList()
}
</call>
<call function="'Sleep'">
{ 'sleepForMilliSeconds' : 2000 }
</call>
<paralleliterate var="server"
in="[server1, server2]"
indexvar="i">
<!-- Modify entry on one of the servers -->
<call function="'modifyAnAttribute'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToModify' : myEntry.getDn(),
'attributeName' : 'employeeNumber',
'newAttributeValue' : '%i' % (i + 1),
'changetype' : 'replace'
}
</call>
</paralleliterate>
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'employeeNumber',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix ]
</call>
<!-- Delete added entry -->
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'dsDn' : [myEntry.getDn()]
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict: double_replace_multi
#@TestID double_replace_multi
#@TestPurpose Double replace a multi-valued attribute
#@TestPreamble
#@TestSteps Add entry to server1 with description:{1 2}
#@TestSteps Disconnect Replication Servers
#@TestSteps server1: replace description -> {3 4}
#@TestSteps server2: replace description -> {5 6}
#@TestSteps Re-connect Replication Servers
#@TestSteps Check description={5 6} on both servers
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_002" scope="local">
<testcase name="getTestCaseName('double_replace_multi')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: double_replace_multi. \
Double replace a multi-valued attribute'
</message>
<!-- Add entry to server1 -->
<script>
myEntry = Entry('cn=A1')
myEntry.addAttr('description', '1')
myEntry.addAttr('description', '2')
server1mods = ['description:3', 'description:4']
server2mods = ['description:5', 'description:6']
mods = [server1mods, server2mods]
</script>
<call function="'addAnEntry'">
{ 'location' : server1Host,
'dsPath' : server1Path,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'DNToAdd' : myEntry.getDn(),
'listAttributes' : myEntry.getAttrList()
}
</call>
<!-- Disconnect Replication Servers -->
<call function="'disconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<iterate var="server"
in="[server1, server2]"
indexvar="i">
<!-- Modify entry on one of the servers -->
<call function="'modifyAnAttribute'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToModify' : myEntry.getDn(),
'listAttributes' : mods[i],
'changetype' : 'replace'
}
</call>
</iterate>
<!-- Check modifies have not been propagated -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Reconnect Replication Servers -->
<call function="'reconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Check conflict is resolved -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix ]
</call>
<!-- Delete added entry -->
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'dsDn' : [myEntry.getDn()]
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict: double_replace_single
#@TestID double_replace_single
#@TestPurpose Double replace a single-valued attribute
#@TestPreamble
#@TestSteps Add entry to server1 with employeeNumber:0
#@TestSteps Disconnect Replication Servers
#@TestSteps server1: replace employeeNumber -> 1
#@TestSteps server2: replace employeeNumber -> 2
#@TestSteps Re-connect Replication Servers
#@TestSteps Check employeeNumber=2 on both servers
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_003" scope="local">
<testcase name="getTestCaseName('double_replace_single')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: double_replace_single. \
Double replace a single-valued attribute'
</message>
<!-- Add entry to server1 -->
<script>
myEntry = Entry('cn=A4')
myEntry.addAttr('employeeNumber', '0')
</script>
<call function="'addAnEntry'">
{ 'location' : server1Host,
'dsPath' : server1Path,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'DNToAdd' : myEntry.getDn(),
'listAttributes' : myEntry.getAttrList()
}
</call>
<!-- Disconnect Replication Servers -->
<call function="'disconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<iterate var="server"
in="[server1, server2]"
indexvar="i">
<!-- Modify entry on one of the servers -->
<call function="'modifyAnAttribute'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToModify' : myEntry.getDn(),
'attributeName' : 'employeeNumber',
'newAttributeValue' : '%i' % (i + 1),
'changetype' : 'replace'
}
</call>
</iterate>
<!-- Check modifies have not been propagated -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'employeeNumber',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Reconnect Replication Servers -->
<call function="'reconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Check conflict is resolved -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'employeeNumber',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix ]
</call>
<!-- Delete added entry -->
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'dsDn' : [myEntry.getDn()]
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict: double_mod_del_add_multi_1
#@TestID double_mod_del_add_multi_1
#@TestPurpose Double replace (del+add) same value with any
value of a multi-valued attribute
#@TestPreamble
#@TestSteps Add entry to server1 with
description:{1 2 3 4 5 6 7 8 9 10}
#@TestSteps Disconnect Replication Servers
#@TestSteps server1: del description=1 + add description=11
#@TestSteps server2: del description=1 + add description=12
#@TestSteps Re-connect Replication Servers
#@TestSteps Check description={2 3 4 5 6 7 8 9 10 11 12}
on both servers
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_004" scope="local">
<testcase name="getTestCaseName('double_mod_del_add_multi_1')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: double_mod_del_add_multi_1. \
Double replace (del+add) same value with any value of a \
multi-valued attribute'
</message>
<!-- Add entry to server1 -->
<script>
myEntry = Entry('cn=A2')
for x in range(10):
myEntry.addAttr('description', '%i' % (x+1))
server1del = ['description:1']
server1add = ['description:11']
server2del = ['description:1']
server2add = ['description:12']
server1mods = [server1del, server1add]
server2mods = [server2del, server2add]
mods = [server1mods, server2mods]
</script>
<call function="'addAnEntry'">
{ 'location' : server1Host,
'dsPath' : server1Path,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'DNToAdd' : myEntry.getDn(),
'listAttributes' : myEntry.getAttrList()
}
</call>
<!-- Disconnect Replication Servers -->
<call function="'disconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<iterate var="server"
in="[server1, server2]"
indexvar="i">
<sequence>
<!-- Modify entry on one of the servers -->
<call function="'modifyAnAttribute'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToModify' : myEntry.getDn(),
'listAttributes' : mods[i][0],
'changetype' : 'delete'
}
</call>
<call function="'modifyAnAttribute'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToModify' : myEntry.getDn(),
'listAttributes' : mods[i][1],
'changetype' : 'add'
}
</call>
</sequence>
</iterate>
<!-- Check modifies have not been propagated -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Reconnect Replication Servers -->
<call function="'reconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Check conflict is resolved -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix ]
</call>
<!-- Delete added entry -->
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'dsDn' : [myEntry.getDn()]
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict: double_mod_del_add_multi_2
#@TestID double_mod_del_add_multi_2
#@TestPurpose Double replace (del+add) any value with same
value of a multi-valued attribute
#@TestPreamble
#@TestSteps Add entry to server1 with
description:{1 2 3 4 5 6 7 8 9 10}
#@TestSteps Disconnect Replication Servers
#@TestSteps server1: del description=1 + add description=11
#@TestSteps server2: del description=10 + add description=11
#@TestSteps Re-connect Replication Servers
#@TestSteps Check description={2 3 4 5 6 7 8 9 11}
on both servers
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_005" scope="local">
<testcase name="getTestCaseName('double_mod_del_add_multi_2')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: double_mod_del_add_multi_2. \
Double replace (del+add) any value with same value of a \
multi-valued attribute'
</message>
<!-- Add entry to server1 -->
<script>
myEntry = Entry('cn=A3')
for x in range(10):
myEntry.addAttr('description', '%i' % (x+1))
server1del = ['description:1']
server1add = ['description:11']
server2del = ['description:10']
server2add = ['description:11']
server1mods = [server1del, server1add]
server2mods = [server2del, server2add]
mods = [server1mods, server2mods]
</script>
<call function="'addAnEntry'">
{ 'location' : server1Host,
'dsPath' : server1Path,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'DNToAdd' : myEntry.getDn(),
'listAttributes' : myEntry.getAttrList()
}
</call>
<!-- Disconnect Replication Servers -->
<call function="'disconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<iterate var="server"
in="[server1, server2]"
indexvar="i">
<sequence>
<!-- Modify entry on one of the servers -->
<call function="'modifyAnAttribute'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToModify' : myEntry.getDn(),
'listAttributes' : mods[i][0],
'changetype' : 'delete'
}
</call>
<call function="'modifyAnAttribute'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToModify' : myEntry.getDn(),
'listAttributes' : mods[i][1],
'changetype' : 'add'
}
</call>
</sequence>
</iterate>
<!-- Check modifies have not been propagated -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Reconnect Replication Servers -->
<call function="'reconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Check conflict is resolved -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix ]
</call>
<!-- Delete added entry -->
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'dsDn' : [myEntry.getDn()]
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict: double_mod_add_multi
#@TestID double_mod_add_multi
#@TestPurpose Double mod_add a multi-valued attribute
#@TestPreamble
#@TestSteps Add entry to server1
#@TestSteps Disconnect Replication Servers
#@TestSteps server1: add description=1
#@TestSteps server2: add description={1 2}
#@TestSteps Re-connect Replication Servers
#@TestSteps Check description={1 2} on both servers
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_006" scope="local">
<testcase name="getTestCaseName('double_mod_add_multi')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: double_mod_add_multi. \
Double mod_add a multi-valued attribute'
</message>
<!-- Add entry to server1 -->
<script>
myEntry = Entry('cn=B1')
server1add = ['description:1']
server2add = ['description:1', 'description:2']
server1mods = [server1add]
server2mods = [server2add]
mods = [server1mods, server2mods]
</script>
<call function="'addAnEntry'">
{ 'location' : server1Host,
'dsPath' : server1Path,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'DNToAdd' : myEntry.getDn(),
'listAttributes' : myEntry.getAttrList()
}
</call>
<!-- Disconnect Replication Servers -->
<call function="'disconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<iterate var="server"
in="[server1, server2]"
indexvar="i">
<sequence>
<!-- Modify entry on one of the servers -->
<call function="'modifyAnAttribute'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToModify' : myEntry.getDn(),
'listAttributes' : mods[i][0],
'changetype' : 'add'
}
</call>
</sequence>
</iterate>
<!-- Check modifies have not been propagated -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Reconnect Replication Servers -->
<call function="'reconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Check conflict is resolved -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix ]
</call>
<!-- Delete added entry -->
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'dsDn' : [myEntry.getDn()]
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict: double_mod_add_single
#@TestID double_mod_add_single
#@TestPurpose Double mod_add a single-valued attribute
#@TestPreamble
#@TestSteps Add entry to server1
#@TestSteps Disconnect Replication Servers
#@TestSteps server1: add employeeNumber=1
#@TestSteps server2: add employeeNumber=2
#@TestSteps Re-connect Replication Servers
#@TestSteps Check employeeNumber=1 on both servers
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_007" scope="local">
<testcase name="getTestCaseName('double_mod_add_single')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: double_mod_add_single. \
Double mod_add a single-valued attribute'
</message>
<!-- Add entry to server1 -->
<script>
myEntry = Entry('cn=B2')
server1add = ['employeeNumber:1']
server2add = ['employeeNumber:2']
server1mods = [server1add]
server2mods = [server2add]
mods = [server1mods, server2mods]
</script>
<call function="'addAnEntry'">
{ 'location' : server1Host,
'dsPath' : server1Path,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'DNToAdd' : myEntry.getDn(),
'listAttributes' : myEntry.getAttrList()
}
</call>
<!-- Disconnect Replication Servers -->
<call function="'disconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<iterate var="server"
in="[server1, server2]"
indexvar="i">
<sequence>
<!-- Modify entry on one of the servers -->
<call function="'modifyAnAttribute'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToModify' : myEntry.getDn(),
'listAttributes' : mods[i][0],
'changetype' : 'add'
}
</call>
</sequence>
</iterate>
<!-- Check modifies have not been propagated -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'employeeNumber',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Reconnect Replication Servers -->
<call function="'reconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Check conflict is resolved -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'employeeNumber',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix ]
</call>
<!-- Delete added entry -->
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'dsDn' : [myEntry.getDn()]
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict: double_mod_del_multi
#@TestID double_mod_del_multi
#@TestPurpose Double mod_delete a multi-valued attribute
#@TestPreamble
#@TestSteps Add entry to server1 with
description:{1 2 3 4 5 6 7 8 9 10}
#@TestSteps Disconnect Replication Servers
#@TestSteps server1: delete description={1 2 3 4 5}
#@TestSteps server2: delete description={4 5 6 7 8}
#@TestSteps Re-connect Replication Servers
#@TestSteps Check description={9 10} on both servers
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_008" scope="local">
<testcase name="getTestCaseName('double_mod_del_multi')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: double_mod_del_multi. \
Double mod_delete a multi-valued attribute'
</message>
<!-- Add entry to server1 -->
<script>
myEntry = Entry('cn=C1')
for x in range(10):
myEntry.addAttr('description', '%i' % (x+1))
server1del = []
for y in range(1,6):
server1del.append('description:%i' % y)
server2del = []
for z in range(4,9):
server2del.append('description:%i' % z)
server1mods = [server1del]
server2mods = [server2del]
mods = [server1mods, server2mods]
</script>
<call function="'addAnEntry'">
{ 'location' : server1Host,
'dsPath' : server1Path,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'DNToAdd' : myEntry.getDn(),
'listAttributes' : myEntry.getAttrList()
}
</call>
<!-- Disconnect Replication Servers -->
<call function="'disconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<iterate var="server"
in="[server1, server2]"
indexvar="i">
<sequence>
<!-- Modify entry on one of the servers -->
<call function="'modifyAnAttribute'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToModify' : myEntry.getDn(),
'listAttributes' : mods[i][0],
'changetype' : 'delete'
}
</call>
</sequence>
</iterate>
<!-- Check modifies have not been propagated -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Reconnect Replication Servers -->
<call function="'reconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Check conflict is resolved -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix ]
</call>
<!-- Delete added entry -->
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'dsDn' : [myEntry.getDn()]
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict: double_mod_del_single
#@TestID double_mod_del_single
#@TestPurpose Double mod_delete a single-valued attribute
#@TestPreamble
#@TestSteps Add entry to server1 with employeeNumber=1
#@TestSteps Disconnect Replication Servers
#@TestSteps server1: delete employeeNumber
#@TestSteps server2: delete employeeNumber=1
#@TestSteps Re-connect Replication Servers
#@TestSteps Check employeeNumber no longer exists on either
server
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_009" scope="local">
<testcase name="getTestCaseName('double_mod_del_single')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: double_mod_del_single. \
Double mod_delete a single-valued attribute'
</message>
<!-- Add entry to server1 -->
<script>
myEntry = Entry('cn=C2')
myEntry.addAttr('employeeNumber', '1')
server1del = ['employeeNumber:']
server2del = ['employeeNumber:1']
server1mods = [server1del]
server2mods = [server2del]
mods = [server1mods, server2mods]
</script>
<call function="'addAnEntry'">
{ 'location' : server1Host,
'dsPath' : server1Path,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'DNToAdd' : myEntry.getDn(),
'listAttributes' : myEntry.getAttrList()
}
</call>
<!-- Disconnect Replication Servers -->
<call function="'disconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<iterate var="server"
in="[server1, server2]"
indexvar="i">
<sequence>
<!-- Modify entry on one of the servers -->
<call function="'modifyAnAttribute'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToModify' : myEntry.getDn(),
'listAttributes' : mods[i][0],
'changetype' : 'delete'
}
</call>
</sequence>
</iterate>
<!-- Check modifies have not been propagated -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'employeeNumber',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Reconnect Replication Servers -->
<call function="'reconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Check conflict is resolved -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'employeeNumber',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix ]
</call>
<!-- Delete added entry -->
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'dsDn' : [myEntry.getDn()]
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict:
mod_del_add_vs_mod_add_del_multi
#@TestID mod_del_add_vs_mod_add_del_multi
#@TestPurpose Modify: Delete+Add then Add+Delete on 2
multi-valued attributes
#@TestPreamble
#@TestSteps Add entry to server1 with
description=1 , telephoneNumber=1
#@TestSteps Disconnect Replication Servers
#@TestSteps server1: add description=2 ,
delete telephoneNumber
#@TestSteps server2: delete description ,
add telephoneNumber=2
#@TestSteps Re-connect Replication Servers
#@TestSteps Check description no longer exists and
telephoneNumber=2 on both servers
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_010" scope="local">
<testcase name="getTestCaseName('mod_del_add_vs_mod_add_del_multi')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: mod_del_add_vs_mod_add_del_multi. \
Modify: Delete+Add then Add+Delete on 2 multi-valued attributes'
</message>
<!-- Add entry to server1 -->
<script>
myEntry = Entry('cn=D1')
myEntry.addAttr('description', '1')
myEntry.addAttr('telephoneNumber', '1')
server1add = ['description:2']
server1del = ['telephoneNumber:']
server2del = ['description:']
server2add = ['telephoneNumber:2']
server1mods = [server1add, server1del]
server2mods = [server2del, server2add]
mods = [server1mods, server2mods]
server1changetypes = ['add', 'delete']
server2changetypes = ['delete', 'add']
changetypes = [server1changetypes, server2changetypes]
</script>
<call function="'addAnEntry'">
{ 'location' : server1Host,
'dsPath' : server1Path,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'DNToAdd' : myEntry.getDn(),
'listAttributes' : myEntry.getAttrList()
}
</call>
<!-- Disconnect Replication Servers -->
<call function="'disconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<iterate var="server"
in="[server1, server2]"
indexvar="i">
<sequence>
<!-- Modify entry on one of the servers -->
<call function="'modifyAnAttribute'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToModify' : myEntry.getDn(),
'listAttributes' : mods[i][0],
'changetype' : changetypes[i][0]
}
</call>
<call function="'modifyAnAttribute'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToModify' : myEntry.getDn(),
'listAttributes' : mods[i][1],
'changetype' : changetypes[i][1]
}
</call>
</sequence>
</iterate>
<!-- Check modifies have not been propagated -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description telephoneNumber',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Reconnect Replication Servers -->
<call function="'reconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Check conflict is resolved -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description telephoneNumber',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix ]
</call>
<!-- Delete added entry -->
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'dsDn' : [myEntry.getDn()]
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict:
mod_add_vs_mod_replace_multi
#@TestID mod_add_vs_mod_replace_multi
#@TestPurpose mod_add vs mod_replace on a multi-valued
attribute
#@TestPreamble
#@TestSteps Add entry to server1 with description=1
#@TestSteps Disconnect Replication Servers
#@TestSteps server1: add description={2 3}
#@TestSteps server2: replace description -> {4 5}
#@TestSteps Re-connect Replication Servers
#@TestSteps Check description={4 5} on both servers
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_011" scope="local">
<testcase name="getTestCaseName('mod_add_vs_mod_replace_multi')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: mod_add_vs_mod_replace_multi. \
mod_add vs mod_replace on a multi-valued attribute'
</message>
<!-- Add entry to server1 -->
<script>
myEntry = Entry('cn=E1')
myEntry.addAttr('description', '1')
server1add = ['description:2', 'description:3']
server2replace = ['description:4', 'description:5']
server1mods = [server1add]
server2mods = [server2replace]
mods = [server1mods, server2mods]
server1changetypes = ['add']
server2changetypes = ['replace']
changetypes = [server1changetypes, server2changetypes]
</script>
<call function="'addAnEntry'">
{ 'location' : server1Host,
'dsPath' : server1Path,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'DNToAdd' : myEntry.getDn(),
'listAttributes' : myEntry.getAttrList()
}
</call>
<!-- Disconnect Replication Servers -->
<call function="'disconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<iterate var="server"
in="[server1, server2]"
indexvar="i">
<sequence>
<!-- Modify entry on one of the servers -->
<call function="'modifyAnAttribute'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToModify' : myEntry.getDn(),
'listAttributes' : mods[i][0],
'changetype' : changetypes[i][0]
}
</call>
</sequence>
</iterate>
<!-- Check modifies have not been propagated -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Reconnect Replication Servers -->
<call function="'reconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Check conflict is resolved -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix ]
</call>
<!-- Delete added entry -->
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'dsDn' : [myEntry.getDn()]
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict:
mod_replace_vs_mod_add_multi
#@TestID mod_replace_vs_mod_add_multi
#@TestPurpose mod_replace vs mod_add on a multi-valued
attribute
#@TestPreamble
#@TestSteps Add entry to server1 with description=1
#@TestSteps Disconnect Replication Servers
#@TestSteps server1: replace description -> {2 3}
#@TestSteps server2: add description={4 5}
#@TestSteps Re-connect Replication Servers
#@TestSteps Check description={2 3 4 5} on both servers
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_012" scope="local">
<testcase name="getTestCaseName('mod_replace_vs_mod_add_multi')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: mod_replace_vs_mod_add_multi. \
mod_replace vs mod_add on a multi-valued attribute'
</message>
<!-- Add entry to server1 -->
<script>
myEntry = Entry('cn=E2')
myEntry.addAttr('description', '1')
server1replace = ['description:2', 'description:3']
server2add = ['description:4', 'description:5']
server1mods = [server1replace]
server2mods = [server2add]
mods = [server1mods, server2mods]
server1changetypes = ['replace']
server2changetypes = ['add']
changetypes = [server1changetypes, server2changetypes]
</script>
<call function="'addAnEntry'">
{ 'location' : server1Host,
'dsPath' : server1Path,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'DNToAdd' : myEntry.getDn(),
'listAttributes' : myEntry.getAttrList()
}
</call>
<!-- Disconnect Replication Servers -->
<call function="'disconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<iterate var="server"
in="[server1, server2]"
indexvar="i">
<sequence>
<!-- Modify entry on one of the servers -->
<call function="'modifyAnAttribute'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToModify' : myEntry.getDn(),
'listAttributes' : mods[i][0],
'changetype' : changetypes[i][0]
}
</call>
</sequence>
</iterate>
<!-- Check modifies have not been propagated -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Reconnect Replication Servers -->
<call function="'reconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Check conflict is resolved -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix ]
</call>
<!-- Delete added entry -->
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'dsDn' : [myEntry.getDn()]
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict:
mod_del_vs_mod_replace_multi
#@TestID mod_del_vs_mod_replace_multi
#@TestPurpose mod_del vs mod_replace on a multi-valued
attribute
#@TestPreamble
#@TestSteps Add entry to server1 with
description={1 2 3 4}
#@TestSteps Disconnect Replication Servers
#@TestSteps server1: delete description={2 3}
#@TestSteps server2: replace description -> {6 7 8 9 10}
#@TestSteps Re-connect Replication Servers
#@TestSteps Check description={6 7 8 9 10} on both servers
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_013" scope="local">
<testcase name="getTestCaseName('mod_del_vs_mod_replace_multi')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: mod_del_vs_mod_replace_multi. \
mod_del vs mod_replace on a multi-valued attribute'
</message>
<!-- Add entry to server1 -->
<script>
myEntry = Entry('cn=F1')
for x in range(4):
myEntry.addAttr('description', '%i' % (x+1))
server1del = ['description:2', 'description:3']
server2replace = []
for y in range(6,11):
server2replace.append('description:%i' % y)
server1mods = [server1del]
server2mods = [server2replace]
mods = [server1mods, server2mods]
server1changetypes = ['delete']
server2changetypes = ['replace']
changetypes = [server1changetypes, server2changetypes]
</script>
<call function="'addAnEntry'">
{ 'location' : server1Host,
'dsPath' : server1Path,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'DNToAdd' : myEntry.getDn(),
'listAttributes' : myEntry.getAttrList()
}
</call>
<!-- Disconnect Replication Servers -->
<call function="'disconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<iterate var="server"
in="[server1, server2]"
indexvar="i">
<sequence>
<!-- Modify entry on one of the servers -->
<call function="'modifyAnAttribute'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToModify' : myEntry.getDn(),
'listAttributes' : mods[i][0],
'changetype' : changetypes[i][0]
}
</call>
</sequence>
</iterate>
<!-- Check modifies have not been propagated -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Reconnect Replication Servers -->
<call function="'reconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Check conflict is resolved -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix ]
</call>
<!-- Delete added entry -->
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'dsDn' : [myEntry.getDn()]
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict:
mod_replace_vs_mod_del_multi
#@TestID mod_replace_vs_mod_del_multi
#@TestPurpose mod_replace vs mod_del on a multi-valued
attribute
#@TestPreamble
#@TestSteps Add entry to server1 with
description={1 2 3 4}
#@TestSteps Disconnect Replication Servers
#@TestSteps server1: replace description -> {1 2 3}
#@TestSteps server2: delete description={3 4}
#@TestSteps Re-connect Replication Servers
#@TestSteps Check description={1 2} on both servers
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_014" scope="local">
<testcase name="getTestCaseName('mod_replace_vs_mod_del_multi')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: mod_replace_vs_mod_del_multi. \
mod_replace vs mod_del on a multi-valued attribute'
</message>
<!-- Add entry to server1 -->
<script>
myEntry = Entry('cn=F2')
for x in range(4):
myEntry.addAttr('description', '%i' % (x+1))
server1replace = ['description:1', 'description:2',
'description:3']
server2del = ['description:3', 'description:4']
server1mods = [server1replace]
server2mods = [server2del]
mods = [server1mods, server2mods]
server1changetypes = ['replace']
server2changetypes = ['delete']
changetypes = [server1changetypes, server2changetypes]
</script>
<call function="'addAnEntry'">
{ 'location' : server1Host,
'dsPath' : server1Path,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'DNToAdd' : myEntry.getDn(),
'listAttributes' : myEntry.getAttrList()
}
</call>
<!-- Disconnect Replication Servers -->
<call function="'disconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<iterate var="server"
in="[server1, server2]"
indexvar="i">
<sequence>
<!-- Modify entry on one of the servers -->
<call function="'modifyAnAttribute'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToModify' : myEntry.getDn(),
'listAttributes' : mods[i][0],
'changetype' : changetypes[i][0]
}
</call>
</sequence>
</iterate>
<!-- Check modifies have not been propagated -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Reconnect Replication Servers -->
<call function="'reconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Check conflict is resolved -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : myEntry.getDn(),
'dsFilter' : 'objectclass=*',
'dsAttributes' : 'description',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix ]
</call>
<!-- Delete added entry -->
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'dsDn' : [myEntry.getDn()]
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict: add_child_del_parent
#@TestID add_child_del_parent
#@TestPurpose Add a child vs delete his parent
#@TestPreamble
#@TestSteps Add entry cn=P1 to server1
#@TestSteps Disconnect Replication Servers
#@TestSteps server2: add child cn=C1,cn=P1
#@TestSteps server1: delete parent cn=P1
#@TestSteps Re-connect Replication Servers
#@TestSteps Check servers are synchronised
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_015" scope="local">
<testcase name="getTestCaseName('add_child_del_parent')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: add_child_del_parent. \
Add a child vs delete his parent'
</message>
<!-- Add entry to server1 -->
<script>
parentEntry = Entry('cn=P1')
parentEntry.addAttr('givenname', 'DUMMY ENTRY')
childEntry = Entry('cn=C1,cn=P1')
childEntry.addAttr('givenname', 'DUMMY ENTRY')
# addedEntries = [[], []]
</script>
<call function="'addAnEntry'">
{ 'location' : server1Host,
'dsPath' : server1Path,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'DNToAdd' : parentEntry.getDn(),
'listAttributes' : parentEntry.getAttrList()
}
</call>
<!-- Disconnect Replication Servers -->
<call function="'disconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Add child entry on server2 -->
<call function="'addAnEntry'">
{ 'location' : server2Host,
'dsPath' : server2Path,
'dsInstanceHost' : server2Host,
'dsInstancePort' : server2.getPort(),
'dsInstanceDn' : server2.getRootDn(),
'dsInstancePswd' : server2.getRootPwd(),
'DNToAdd' : childEntry.getDn(),
'listAttributes' : childEntry.getAttrList()
}
</call>
<!-- Delete parent entry on server1-->
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'dsDn' : [parentEntry.getDn()]
}
</call>
<!-- Check modifies have not been propagated -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : synchroSuffix,
'dsFilter' : 'givenname=DUMMY ENTRY',
'dsAttributes' : 'ds-sync-conflict cn',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
<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' : 'cn=monitor',
'dsFilter' : monitorFilter,
'dsAttributes' : monitorCounters,
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Reconnect Replication Servers -->
<call function="'reconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Check conflict is resolved -->
<paralleliterate var="server"
in="[server1, server2]"
indexvar="i">
<sequence>
<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' : synchroSuffix,
'dsFilter' : 'givenname=DUMMY ENTRY',
'dsAttributes' : 'ds-sync-conflict cn',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
<script>
resultDnList = []
for line in searchResult.splitlines():
if line.find('dn: ') != -1:
resultDn = line[len('dn: '):]
resultDnList.append(resultDn)
addedEntries[i] = resultDnList
</script>
</sequence>
<else>
<script>
addedEntries[i] = []
</script>
</else>
</if>
<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' : 'cn=monitor',
'dsFilter' : monitorFilter,
'dsAttributes' : monitorCounters,
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix ]
</call>
<!-- Delete added entries -->
<script>
list1 = addedEntries[0]
list2 = addedEntries[1]
toRemove = []
# remove potential redundancies, to avoid deleting them twice
for addedEntry in list2:
if addedEntry in list1:
toRemove.append(addedEntry)
for ent in toRemove:
list2.remove(ent)
</script>
<paralleliterate var="server"
in="[server1, server2]"
indexvar="i">
<if expr="len(addedEntries[i]) != 0">
<paralleliterate var="entryToDelete" in="addedEntries[i]">
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'dsDn' : [entryToDelete]
}
</call>
</paralleliterate>
</if>
</paralleliterate>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict: del_parent_add_child
#@TestID del_parent_add_child
#@TestPurpose Delete a parent vs add his child
#@TestPreamble
#@TestSteps Add entry cn=P2 to server1
#@TestSteps Disconnect Replication Servers
#@TestSteps server1: delete parent cn=P2
#@TestSteps server2: add child cn=C2,cn=P2
#@TestSteps Re-connect Replication Servers
#@TestSteps Check servers are synchronised
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_016" scope="local">
<testcase name="getTestCaseName('del_parent_add_child')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: del_parent_add_child. \
Delete a parent vs add his child'
</message>
<!-- Add entry to server1 -->
<script>
parentEntry = Entry('cn=P2')
parentEntry.addAttr('givenname', 'DUMMY ENTRY')
childEntry = Entry('cn=C2,cn=P2')
childEntry.addAttr('givenname', 'DUMMY ENTRY')
# addedEntries = [[], []]
</script>
<call function="'addAnEntry'">
{ 'location' : server1Host,
'dsPath' : server1Path,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'DNToAdd' : parentEntry.getDn(),
'listAttributes' : parentEntry.getAttrList()
}
</call>
<!-- Disconnect Replication Servers -->
<call function="'disconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Delete parent entry on server1-->
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'dsDn' : [parentEntry.getDn()]
}
</call>
<!-- Add child entry on server2 -->
<call function="'addAnEntry'">
{ 'location' : server2Host,
'dsPath' : server2Path,
'dsInstanceHost' : server2Host,
'dsInstancePort' : server2.getPort(),
'dsInstanceDn' : server2.getRootDn(),
'dsInstancePswd' : server2.getRootPwd(),
'DNToAdd' : childEntry.getDn(),
'listAttributes' : childEntry.getAttrList()
}
</call>
<!-- Check modifies have not been propagated -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : synchroSuffix,
'dsFilter' : 'givenname=DUMMY ENTRY',
'dsAttributes' : 'ds-sync-conflict cn',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
<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' : 'cn=monitor',
'dsFilter' : monitorFilter,
'dsAttributes' : monitorCounters,
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Reconnect Replication Servers -->
<call function="'reconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Check conflict is resolved -->
<paralleliterate var="server"
in="[server1, server2]"
indexvar="i">
<sequence>
<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' : synchroSuffix,
'dsFilter' : 'givenname=DUMMY ENTRY',
'dsAttributes' : 'ds-sync-conflict cn',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
<script>
resultDnList = []
for line in searchResult.splitlines():
if line.find('dn: ') != -1:
resultDn = line[len('dn: '):]
resultDnList.append(resultDn)
addedEntries[i] = resultDnList
</script>
</sequence>
<else>
<script>
addedEntries[i] = []
</script>
</else>
</if>
<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' : 'cn=monitor',
'dsFilter' : monitorFilter,
'dsAttributes' : monitorCounters,
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix ]
</call>
<!-- Delete added entries -->
<script>
list1 = addedEntries[0]
list2 = addedEntries[1]
toRemove = []
# remove potential redundancies, to avoid deleting them twice
for addedEntry in list2:
if addedEntry in list1:
toRemove.append(addedEntry)
for ent in toRemove:
list2.remove(ent)
</script>
<paralleliterate var="server"
in="[server1, server2]"
indexvar="i">
<if expr="len(addedEntries[i]) != 0">
<paralleliterate var="entryToDelete" in="addedEntries[i]">
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'dsDn' : [entryToDelete]
}
</call>
</paralleliterate>
</if>
</paralleliterate>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict: double_add
#@TestID double_add
#@TestPurpose Double add (same dn, different uid)
#@TestPreamble
#@TestSteps Disconnect Replication Servers
#@TestSteps server1: add entry cn=F with uid=1
#@TestSteps server2: add entry cn=F with uid=2
#@TestSteps Re-connect Replication Servers
#@TestSteps Check servers are synchronised
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_017" scope="local">
<testcase name="getTestCaseName('double_add')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: double_add. \
Double add (same dn, different uid)'
</message>
<script>
entry1 = Entry('cn=F')
entry1.addAttr('uid', '1')
entry1.addAttr('givenname', 'DUMMY ENTRY')
entry2 = Entry('cn=F')
entry2.addAttr('uid', '2')
entry2.addAttr('givenname', 'DUMMY ENTRY')
entriesToAdd = [entry1, entry2]
</script>
<!-- Disconnect Replication Servers -->
<call function="'disconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<iterate var="server"
in="[server1, server2]"
indexvar="i">
<sequence>
<!-- Add entry on one of the servers -->
<call function="'addAnEntry'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToAdd' : entriesToAdd[i].getDn(),
'listAttributes' : entriesToAdd[i].getAttrList()
}
</call>
</sequence>
</iterate>
<!-- Check modifies have not been propagated -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : synchroSuffix,
'dsFilter' : 'givenname=DUMMY ENTRY',
'dsAttributes' : 'ds-sync-conflict uid cn',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
<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' : 'cn=monitor',
'dsFilter' : monitorFilter,
'dsAttributes' : monitorCounters,
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Reconnect Replication Servers -->
<call function="'reconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Check conflict is resolved -->
<paralleliterate var="server"
in="[server1, server2]"
indexvar="i">
<sequence>
<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' : synchroSuffix,
'dsFilter' : 'givenname=DUMMY ENTRY',
'dsAttributes' : 'ds-sync-conflict uid cn',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
<script>
resultDnList = []
for line in searchResult.splitlines():
if line.find('dn: ') != -1:
resultDn = line[len('dn: '):]
resultDnList.append(resultDn)
addedEntries[i] = resultDnList
</script>
</sequence>
<else>
<script>
addedEntries[i] = []
</script>
</else>
</if>
<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' : 'cn=monitor',
'dsFilter' : monitorFilter,
'dsAttributes' : monitorCounters,
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<!-- If the trees don't match, we may have come across Issue OPENDJ-454
(RFE: Solve naming conflict of 2 adds with same dn, different
attr value) -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix,
'OPENDJ-454' ]
</call>
<!-- Delete added entries -->
<script>
list1 = addedEntries[0]
list2 = addedEntries[1]
toRemove = []
# remove potential redundancies, to avoid deleting them twice
for addedEntry in list2:
if addedEntry in list1:
toRemove.append(addedEntry)
for ent in toRemove:
list2.remove(ent)
</script>
<paralleliterate var="server"
in="[server1, server2]"
indexvar="i">
<if expr="len(addedEntries[i]) != 0">
<paralleliterate var="entryToDelete" in="addedEntries[i]">
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'dsDn' : [entryToDelete]
}
</call>
</paralleliterate>
</if>
</paralleliterate>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Replication Conflict Tests
#@TestName Replication: Conflict: double_add_single_del_1
#@TestID double_add_single_del_1
#@TestPurpose Add twice same dn, then delete it in one server
#@TestPreamble
#@TestSteps Disconnect Replication Servers
#@TestSteps server1: add entry cn=DN1 with uid=1
#@TestSteps server2: add entry cn=DN1 with uid=2
#@TestSteps Re-connect Replication Servers
#@TestSteps server1: delete entry cn=DN1
#@TestSteps Check servers are synchronised
#@TestPostamble
#@TestResult Success if trees are synchronised
-->
<function name="replication_conflict_018" scope="local">
<testcase name="getTestCaseName('double_add_single_del_1')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<message>
'Replication: Conflict: double_add_single_del_1. \
Add twice same dn, then delete it in one server'
</message>
<script>
entry1 = Entry('cn=DN1')
entry1.addAttr('uid', '1')
entry1.addAttr('givenname', 'DUMMY ENTRY')
entry2 = Entry('cn=DN1')
entry2.addAttr('uid', '2')
entry2.addAttr('givenname', 'DUMMY ENTRY')
entriesToAdd = [entry1, entry2]
</script>
<!-- Disconnect Replication Servers -->
<call function="'disconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<iterate var="server"
in="[server1, server2]"
indexvar="i">
<sequence>
<!-- Add entry on one of the servers -->
<call function="'addAnEntry'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' \
% (server.getDir(), OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'DNToAdd' : entriesToAdd[i].getDn(),
'listAttributes' : entriesToAdd[i].getAttrList()
}
</call>
</sequence>
</iterate>
<!-- Check modifies have not been propagated -->
<paralleliterate var="server" in="[server1, server2]">
<sequence>
<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' : synchroSuffix,
'dsFilter' : 'givenname=DUMMY ENTRY',
'dsAttributes' : 'ds-sync-conflict uid cn',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
<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' : 'cn=monitor',
'dsFilter' : monitorFilter,
'dsAttributes' : monitorCounters,
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Reconnect Replication Servers -->
<call function="'reconnectReplicationServers'">
[ clientHost, clientPath, [replServer1, replServer2] ]
</call>
<!-- Delete entry on server1-->
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server1Host,
'dsInstancePort' : server1.getPort(),
'dsInstanceDn' : server1.getRootDn(),
'dsInstancePswd' : server1.getRootPwd(),
'dsDn' : [entry1.getDn()]
}
</call>
<!-- Check conflict is resolved -->
<paralleliterate var="server"
in="[server1, server2]"
indexvar="i">
<sequence>
<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' : synchroSuffix,
'dsFilter' : 'givenname=DUMMY ENTRY',
'dsAttributes' : 'ds-sync-conflict uid cn',
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
<script>
resultDnList = []
for line in searchResult.splitlines():
if line.find('dn: ') != -1:
resultDn = line[len('dn: '):]
resultDnList.append(resultDn)
addedEntries[i] = resultDnList
</script>
</sequence>
<else>
<script>
addedEntries[i] = []
</script>
</else>
</if>
<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' : 'cn=monitor',
'dsFilter' : monitorFilter,
'dsAttributes' : monitorCounters,
'logStderr' : False
}
</call>
<script>
searchRC = STAXResult[0][0]
searchResult = STAXResult[0][1]
resultLength = len(searchResult) > 0
</script>
<if expr="resultLength != 0">
<sequence>
<message>
'+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
% (server.getHostname(), server.getPort(), searchResult)
</message>
</sequence>
</if>
</sequence>
</paralleliterate>
<!-- Verify the synchronization of the trees among the servers in
the topology -->
<!-- If the trees don't match, we may have come across Issue OPENDJ-454
(RFE: Solve naming conflict of 2 adds with same dn, different
attr value) -->
<call function="'verifyTrees'">
[ clientHost, clientPath, server1, [server2], synchroSuffix,
'OPENDJ-454' ]
</call>
<!-- Delete added entries -->
<script>
list1 = addedEntries[0]
list2 = addedEntries[1]
toRemove = []
# remove potential redundancies, to avoid deleting them twice
for addedEntry in list2:
if addedEntry in list1:
toRemove.append(addedEntry)
for ent in toRemove:
list2.remove(ent)
</script>
<paralleliterate var="server"
in="[server1, server2]"
indexvar="i">
<if expr="len(addedEntries[i]) != 0">
<paralleliterate var="entryToDelete" in="addedEntries[i]">
<call function="'ldapDeleteWithScript'">
{ 'location' : clientHost,
'dsPath' : clientPath,
'dsInstanceHost' : server.getHostname(),
'dsInstancePort' : server.getPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'dsDn' : [entryToDelete]
}
</call>
</paralleliterate>
</if>
</paralleliterate>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
</stax>