8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams<?xml version="1.0" encoding="UTF-8" standalone="no"?>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams ! CDDL HEADER START
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams ! The contents of this file are subject to the terms of the
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams ! Common Development and Distribution License, Version 1.0 only
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams ! (the "License"). You may not use this file except in compliance
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams ! with the License.
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac ! or http://forgerock.org/license/CDDLv1.0.html.
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams ! See the License for the specific language governing permissions
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams ! and limitations under the License.
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams ! When distributing Covered Code, include this CDDL HEADER in each
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac ! file and include the License file at legal-notices/CDDLv1_0.txt.
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac ! If applicable, add the following below this CDDL HEADER, with the
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac ! fields enclosed by brackets "[]" replaced with your own identifying
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac ! information:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams ! Portions Copyright [yyyy] [name of copyright owner]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams ! CDDL HEADER END
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams ! Portions Copyright 2006-2009 Sun Microsystems, Inc.
8d476951ba505c2f221f2729d043a6c9bc5f4683csovant ! Portions Copyright 2011-2013 ForgeRock AS.
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict: Basic check
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID Basic check
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose Check replication assures synchronization after
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams a simultaneous conflictuous modify on 2
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams different servers (regardless of the prevailing
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Add entry to server1 with employeeNumber:0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Parallel replace
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1: employeeNumber -> 1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2: employeeNumber -> 2
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check entry consistent on both servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_001" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('Basic check')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: Basic check 0. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams Check replication assures synchronization after a simultaneous \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams conflictuous modify on 2 different servers (regardless of the \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams prevailing modify)'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry to server1 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry = Entry('uid=tuser-0')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry.addAttr('employeeNumber', '0')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server1Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : myEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'sleepForMilliSeconds' : 2000 }
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Modify entry on one of the servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToModify' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'attributeName' : 'employeeNumber',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'newAttributeValue' : '%i' % (i + 1),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'changetype' : 'replace'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'employeeNumber',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, server1, [server2], synchroSuffix ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entry -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict: double_replace_multi
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID double_replace_multi
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose Double replace a multi-valued attribute
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Add entry to server1 with description:{1 2}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Disconnect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: replace description -> {3 4}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server2: replace description -> {5 6}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Re-connect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check description={5 6} on both servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_002" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('double_replace_multi')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: double_replace_multi. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams Double replace a multi-valued attribute'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry to server1 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry = Entry('cn=A1')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry.addAttr('description', '1')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry.addAttr('description', '2')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1mods = ['description:3', 'description:4']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2mods = ['description:5', 'description:6']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mods = [server1mods, server2mods]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server1Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : myEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Disconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'disconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Modify entry on one of the servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToModify' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : mods[i],
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'changetype' : 'replace'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check modifies have not been propagated -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Reconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'reconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check conflict is resolved -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, server1, [server2], synchroSuffix ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entry -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict: double_replace_single
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID double_replace_single
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose Double replace a single-valued attribute
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Add entry to server1 with employeeNumber:0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Disconnect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: replace employeeNumber -> 1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server2: replace employeeNumber -> 2
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Re-connect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check employeeNumber=2 on both servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_003" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('double_replace_single')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: double_replace_single. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams Double replace a single-valued attribute'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry to server1 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry = Entry('cn=A4')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry.addAttr('employeeNumber', '0')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server1Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : myEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Disconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'disconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Modify entry on one of the servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToModify' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'attributeName' : 'employeeNumber',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'newAttributeValue' : '%i' % (i + 1),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'changetype' : 'replace'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check modifies have not been propagated -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'employeeNumber',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Reconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'reconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check conflict is resolved -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'employeeNumber',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, server1, [server2], synchroSuffix ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entry -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict: double_mod_del_add_multi_1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID double_mod_del_add_multi_1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose Double replace (del+add) same value with any
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams value of a multi-valued attribute
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Add entry to server1 with
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams description:{1 2 3 4 5 6 7 8 9 10}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Disconnect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: del description=1 + add description=11
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server2: del description=1 + add description=12
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Re-connect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check description={2 3 4 5 6 7 8 9 10 11 12}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams on both servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_004" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('double_mod_del_add_multi_1')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: double_mod_del_add_multi_1. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams Double replace (del+add) same value with any value of a \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams multi-valued attribute'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry to server1 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry = Entry('cn=A2')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams for x in range(10):
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry.addAttr('description', '%i' % (x+1))
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1del = ['description:1']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1add = ['description:11']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2del = ['description:1']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2add = ['description:12']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1mods = [server1del, server1add]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2mods = [server2del, server2add]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mods = [server1mods, server2mods]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server1Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : myEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Disconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'disconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Modify entry on one of the servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToModify' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : mods[i][0],
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'changetype' : 'delete'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToModify' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : mods[i][1],
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'changetype' : 'add'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check modifies have not been propagated -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Reconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'reconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check conflict is resolved -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, server1, [server2], synchroSuffix ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entry -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict: double_mod_del_add_multi_2
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID double_mod_del_add_multi_2
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose Double replace (del+add) any value with same
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams value of a multi-valued attribute
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Add entry to server1 with
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams description:{1 2 3 4 5 6 7 8 9 10}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Disconnect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: del description=1 + add description=11
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server2: del description=10 + add description=11
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Re-connect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check description={2 3 4 5 6 7 8 9 11}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams on both servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_005" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('double_mod_del_add_multi_2')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: double_mod_del_add_multi_2. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams Double replace (del+add) any value with same value of a \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams multi-valued attribute'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry to server1 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry = Entry('cn=A3')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams for x in range(10):
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry.addAttr('description', '%i' % (x+1))
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1del = ['description:1']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1add = ['description:11']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2del = ['description:10']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2add = ['description:11']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1mods = [server1del, server1add]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2mods = [server2del, server2add]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mods = [server1mods, server2mods]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server1Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : myEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Disconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'disconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Modify entry on one of the servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToModify' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : mods[i][0],
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'changetype' : 'delete'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToModify' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : mods[i][1],
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'changetype' : 'add'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check modifies have not been propagated -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Reconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'reconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check conflict is resolved -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, server1, [server2], synchroSuffix ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entry -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict: double_mod_add_multi
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID double_mod_add_multi
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose Double mod_add a multi-valued attribute
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Add entry to server1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Disconnect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: add description=1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server2: add description={1 2}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Re-connect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check description={1 2} on both servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_006" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('double_mod_add_multi')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: double_mod_add_multi. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams Double mod_add a multi-valued attribute'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry to server1 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry = Entry('cn=B1')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1add = ['description:1']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2add = ['description:1', 'description:2']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1mods = [server1add]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2mods = [server2add]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mods = [server1mods, server2mods]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server1Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : myEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Disconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'disconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Modify entry on one of the servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToModify' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : mods[i][0],
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'changetype' : 'add'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check modifies have not been propagated -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Reconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'reconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check conflict is resolved -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, server1, [server2], synchroSuffix ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entry -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict: double_mod_add_single
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID double_mod_add_single
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose Double mod_add a single-valued attribute
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Add entry to server1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Disconnect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: add employeeNumber=1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server2: add employeeNumber=2
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Re-connect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check employeeNumber=1 on both servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_007" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('double_mod_add_single')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: double_mod_add_single. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams Double mod_add a single-valued attribute'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry to server1 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry = Entry('cn=B2')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1add = ['employeeNumber:1']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2add = ['employeeNumber:2']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1mods = [server1add]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2mods = [server2add]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mods = [server1mods, server2mods]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server1Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : myEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Disconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'disconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Modify entry on one of the servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToModify' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : mods[i][0],
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'changetype' : 'add'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check modifies have not been propagated -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'employeeNumber',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Reconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'reconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check conflict is resolved -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'employeeNumber',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, server1, [server2], synchroSuffix ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entry -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict: double_mod_del_multi
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID double_mod_del_multi
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose Double mod_delete a multi-valued attribute
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Add entry to server1 with
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams description:{1 2 3 4 5 6 7 8 9 10}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Disconnect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: delete description={1 2 3 4 5}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server2: delete description={4 5 6 7 8}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Re-connect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check description={9 10} on both servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_008" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('double_mod_del_multi')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: double_mod_del_multi. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams Double mod_delete a multi-valued attribute'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry to server1 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry = Entry('cn=C1')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams for x in range(10):
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry.addAttr('description', '%i' % (x+1))
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1del = []
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams for y in range(1,6):
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1del.append('description:%i' % y)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2del = []
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams for z in range(4,9):
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2del.append('description:%i' % z)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1mods = [server1del]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2mods = [server2del]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mods = [server1mods, server2mods]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server1Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : myEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Disconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'disconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Modify entry on one of the servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToModify' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : mods[i][0],
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'changetype' : 'delete'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check modifies have not been propagated -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Reconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'reconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check conflict is resolved -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, server1, [server2], synchroSuffix ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entry -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict: double_mod_del_single
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID double_mod_del_single
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose Double mod_delete a single-valued attribute
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Add entry to server1 with employeeNumber=1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Disconnect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: delete employeeNumber
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server2: delete employeeNumber=1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Re-connect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check employeeNumber no longer exists on either
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_009" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('double_mod_del_single')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: double_mod_del_single. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams Double mod_delete a single-valued attribute'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry to server1 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry = Entry('cn=C2')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry.addAttr('employeeNumber', '1')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1del = ['employeeNumber:']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2del = ['employeeNumber:1']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1mods = [server1del]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2mods = [server2del]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mods = [server1mods, server2mods]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server1Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : myEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Disconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'disconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Modify entry on one of the servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToModify' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : mods[i][0],
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'changetype' : 'delete'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check modifies have not been propagated -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'employeeNumber',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Reconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'reconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check conflict is resolved -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'employeeNumber',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, server1, [server2], synchroSuffix ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entry -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mod_del_add_vs_mod_add_del_multi
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID mod_del_add_vs_mod_add_del_multi
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose Modify: Delete+Add then Add+Delete on 2
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams multi-valued attributes
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Add entry to server1 with
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams description=1 , telephoneNumber=1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Disconnect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: add description=2 ,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams delete telephoneNumber
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server2: delete description ,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams add telephoneNumber=2
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Re-connect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check description no longer exists and
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams telephoneNumber=2 on both servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_010" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('mod_del_add_vs_mod_add_del_multi')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: mod_del_add_vs_mod_add_del_multi. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams Modify: Delete+Add then Add+Delete on 2 multi-valued attributes'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry to server1 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry = Entry('cn=D1')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry.addAttr('description', '1')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry.addAttr('telephoneNumber', '1')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1add = ['description:2']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1del = ['telephoneNumber:']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2del = ['description:']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2add = ['telephoneNumber:2']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1mods = [server1add, server1del]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2mods = [server2del, server2add]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mods = [server1mods, server2mods]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1changetypes = ['add', 'delete']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2changetypes = ['delete', 'add']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams changetypes = [server1changetypes, server2changetypes]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server1Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : myEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Disconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'disconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Modify entry on one of the servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToModify' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : mods[i][0],
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'changetype' : changetypes[i][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToModify' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : mods[i][1],
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'changetype' : changetypes[i][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check modifies have not been propagated -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description telephoneNumber',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Reconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'reconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check conflict is resolved -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description telephoneNumber',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, server1, [server2], synchroSuffix ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entry -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mod_add_vs_mod_replace_multi
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID mod_add_vs_mod_replace_multi
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose mod_add vs mod_replace on a multi-valued
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Add entry to server1 with description=1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Disconnect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: add description={2 3}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server2: replace description -> {4 5}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Re-connect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check description={4 5} on both servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_011" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('mod_add_vs_mod_replace_multi')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: mod_add_vs_mod_replace_multi. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mod_add vs mod_replace on a multi-valued attribute'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry to server1 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry = Entry('cn=E1')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry.addAttr('description', '1')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1add = ['description:2', 'description:3']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2replace = ['description:4', 'description:5']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1mods = [server1add]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2mods = [server2replace]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mods = [server1mods, server2mods]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1changetypes = ['add']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2changetypes = ['replace']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams changetypes = [server1changetypes, server2changetypes]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server1Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : myEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Disconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'disconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Modify entry on one of the servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToModify' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : mods[i][0],
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'changetype' : changetypes[i][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check modifies have not been propagated -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Reconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'reconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check conflict is resolved -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, server1, [server2], synchroSuffix ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entry -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mod_replace_vs_mod_add_multi
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID mod_replace_vs_mod_add_multi
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose mod_replace vs mod_add on a multi-valued
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Add entry to server1 with description=1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Disconnect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: replace description -> {2 3}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server2: add description={4 5}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Re-connect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check description={2 3 4 5} on both servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_012" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('mod_replace_vs_mod_add_multi')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: mod_replace_vs_mod_add_multi. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mod_replace vs mod_add on a multi-valued attribute'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry to server1 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry = Entry('cn=E2')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry.addAttr('description', '1')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1replace = ['description:2', 'description:3']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2add = ['description:4', 'description:5']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1mods = [server1replace]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2mods = [server2add]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mods = [server1mods, server2mods]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1changetypes = ['replace']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2changetypes = ['add']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams changetypes = [server1changetypes, server2changetypes]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server1Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : myEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Disconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'disconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Modify entry on one of the servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToModify' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : mods[i][0],
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'changetype' : changetypes[i][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check modifies have not been propagated -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Reconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'reconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check conflict is resolved -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, server1, [server2], synchroSuffix ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entry -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mod_del_vs_mod_replace_multi
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID mod_del_vs_mod_replace_multi
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose mod_del vs mod_replace on a multi-valued
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Add entry to server1 with
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams description={1 2 3 4}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Disconnect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: delete description={2 3}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server2: replace description -> {6 7 8 9 10}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Re-connect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check description={6 7 8 9 10} on both servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_013" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('mod_del_vs_mod_replace_multi')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: mod_del_vs_mod_replace_multi. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mod_del vs mod_replace on a multi-valued attribute'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry to server1 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry = Entry('cn=F1')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams for x in range(4):
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry.addAttr('description', '%i' % (x+1))
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1del = ['description:2', 'description:3']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2replace = []
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams for y in range(6,11):
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2replace.append('description:%i' % y)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1mods = [server1del]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2mods = [server2replace]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mods = [server1mods, server2mods]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1changetypes = ['delete']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2changetypes = ['replace']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams changetypes = [server1changetypes, server2changetypes]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server1Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : myEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Disconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'disconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Modify entry on one of the servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToModify' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : mods[i][0],
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'changetype' : changetypes[i][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check modifies have not been propagated -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Reconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'reconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check conflict is resolved -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, server1, [server2], synchroSuffix ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entry -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mod_replace_vs_mod_del_multi
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID mod_replace_vs_mod_del_multi
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose mod_replace vs mod_del on a multi-valued
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Add entry to server1 with
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams description={1 2 3 4}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Disconnect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: replace description -> {1 2 3}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server2: delete description={3 4}
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Re-connect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check description={1 2} on both servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_014" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('mod_replace_vs_mod_del_multi')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: mod_replace_vs_mod_del_multi. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mod_replace vs mod_del on a multi-valued attribute'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry to server1 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry = Entry('cn=F2')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams for x in range(4):
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams myEntry.addAttr('description', '%i' % (x+1))
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1replace = ['description:1', 'description:2',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'description:3']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2del = ['description:3', 'description:4']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1mods = [server1replace]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2mods = [server2del]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams mods = [server1mods, server2mods]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server1changetypes = ['replace']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams server2changetypes = ['delete']
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams changetypes = [server1changetypes, server2changetypes]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server1Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : myEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Disconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'disconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Modify entry on one of the servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToModify' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : mods[i][0],
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'changetype' : changetypes[i][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check modifies have not been propagated -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Reconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'reconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check conflict is resolved -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : myEntry.getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'objectclass=*',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'description',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, server1, [server2], synchroSuffix ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entry -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict: add_child_del_parent
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID add_child_del_parent
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose Add a child vs delete his parent
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Add entry cn=P1 to server1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Disconnect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server2: add child cn=C1,cn=P1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: delete parent cn=P1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Re-connect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check servers are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_015" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('add_child_del_parent')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: add_child_del_parent. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams Add a child vs delete his parent'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry to server1 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams parentEntry = Entry('cn=P1')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams parentEntry.addAttr('givenname', 'DUMMY ENTRY')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams childEntry = Entry('cn=C1,cn=P1')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams childEntry.addAttr('givenname', 'DUMMY ENTRY')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams # addedEntries = [[], []]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server1Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : parentEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Disconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'disconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add child entry on server2 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server2Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server2Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server2Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server2.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server2.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server2.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : childEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete parent entry on server1-->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check modifies have not been propagated -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : synchroSuffix,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'givenname=DUMMY ENTRY',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'ds-sync-conflict cn',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : 'cn=monitor',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : monitorFilter,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : monitorCounters,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Reconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'reconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check conflict is resolved -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : synchroSuffix,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'givenname=DUMMY ENTRY',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'ds-sync-conflict cn',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultDnList = []
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams if line.find('dn: ') != -1:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultDn = line[len('dn: '):]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams addedEntries[i] = resultDnList
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams addedEntries[i] = []
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : 'cn=monitor',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : monitorFilter,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : monitorCounters,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8d476951ba505c2f221f2729d043a6c9bc5f4683csovant [ clientHost, clientPath, server1, [server2], synchroSuffix ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entries -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams list1 = addedEntries[0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams list2 = addedEntries[1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams toRemove = []
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams # remove potential redundancies, to avoid deleting them twice
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams for addedEntry in list2:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams if addedEntry in list1:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams for ent in toRemove:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="entryToDelete" in="addedEntries[i]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsDn' : [entryToDelete]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict: del_parent_add_child
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID del_parent_add_child
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose Delete a parent vs add his child
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Add entry cn=P2 to server1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Disconnect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: delete parent cn=P2
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server2: add child cn=C2,cn=P2
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Re-connect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check servers are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_016" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('del_parent_add_child')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: del_parent_add_child. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams Delete a parent vs add his child'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry to server1 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams parentEntry = Entry('cn=P2')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams parentEntry.addAttr('givenname', 'DUMMY ENTRY')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams childEntry = Entry('cn=C2,cn=P2')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams childEntry.addAttr('givenname', 'DUMMY ENTRY')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams # addedEntries = [[], []]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server1Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : parentEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Disconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'disconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete parent entry on server1-->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add child entry on server2 -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server2Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : server2Path,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server2Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server2.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server2.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server2.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : childEntry.getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check modifies have not been propagated -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : synchroSuffix,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'givenname=DUMMY ENTRY',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'ds-sync-conflict cn',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : 'cn=monitor',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : monitorFilter,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : monitorCounters,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Reconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'reconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check conflict is resolved -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : synchroSuffix,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'givenname=DUMMY ENTRY',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'ds-sync-conflict cn',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultDnList = []
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams if line.find('dn: ') != -1:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultDn = line[len('dn: '):]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams addedEntries[i] = resultDnList
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams addedEntries[i] = []
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : 'cn=monitor',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : monitorFilter,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : monitorCounters,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8d476951ba505c2f221f2729d043a6c9bc5f4683csovant [ clientHost, clientPath, server1, [server2], synchroSuffix ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entries -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams list1 = addedEntries[0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams list2 = addedEntries[1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams toRemove = []
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams # remove potential redundancies, to avoid deleting them twice
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams for addedEntry in list2:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams if addedEntry in list1:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams for ent in toRemove:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="entryToDelete" in="addedEntries[i]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsDn' : [entryToDelete]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict: double_add
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID double_add
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose Double add (same dn, different uid)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Disconnect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: add entry cn=F with uid=1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server2: add entry cn=F with uid=2
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Re-connect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check servers are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_017" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('double_add')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: double_add. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams Double add (same dn, different uid)'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams entry1 = Entry('cn=F')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams entry1.addAttr('givenname', 'DUMMY ENTRY')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams entry2 = Entry('cn=F')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams entry2.addAttr('givenname', 'DUMMY ENTRY')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams entriesToAdd = [entry1, entry2]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Disconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'disconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry on one of the servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToAdd' : entriesToAdd[i].getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : entriesToAdd[i].getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check modifies have not been propagated -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : synchroSuffix,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'givenname=DUMMY ENTRY',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'ds-sync-conflict uid cn',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : 'cn=monitor',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : monitorFilter,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : monitorCounters,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Reconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'reconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check conflict is resolved -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : synchroSuffix,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'givenname=DUMMY ENTRY',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'ds-sync-conflict uid cn',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultDnList = []
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams if line.find('dn: ') != -1:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultDn = line[len('dn: '):]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams addedEntries[i] = resultDnList
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams addedEntries[i] = []
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : 'cn=monitor',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : monitorFilter,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : monitorCounters,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- If the trees don't match, we may have come across Issue OPENDJ-454
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams (RFE: Solve naming conflict of 2 adds with same dn, different
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams attr value) -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, server1, [server2], synchroSuffix,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'OPENDJ-454' ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entries -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams list1 = addedEntries[0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams list2 = addedEntries[1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams toRemove = []
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams # remove potential redundancies, to avoid deleting them twice
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams for addedEntry in list2:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams if addedEntry in list1:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams for ent in toRemove:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="entryToDelete" in="addedEntries[i]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsDn' : [entryToDelete]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!--- Test Case information
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestMarker Replication Conflict Tests
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestName Replication: Conflict: double_add_single_del_1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestID double_add_single_del_1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPurpose Add twice same dn, then delete it in one server
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPreamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Disconnect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: add entry cn=DN1 with uid=1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server2: add entry cn=DN1 with uid=2
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Re-connect Replication Servers
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps server1: delete entry cn=DN1
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestSteps Check servers are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestPostamble
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams #@TestResult Success if trees are synchronised
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <function name="replication_conflict_018" scope="local">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <testcase name="getTestCaseName('double_add_single_del_1')">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Test Name = %s' % STAXCurrentTestcase
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'Replication: Conflict: double_add_single_del_1. \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams Add twice same dn, then delete it in one server'
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams entry1 = Entry('cn=DN1')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams entry1.addAttr('givenname', 'DUMMY ENTRY')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams entry2 = Entry('cn=DN1')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams entry2.addAttr('givenname', 'DUMMY ENTRY')
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams entriesToAdd = [entry1, entry2]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Disconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'disconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Add entry on one of the servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'DNToAdd' : entriesToAdd[i].getDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'listAttributes' : entriesToAdd[i].getAttrList()
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check modifies have not been propagated -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="server" in="[server1, server2]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : synchroSuffix,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'givenname=DUMMY ENTRY',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'ds-sync-conflict uid cn',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : 'cn=monitor',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : monitorFilter,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : monitorCounters,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Reconnect Replication Servers -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <call function="'reconnectReplicationServers'">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, [replServer1, replServer2] ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete entry on server1-->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server1Host,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server1.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server1.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server1.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Check conflict is resolved -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : synchroSuffix,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : 'givenname=DUMMY ENTRY',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : 'ds-sync-conflict uid cn',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultDnList = []
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams if line.find('dn: ') != -1:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultDn = line[len('dn: '):]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams addedEntries[i] = resultDnList
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams addedEntries[i] = []
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : '%s/%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getDir(), OPENDSNAME),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsBaseDN' : 'cn=monitor',
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsFilter' : monitorFilter,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsAttributes' : monitorCounters,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'logStderr' : False
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchRC = STAXResult[0][0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams searchResult = STAXResult[0][1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams resultLength = len(searchResult) > 0
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams % (server.getHostname(), server.getPort(), searchResult)
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Verify the synchronization of the trees among the servers in
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams the topology -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- If the trees don't match, we may have come across Issue OPENDJ-454
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams (RFE: Solve naming conflict of 2 adds with same dn, different
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams attr value) -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams [ clientHost, clientPath, server1, [server2], synchroSuffix,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'OPENDJ-454' ]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <!-- Delete added entries -->
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams list1 = addedEntries[0]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams list2 = addedEntries[1]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams toRemove = []
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams # remove potential redundancies, to avoid deleting them twice
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams for addedEntry in list2:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams if addedEntry in list1:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams for ent in toRemove:
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams in="[server1, server2]"
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams indexvar="i">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <paralleliterate var="entryToDelete" in="addedEntries[i]">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams { 'location' : clientHost,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsPath' : clientPath,
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceHost' : server.getHostname(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePort' : server.getPort(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstanceDn' : server.getRootDn(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsInstancePswd' : server.getRootPwd(),
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams 'dsDn' : [entryToDelete]
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams </paralleliterate>
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
8fc236b9a04ca8cf4a6ee748cc701210ce4910d6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)
4127344404b29de47ee135390517f65b14e3c35fcsovant <!--- Test Case information
4127344404b29de47ee135390517f65b14e3c35fcsovant #@TestMarker Replication Conflict Tests
4127344404b29de47ee135390517f65b14e3c35fcsovant #@TestName Replication: Conflict: double_mod_add_del_single
4127344404b29de47ee135390517f65b14e3c35fcsovant #@TestID double_mod_add_del_single
4127344404b29de47ee135390517f65b14e3c35fcsovant #@TestPurpose Double mod_add_del a single-valued attribute
4127344404b29de47ee135390517f65b14e3c35fcsovant #@TestPreamble
4127344404b29de47ee135390517f65b14e3c35fcsovant #@TestSteps Add entry to server1 (employeeNumber=0)
4127344404b29de47ee135390517f65b14e3c35fcsovant #@TestSteps Disconnect Replication Servers
4127344404b29de47ee135390517f65b14e3c35fcsovant #@TestSteps server1: add employeeNumber=2, del employeeNumber=1
4127344404b29de47ee135390517f65b14e3c35fcsovant #@TestSteps server2: add employeeNumber=3, del employeeNumber=1
4127344404b29de47ee135390517f65b14e3c35fcsovant #@TestSteps Re-connect Replication Servers
4127344404b29de47ee135390517f65b14e3c35fcsovant #@TestSteps Check employeeNumber=3 on both servers
4127344404b29de47ee135390517f65b14e3c35fcsovant #@TestPostamble
4127344404b29de47ee135390517f65b14e3c35fcsovant #@TestResult Success if trees are synchronised
4127344404b29de47ee135390517f65b14e3c35fcsovant <function name="replication_conflict_019" scope="local">
4127344404b29de47ee135390517f65b14e3c35fcsovant <testcase name="getTestCaseName('double_mod_add_del_single')">
4127344404b29de47ee135390517f65b14e3c35fcsovant 'Test Name = %s' % STAXCurrentTestcase
4127344404b29de47ee135390517f65b14e3c35fcsovant 'Replication: Conflict: double_mod_add_del_single. \
4127344404b29de47ee135390517f65b14e3c35fcsovant Double mod_add_del a single-valued attribute'
4127344404b29de47ee135390517f65b14e3c35fcsovant <!-- Operation -->
4127344404b29de47ee135390517f65b14e3c35fcsovant server1del = ['employeeNumber:1']
4127344404b29de47ee135390517f65b14e3c35fcsovant server1add = ['employeeNumber:2']
4127344404b29de47ee135390517f65b14e3c35fcsovant server2del = ['employeeNumber:1']
4127344404b29de47ee135390517f65b14e3c35fcsovant server2add = ['employeeNumber:3']
4127344404b29de47ee135390517f65b14e3c35fcsovant server1mods = [server1del, server1add]
4127344404b29de47ee135390517f65b14e3c35fcsovant server2mods = [server2del, server2add]
4127344404b29de47ee135390517f65b14e3c35fcsovant mods = [server1mods, server2mods]
4127344404b29de47ee135390517f65b14e3c35fcsovant <!-- Add entry to server1 -->
4127344404b29de47ee135390517f65b14e3c35fcsovant myEntry = Entry('cn=A4')
4127344404b29de47ee135390517f65b14e3c35fcsovant myEntry.addAttr('employeeNumber', '1')
4127344404b29de47ee135390517f65b14e3c35fcsovant { 'location' : server1Host,
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsPath' : server1Path,
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstanceHost' : server1Host,
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstancePort' : server1.getPort(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstanceDn' : server1.getRootDn(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstancePswd' : server1.getRootPwd(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'DNToAdd' : myEntry.getDn(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'listAttributes' : myEntry.getAttrList()
4127344404b29de47ee135390517f65b14e3c35fcsovant <!-- Disconnect Replication Servers -->
4127344404b29de47ee135390517f65b14e3c35fcsovant [ clientHost, clientPath, [replServer1, replServer2] ]
4127344404b29de47ee135390517f65b14e3c35fcsovant in="[server1, server2]"
4127344404b29de47ee135390517f65b14e3c35fcsovant indexvar="i">
4127344404b29de47ee135390517f65b14e3c35fcsovant <!-- Modify entry on one of the servers -->
4127344404b29de47ee135390517f65b14e3c35fcsovant { 'location' : server.getHostname(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsPath' : '%s/%s' \
4127344404b29de47ee135390517f65b14e3c35fcsovant % (server.getDir(), OPENDSNAME),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstanceHost' : server.getHostname(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstancePort' : server.getPort(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstanceDn' : server.getRootDn(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstancePswd' : server.getRootPwd(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'DNToModify' : myEntry.getDn(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'listAttributes' : mods[i][0],
4127344404b29de47ee135390517f65b14e3c35fcsovant 'changetype' : 'delete'
4127344404b29de47ee135390517f65b14e3c35fcsovant { 'location' : server.getHostname(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsPath' : '%s/%s' \
4127344404b29de47ee135390517f65b14e3c35fcsovant % (server.getDir(), OPENDSNAME),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstanceHost' : server.getHostname(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstancePort' : server.getPort(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstanceDn' : server.getRootDn(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstancePswd' : server.getRootPwd(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'DNToModify' : myEntry.getDn(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'listAttributes' : mods[i][1],
4127344404b29de47ee135390517f65b14e3c35fcsovant 'changetype' : 'add'
4127344404b29de47ee135390517f65b14e3c35fcsovant </sequence>
4127344404b29de47ee135390517f65b14e3c35fcsovant <!-- Check modifies have not been propagated -->
4127344404b29de47ee135390517f65b14e3c35fcsovant <paralleliterate var="server" in="[server1, server2]">
4127344404b29de47ee135390517f65b14e3c35fcsovant { 'location' : server.getHostname(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsPath' : '%s/%s' \
4127344404b29de47ee135390517f65b14e3c35fcsovant % (server.getDir(), OPENDSNAME),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstanceHost' : server.getHostname(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstancePort' : server.getPort(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstanceDn' : server.getRootDn(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstancePswd' : server.getRootPwd(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsBaseDN' : myEntry.getDn(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsFilter' : 'objectclass=*',
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsAttributes' : 'employeeNumber',
4127344404b29de47ee135390517f65b14e3c35fcsovant 'logStderr' : False
4127344404b29de47ee135390517f65b14e3c35fcsovant searchRC = STAXResult[0][0]
4127344404b29de47ee135390517f65b14e3c35fcsovant searchResult = STAXResult[0][1]
4127344404b29de47ee135390517f65b14e3c35fcsovant resultLength = len(searchResult) > 0
4127344404b29de47ee135390517f65b14e3c35fcsovant '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
4127344404b29de47ee135390517f65b14e3c35fcsovant % (server.getHostname(), server.getPort(), searchResult)
4127344404b29de47ee135390517f65b14e3c35fcsovant </sequence>
4127344404b29de47ee135390517f65b14e3c35fcsovant </sequence>
4127344404b29de47ee135390517f65b14e3c35fcsovant </paralleliterate>
4127344404b29de47ee135390517f65b14e3c35fcsovant <!-- Reconnect Replication Servers -->
4127344404b29de47ee135390517f65b14e3c35fcsovant [ clientHost, clientPath, [replServer1, replServer2] ]
4127344404b29de47ee135390517f65b14e3c35fcsovant <!-- Check conflict is resolved -->
4127344404b29de47ee135390517f65b14e3c35fcsovant <paralleliterate var="server" in="[server1, server2]">
4127344404b29de47ee135390517f65b14e3c35fcsovant { 'location' : server.getHostname(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsPath' : '%s/%s' \
4127344404b29de47ee135390517f65b14e3c35fcsovant % (server.getDir(), OPENDSNAME),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstanceHost' : server.getHostname(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstancePort' : server.getPort(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstanceDn' : server.getRootDn(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstancePswd' : server.getRootPwd(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsBaseDN' : myEntry.getDn(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsFilter' : 'objectclass=*',
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsAttributes' : 'employeeNumber',
4127344404b29de47ee135390517f65b14e3c35fcsovant 'logStderr' : False
4127344404b29de47ee135390517f65b14e3c35fcsovant searchRC = STAXResult[0][0]
4127344404b29de47ee135390517f65b14e3c35fcsovant searchResult = STAXResult[0][1]
4127344404b29de47ee135390517f65b14e3c35fcsovant resultLength = len(searchResult) > 0
4127344404b29de47ee135390517f65b14e3c35fcsovant '+++++++++++ LDAPSEARCH RESULT for %s:%s ++++++++\n%s' \
4127344404b29de47ee135390517f65b14e3c35fcsovant % (server.getHostname(), server.getPort(), searchResult)
4127344404b29de47ee135390517f65b14e3c35fcsovant </sequence>
4127344404b29de47ee135390517f65b14e3c35fcsovant </sequence>
4127344404b29de47ee135390517f65b14e3c35fcsovant </paralleliterate>
4127344404b29de47ee135390517f65b14e3c35fcsovant <!-- Verify the synchronization of the trees among the servers in
4127344404b29de47ee135390517f65b14e3c35fcsovant the topology -->
4127344404b29de47ee135390517f65b14e3c35fcsovant [ clientHost, clientPath, server1, [server2], synchroSuffix,
4127344404b29de47ee135390517f65b14e3c35fcsovant 'OPENDJ-1192' ]
4127344404b29de47ee135390517f65b14e3c35fcsovant <!-- Delete added entry -->
4127344404b29de47ee135390517f65b14e3c35fcsovant { 'location' : clientHost,
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsPath' : clientPath,
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstanceHost' : server1Host,
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstancePort' : server1.getPort(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstanceDn' : server1.getRootDn(),
4127344404b29de47ee135390517f65b14e3c35fcsovant 'dsInstancePswd' : server1.getRootPwd(),
4127344404b29de47ee135390517f65b14e3c35fcsovant </sequence>
4127344404b29de47ee135390517f65b14e3c35fcsovant <catch exception="'STAXException'" typevar="eType" var="eInfo">
4127344404b29de47ee135390517f65b14e3c35fcsovant '%s: Test failed. eInfo(%s)' % (eType,eInfo)
4127344404b29de47ee135390517f65b14e3c35fcsovant </sequence>
4127344404b29de47ee135390517f65b14e3c35fcsovant </sequence>
4127344404b29de47ee135390517f65b14e3c35fcsovant </testcase>
4127344404b29de47ee135390517f65b14e3c35fcsovant </function>