4865N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
4865N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
4865N/A<!--
4865N/A ! CDDL HEADER START
4865N/A !
4865N/A ! The contents of this file are subject to the terms of the
4865N/A ! Common Development and Distribution License, Version 1.0 only
4865N/A ! (the "License"). You may not use this file except in compliance
4865N/A ! with the License.
4865N/A !
4865N/A ! You can obtain a copy of the license at
4865N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
4865N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
4865N/A ! See the License for the specific language governing permissions
4865N/A ! and limitations under the License.
4865N/A !
4865N/A ! When distributing Covered Code, include this CDDL HEADER in each
4865N/A ! file and include the License file at
4865N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
4865N/A ! add the following below this CDDL HEADER, with the fields enclosed
4865N/A ! by brackets "[]" replaced with your own identifying information:
4865N/A ! Portions Copyright [yyyy] [name of copyright owner]
4865N/A !
4865N/A ! CDDL HEADER END
4865N/A !
5073N/A ! Copyright 2009-2010 Sun Microsystems, Inc.
6184N/A ! Portions Copyright 2011-2013 ForgeRock AS.
4865N/A ! -->
4865N/A<stax>
4865N/A <defaultcall function="fractional-replication_basic"/>
4865N/A
4865N/A
4865N/A <function name="fractional-replication_basic">
4865N/A <sequence>
4865N/A <block name="'basic'">
4865N/A <try>
4865N/A <sequence>
4865N/A <!--- Test Suite information
4865N/A #@TestSuiteName fractional-replication basic
4865N/A #@TestSuitePurpose Verify the basic fractional replication setup
4865N/A #@TestSuiteID basic tests
4865N/A #@TestSuiteGroup basic
4865N/A #@TestMarker fractional-replication basic
4865N/A #@TestGroup fractional-replication
4865N/A #@TestScript basic.xml
4865N/A #@TestHTMLLink http://opends.dev.java.net/
4865N/A -->
4865N/A <script>
4865N/A if not CurrentTestPath.has_key('group'):
4865N/A CurrentTestPath['group']='fractional-replication'
4865N/A CurrentTestPath['suite']=STAXCurrentBlock
4865N/A </script>
4865N/A
4865N/A <call function="'testSuite_Preamble'"/>
4865N/A
4865N/A <try>
4865N/A <sequence>
4865N/A <!-- fractional-replication setup -->
4865N/A <import machine="STAF_LOCAL_HOSTNAME"
4865N/A file="'%s/testcases/fractional-replication/fractional-replication_setup.xml'
4865N/A % (TESTS_DIR)"/>
4865N/A <call function="'fractional-replication_setup'" />
4865N/A
4865N/A <script>
4865N/A Pservers = _topologyServerList
4865N/A ldapPservers = [ '%s:%s' % (s.getHostname(),s.getPort()) for s in Pservers]
4865N/A fractionalTypes = ['fractional-include','fractional-exclude']
4865N/A </script>
4865N/A
4865N/A <!-- Retrieve replication-domain name -->
4865N/A <paralleliterate var="s" in="Pservers">
4865N/A <sequence>
4865N/A <call function="'dsconfig'">
4865N/A { 'location' : s.getHostname(),
4865N/A 'dsPath' : '%s/%s' % (s.getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : s.getHostname(),
4865N/A 'dsInstanceAdminPort' : s.getAdminPort(),
4865N/A 'dsInstanceDn' : s.getRootDn(),
4865N/A 'dsInstancePswd' : s.getRootPwd(),
4865N/A 'subcommand' : 'list-replication-domains',
4865N/A 'objectType' : 'provider-name',
4865N/A 'objectName' : 'Multimaster Synchronization',
4865N/A }
4865N/A </call>
4865N/A <if expr="RC == 0">
4865N/A <sequence>
4865N/A <script>
4865N/A replicationDomains = STAXResult[0][1]
4865N/A for line in replicationDomains.splitlines():
4865N/A if line.startswith(synchroSuffix):
4865N/A colSplit = line.split(':')
4865N/A domain = colSplit[0].strip()
4865N/A serverId = colSplit[2].strip()
4865N/A ls = '%s:%s' % (s.getHostname(),s.getPort())
4865N/A domainMap[ls] = (domain,serverId)
4865N/A break
4865N/A </script>
4865N/A </sequence>
4865N/A </if>
4865N/A </sequence>
4865N/A </paralleliterate>
4865N/A <script>
5765N/A replDomainSuffix = 'cn=o_example,cn=replication,cn=monitor'
4865N/A </script>
4865N/A <message level="'debug'">'domainMap=%s' % domainMap</message>
4865N/A <script>
4865N/A testsList=[]
4865N/A testsList.append('basic_include')
4865N/A testsList.append('basic_exclude')
4865N/A </script>
4865N/A
4865N/A <!-- Execute the Tests -->
4865N/A <iterate var="__test" in="testsList">
4865N/A <sequence>
4865N/A <call function="'%s' % (__test)" />
4865N/A </sequence>
4865N/A </iterate>
4865N/A </sequence>
4865N/A
4865N/A <finally>
4865N/A <message>'Test Cases Completed.'</message>
4865N/A </finally>
4865N/A
4865N/A </try>
4865N/A </sequence>
4865N/A <finally>
4865N/A <sequence>
4865N/A <!-- Test Suite Cleanup -->
5834N/A <message>'Finally: Global Cleanup.'</message>
4865N/A <try>
4865N/A <sequence>
4865N/A <!-- fractional-replication cleanup -->
4865N/A <import machine="STAF_LOCAL_HOSTNAME"
4865N/A file="'%s/testcases/fractional-replication/fractional-replication_cleanup.xml'
4865N/A % (TESTS_DIR)"/>
4865N/A <call function="'fractional-replication_cleanup'" />
4865N/A </sequence>
4865N/A <catch exception="'STAFException'">
4865N/A <sequence>
4865N/A <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
4865N/A </sequence>
4865N/A </catch>
4865N/A <finally>
4865N/A <call function="'testSuite_Postamble'"/>
4865N/A </finally>
4865N/A </try>
4865N/A </sequence>
4865N/A </finally>
4865N/A </try>
4865N/A </block>
4865N/A </sequence>
4865N/A </function>
4865N/A
4865N/A <function name="basic_exclude">
4865N/A <!--- Test Case information
4865N/A #@TestMarker fractional-replication basic
4865N/A #@TestName basic fractional-exclude
4865N/A #@TestID basic fractional-exclude
4865N/A #@TestPurpose basic fractional-exclude functionality
4865N/A #@TestPreamble
4865N/A #@TestSteps ...
4865N/A #@TestPostamble
4865N/A #@TestResult Success if test replica contains filtered data
4865N/A -->
4865N/A <testcase name="getTestCaseName('basic fractional-exclude')">
4865N/A <try>
4865N/A <sequence>
4865N/A <call function="'testCase_Preamble'"/>
4865N/A <call function="'replicationStatus'">
5765N/A { "server" : Pservers[0],
5765N/A "replicationDomainSuffix" : replDomainSuffix,
4865N/A }
4865N/A </call>
4865N/A <!-- set fractional-exclude on server 2 -->
4865N/A <call function="'set-ops-fractional-replication-attributes'">
4865N/A {
4865N/A "replicationDomain" : domainMap[ldapPservers[1]][0],
4865N/A "server" : Pservers[1],
4865N/A "include" : [('reset','')],
4865N/A "exclude" : [('set','*:description,0.9.2342.19200300.100.1.60')],
4865N/A "expectedRC" : 0
4865N/A }
4865N/A </call>
4865N/A <script>
4865N/A keptAttributes = [ 'cn', 'dn', 'employeeNumber', 'givenName',
4865N/A 'initials', 'l', 'mail', 'mobile', 'objectClass',
4865N/A 'o', 'ou', 'pager', 'postalAddress',
4865N/A 'sn', 'st', 'street', 'telephoneNumber',
4865N/A 'uid', 'userPassword', 'postalCode'
4865N/A ]
4865N/A </script>
4865N/A <!-- verify we have Bad Generation ID -->
4865N/A <call function="'replicationStatus'">
5765N/A { "server" : Pservers[1],
5765N/A "replicationDomainSuffix" : replDomainSuffix,
4865N/A }
4865N/A </call>
4865N/A <if expr="len(STAXResult) == 3 and STAXResult[1].find('Bad generation id') != -1">
4865N/A <call function="'testPassed'"/>
4865N/A <else>
4865N/A <call function="'testFailed'"/>
4865N/A </else>
4865N/A </if>
4865N/A <call function="'getNumberOfEntries'">
4865N/A { "server" : Pservers[1],
4865N/A "backend" : "userRoot",
4865N/A "domain" : "o=example",
4865N/A }
4865N/A </call>
4865N/A <call function="'basic_initialization'"/>
4865N/A
4865N/A <call function="'basic_add'">
5540N/A { 'masterEntry' : '%s/fractional-replication/basic-masterAdd.ldif' \
5540N/A % Pservers[0].getDataDir(),
5540N/A 'replicaEntry' : '%s/fractional-replication/basic-replicaExcludeAdd.ldif' \
5540N/A % Pservers[1].getDataDir()
4865N/A }
4865N/A </call>
4865N/A
4865N/A <call function="'basic_modify'"/>
4865N/A
4865N/A <call function="'basic_modifyDN'"/>
4865N/A
4865N/A <call function="'basic_onlineImport'"/>
4865N/A
4865N/A </sequence>
4865N/A <catch exception="'STAXException.*'" typevar="eType" var="eInfo">
4865N/A <message log="1" level="'fatal'">
4865N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
4865N/A </message>
4865N/A </catch>
4865N/A <finally>
4865N/A <call function="'testCase_Postamble'"/>
4865N/A </finally>
4865N/A </try>
4865N/A </testcase>
4865N/A </function>
4865N/A
4865N/A <function name="basic_include">
4865N/A <!--- Test Case information
4865N/A #@TestMarker fractional-replication basic
4865N/A #@TestName basic fractional-include
4865N/A #@TestID basic fractional-include
4865N/A #@TestPurpose basic fractional-include functionality
4865N/A #@TestPreamble
4865N/A #@TestSteps ...
4865N/A #@TestPostamble
4865N/A #@TestResult Success if test replica contains filtered data
4865N/A -->
4865N/A <testcase name="getTestCaseName('basic fractional-include')">
4865N/A <try>
4865N/A <sequence>
4865N/A <call function="'testCase_Preamble'"/>
4865N/A <call function="'replicationStatus'">
5765N/A { "server" : Pservers[0],
5765N/A "replicationDomainSuffix" : replDomainSuffix,
4865N/A }
4865N/A </call>
4865N/A <!-- set fractional-include on server 2 -->
4865N/A <call function="'set-ops-fractional-replication-attributes'">
4865N/A {
4865N/A "replicationDomain" : domainMap[ldapPservers[1]][0],
4865N/A "server" : Pservers[1],
4865N/A "include" : [('set','*:description')],
4865N/A "exclude" : [('reset','')],
4865N/A "expectedRC" : 0
4865N/A }
4865N/A </call>
4865N/A <script>
4865N/A keptAttributes = ['dn','sn','objectClass','description',
4865N/A 'cn','ou','uid','o',
4865N/A 'ds-sync-generation-id', 'entryUUID'
4865N/A ]
4865N/A </script>
4865N/A <!-- verify we have Bad Generation ID -->
4865N/A <call function="'replicationStatus'">
5765N/A { "server" : Pservers[1],
5765N/A "replicationDomainSuffix" : replDomainSuffix,
4865N/A }
4865N/A </call>
4865N/A <if expr="len(STAXResult) == 3 and STAXResult[1].find('Bad generation id') != -1">
4865N/A <call function="'testPassed'"/>
4865N/A <else>
4865N/A <call function="'testFailed'"/>
4865N/A </else>
4865N/A </if>
4865N/A <call function="'getNumberOfEntries'">
4865N/A { "server" : Pservers[1],
4865N/A "backend" : "userRoot",
4865N/A "domain" : "o=example",
4865N/A }
4865N/A </call>
4865N/A <call function="'basic_initialization'"/>
4865N/A
4865N/A <call function="'basic_add'">
5540N/A { 'masterEntry' : '%s/fractional-replication/basic-masterAdd.ldif' \
5540N/A % Pservers[0].getDataDir(),
5540N/A 'replicaEntry' : '%s/fractional-replication/basic-replicaIncludeAdd.ldif' \
5540N/A % Pservers[1].getDataDir()
4865N/A }
4865N/A </call>
4865N/A
4865N/A <call function="'basic_modify'"/>
4865N/A
4865N/A <call function="'basic_modifyDN'"/>
4865N/A
4865N/A <call function="'basic_onlineImport'"/>
4865N/A
4865N/A </sequence>
4865N/A <catch exception="'STAXException.*'" typevar="eType" var="eInfo">
4865N/A <message log="1" level="'fatal'">
4865N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
4865N/A </message>
4865N/A </catch>
4865N/A <finally>
4865N/A <call function="'testCase_Postamble'"/>
4865N/A </finally>
4865N/A </try>
4865N/A </testcase>
4865N/A </function>
4865N/A
4865N/A
4865N/A <function name="basic_initialization">
4865N/A <!--- Test Case information
4865N/A #@TestMarker fractional-replication basic
4865N/A #@TestName basic initialization
4865N/A #@TestID basic initialization
4865N/A #@TestPurpose check fractional-include Bad Generation ID -> Normal status
4865N/A #@TestPreamble
4865N/A #@TestSteps ...
4865N/A #@TestPostamble
4865N/A #@TestResult Success if test replica contains filtered data
4865N/A -->
4865N/A <testcase name="getTestCaseName('basic initialization')">
4865N/A <try>
4865N/A <sequence>
4865N/A <call function="'testCase_Preamble'"/>
4865N/A <call function="'stopServers'">
4865N/A [ Pservers ]
4865N/A </call>
4974N/A <!-- server 1 import basic-master.ldif -->
4865N/A <call function="'ImportLdifWithScript'">
4865N/A { "location" : Pservers[0].getHostname(),
4865N/A "dsPath" : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
5073N/A "backEnd" : "userRoot",
5540N/A "templateFile" : "%s/fractional-replication/basic-master.template" \
5540N/A % Pservers[0].getDataDir(),
5073N/A "replaceExisting" : True,
4865N/A }
4865N/A </call>
4865N/A <!-- all Pservers : start -->
4865N/A <call function="'startServers'">
4865N/A [ Pservers ]
4865N/A </call>
4865N/A <!-- Check some data was imported into Directory Server -->
5540N/A <message>
5540N/A 'Checking import on %s folder %s.' % (Pservers[0].getHostname(),Pservers[0].getDir())
5540N/A </message>
4865N/A <call function="'checkImport'">
4865N/A { 'location' : Pservers[0].getHostname(),
4865N/A 'dsPath' : '%s/%s' \
4865N/A % (Pservers[0].getDir(),OPENDSNAME),
4865N/A 'dsHost' : Pservers[0].getHostname(),
4865N/A 'dsAdminPort' : Pservers[0].getAdminPort(),
4865N/A 'dsPort' : Pservers[0].getPort(),
4865N/A 'dsDn' : Pservers[0].getRootDn(),
4865N/A 'dsPswd' : Pservers[0].getRootPwd(),
4865N/A 'startDS' : 'no',
4865N/A 'expectedEntries' : ['uid=user.0,ou=People,o=example',
4865N/A 'uid=user.49,ou=People,o=example',
4865N/A 'uid=user.35,ou=People,o=example'
4865N/A ]
4865N/A }
4865N/A </call>
4865N/A <call function="'getNumberOfEntries'">
4865N/A { "server" : Pservers[0],
4865N/A "backend" : "userRoot",
4865N/A "domain" : "o=example",
4865N/A }
4865N/A </call>
4865N/A <call function="'getNumberOfEntries'">
4865N/A { "server" : Pservers[1],
4865N/A "backend" : "userRoot",
4865N/A "domain" : "o=example",
4865N/A }
4865N/A </call>
4865N/A
4865N/A <!-- server 1 : initialize server 1 from server 2 -->
4865N/A <call function="'initializeReplication'">
4865N/A { 'location' : Pservers[0].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
4865N/A 'sourceInstanceHost' : Pservers[0].getHostname(),
4865N/A 'sourceInstanceAdminPort' : Pservers[0].getAdminPort(),
4865N/A 'replicationDnList' : ['o=example']
4865N/A }
4865N/A </call>
4865N/A
4865N/A <call function="'ldapsearchVerifyFrac'">
4865N/A { 'servers' : Pservers,
4865N/A 'keptAttributes' : keptAttributes
4865N/A }
4865N/A </call>
4865N/A <if expr="RC == 0">
4865N/A <call function="'testPassed'"/>
4865N/A <else>
4865N/A <call function="'testFailed'"/>
4865N/A </else>
4865N/A </if>
4865N/A </sequence>
4865N/A
4865N/A <catch exception="'STAXException.*'" typevar="eType" var="eInfo">
4865N/A <message log="1" level="'fatal'">
4865N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
4865N/A </message>
4865N/A </catch>
4865N/A <finally>
4865N/A <call function="'testCase_Postamble'"/>
4865N/A </finally>
4865N/A
4865N/A </try>
4865N/A </testcase>
4865N/A </function>
4865N/A
4865N/A <function name="basic_onlineImport">
4865N/A <!--- Test Case information
4865N/A #@TestMarker fractional-replication basic
4865N/A #@TestName basic online import
4865N/A #@TestID basic online import
4865N/A #@TestPurpose add entries with a online import
4865N/A #@TestPreamble
4865N/A #@TestSteps online import data on Master
4865N/A #@TestSteps online import data on Replica
4865N/A #@TestPostamble
4865N/A #@TestResult Success add on both master and replica is
4865N/A correctly filtered
4865N/A -->
4865N/A <testcase name="getTestCaseName('basic online import')">
4865N/A <try>
4865N/A <sequence>
4865N/A <call function="'testCase_Preamble'"/>
4865N/A
4865N/A <call function="'replicationStatus'">
5765N/A { "server" : Pservers[1],
5765N/A "replicationDomainSuffix" : replDomainSuffix,
4865N/A }
4865N/A </call>
4865N/A
5540N/A <script>
5540N/A thisDataDir1="%s/fractional-replication" \
5540N/A % Pservers[0].getDataDir()
5540N/A thisDataDir2="%s/fractional-replication" \
5540N/A % Pservers[1].getDataDir()
5540N/A thisTempdir1=Pservers[0].getTmpDir()
5540N/A thisTempdir2=Pservers[1].getTmpDir()
5540N/A </script>
5540N/A
4974N/A <call function="'ImportLdifWithScript'">
4865N/A { 'location' : Pservers[0].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[0].getHostname(),
4865N/A 'dsInstanceAdminPort' : Pservers[0].getAdminPort(),
4865N/A 'dsInstanceDn' : Pservers[0].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[0].getRootPwd(),
5073N/A 'backEnd' : 'userRoot',
5073N/A 'append' : True,
5540N/A 'rejectFile' : '%s/basic-masterOnlineImport.rejected' % thisTempdir1,
5073N/A 'overwriteFile' : True,
5540N/A 'templateFile' : '%s/basic-masterOnlineImport.template' % \
5540N/A thisDataDir1
4865N/A }
4865N/A </call>
4974N/A <call function="'ImportLdifWithScript'">
4865N/A { 'location' : Pservers[1].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[1].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[1].getHostname(),
4865N/A 'dsInstanceAdminPort' : Pservers[1].getAdminPort(),
4865N/A 'dsInstanceDn' : Pservers[1].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[1].getRootPwd(),
5073N/A 'backEnd' : 'userRoot',
5073N/A 'append' : True,
5540N/A 'rejectFile' : '%s/basic-masterOnlineImport.rejected' % thisTempdir2,
5073N/A 'overwriteFile' : True,
5540N/A 'templateFile' : '%s/basic-masterOnlineImport.template' % \
5540N/A thisDataDir2
4865N/A }
4865N/A </call>
4865N/A <call function="'replicationStatus'">
5765N/A { "server" : Pservers[1],
5765N/A "replicationDomainSuffix" : replDomainSuffix,
4865N/A }
4865N/A </call>
4865N/A <if expr="len(STAXResult) == 3 and STAXResult[1].find('Bad generation id') != -1">
4865N/A <sequence>
4865N/A <call function="'testFailed'"/>
4865N/A <break/>
4865N/A </sequence>
4865N/A <else>
4865N/A <sequence>
4865N/A <!-- Check some data was imported into Directory Server -->
4865N/A <call function="'checkImport'">
4865N/A { 'location' : Pservers[0].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
4865N/A 'dsHost' : Pservers[0].getHostname(),
4865N/A 'dsAdminPort' : Pservers[0].getAdminPort(),
4865N/A 'dsPort' : Pservers[0].getPort(),
4865N/A 'dsDn' : Pservers[0].getRootDn(),
4865N/A 'dsPswd' : Pservers[0].getRootPwd(),
4865N/A 'startDS' : 'no',
4865N/A 'expectedEntries' : ['uid=user.0,ou=masterOnlineImport,o=example',
4865N/A 'uid=user.2,ou=masterOnlineImport,o=example',
4865N/A 'uid=user.4,ou=masterOnlineImport,o=example'
4865N/A ],
4865N/A }
4865N/A </call>
4865N/A <call function="'checkImport'">
4865N/A { 'location' : Pservers[1].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[1].getDir(),OPENDSNAME),
4865N/A 'dsHost' : Pservers[1].getHostname(),
4865N/A 'dsAdminPort' : Pservers[1].getAdminPort(),
4865N/A 'dsPort' : Pservers[1].getPort(),
4865N/A 'dsDn' : Pservers[1].getRootDn(),
4865N/A 'dsPswd' : Pservers[1].getRootPwd(),
4865N/A 'startDS' : 'no',
4865N/A 'expectedEntries' : ['uid=user.0,ou=masterOnlineImport,o=example',
4865N/A 'uid=user.2,ou=masterOnlineImport,o=example',
4865N/A 'uid=user.4,ou=masterOnlineImport,o=example'
4865N/A ],
4865N/A }
4865N/A </call>
4865N/A </sequence>
4865N/A </else>
4865N/A </if>
4865N/A <call function="'ldapsearchVerifyFrac'">
4865N/A { 'servers' : Pservers,
4865N/A 'keptAttributes' : keptAttributes
4865N/A }
4865N/A </call>
4865N/A <if expr="RC == 0">
4865N/A <call function="'testPassed'"/>
4865N/A <else>
4865N/A <call function="'testFailed'"/>
4865N/A </else>
4865N/A </if>
4865N/A </sequence>
4865N/A <catch exception="'STAXException.*'" typevar="eType" var="eInfo">
4865N/A <message log="1" level="'fatal'">
4865N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
4865N/A </message>
4865N/A </catch>
4865N/A <finally>
4865N/A <call function="'testCase_Postamble'"/>
4865N/A </finally>
4865N/A </try>
4865N/A </testcase>
4865N/A </function>
4865N/A
4865N/A <function name="basic_add">
4865N/A <function-map-args>
4865N/A <function-required-arg name="masterEntry"/>
4865N/A <function-required-arg name="replicaEntry"/>
4865N/A </function-map-args>
4865N/A <!--- Test Case information
4865N/A #@TestMarker fractional-replication basic
4865N/A #@TestName basic add operation
4865N/A #@TestID basic add operation
4865N/A #@TestPurpose check add operation
4865N/A #@TestPreamble
4865N/A #@TestSteps ...
4865N/A #@TestPostamble
4865N/A #@TestResult Success add on both master and replica is
4865N/A correctly filtered
4865N/A -->
4865N/A <testcase name="getTestCaseName('basic add operation')">
4865N/A <try>
4865N/A <sequence>
4865N/A <call function="'testCase_Preamble'"/>
4865N/A <!-- adding entry with filterable attributes in master -->
4865N/A <call function="'addEntry'">
4865N/A { 'location' : Pservers[0].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[0].getHostname(),
4865N/A 'dsInstancePort' : Pservers[0].getPort(),
4865N/A 'dsInstanceDn' : Pservers[0].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[0].getRootPwd(),
4865N/A 'entryToBeAdded' : masterEntry,
4865N/A }
4865N/A </call>
4865N/A <call function="'SearchObject'">
4865N/A { 'location' : Pservers[0].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[0].getHostname(),
4865N/A 'dsInstancePort' : Pservers[0].getPort(),
4865N/A 'dsInstanceDn' : Pservers[0].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[0].getRootPwd(),
4865N/A 'dsBaseDN' : 'uid=added-user.0,ou=People,o=example',
4865N/A 'dsFilter' : 'objectclass=*',
4865N/A 'extraParams' : '-s base' }
4865N/A </call>
4865N/A
4865N/A <call function="'ldapsearchVerifyFrac'">
4865N/A { 'servers' : Pservers,
4865N/A 'keptAttributes' : keptAttributes
4865N/A }
4865N/A </call>
4865N/A <if expr="RC == 0">
4865N/A <sequence>
4865N/A <call function="'testPassed'"/>
4865N/A <!-- Delete previously added entry -->
4865N/A <call function="'ldapDeleteWithScript'">
4865N/A { 'location' : Pservers[0].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[0].getHostname(),
4865N/A 'dsInstancePort' : Pservers[0].getPort(),
4865N/A 'dsInstanceDn' : Pservers[0].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[0].getRootPwd(),
4865N/A 'dsDn' : ['uid=added-user.0,ou=People,o=example'],
4865N/A }
4865N/A </call>
4865N/A </sequence>
4865N/A <else>
4865N/A <call function="'testFailed'"/>
4865N/A </else>
4865N/A </if>
4865N/A <!-- adding entry with filterable attributes in replica -->
4865N/A <call function="'addEntry'">
4865N/A { 'location' : Pservers[1].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[1].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[1].getHostname(),
4865N/A 'dsInstancePort' : Pservers[1].getPort(),
4865N/A 'dsInstanceDn' : Pservers[1].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[1].getRootPwd(),
4865N/A 'entryToBeAdded' : masterEntry,
4865N/A 'expectedRC' : 53
4865N/A }
4865N/A </call>
4865N/A <!-- adding entry without filterable attributes in replica -->
4865N/A <call function="'addEntry'">
4865N/A { 'location' : Pservers[1].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[1].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[1].getHostname(),
4865N/A 'dsInstancePort' : Pservers[1].getPort(),
4865N/A 'dsInstanceDn' : Pservers[1].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[1].getRootPwd(),
4865N/A 'entryToBeAdded' : replicaEntry
4865N/A }
4865N/A </call>
4865N/A <call function="'SearchObject'">
4865N/A { 'location' : Pservers[1].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[1].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[1].getHostname(),
4865N/A 'dsInstancePort' : Pservers[1].getPort(),
4865N/A 'dsInstanceDn' : Pservers[1].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[1].getRootPwd(),
4865N/A 'dsBaseDN' : 'cn=added-user.1,ou=People,o=example',
4865N/A 'dsFilter' : 'objectclass=*',
4865N/A 'extraParams' : '-s base' }
4865N/A </call>
4865N/A
4865N/A <if expr="RC == 0">
4865N/A <sequence>
4865N/A <call function="'ldapsearchVerifyFrac'">
4865N/A { 'servers' : Pservers,
4865N/A 'keptAttributes' : keptAttributes
4865N/A }
4865N/A </call>
4865N/A <if expr="RC == 0">
4865N/A <sequence>
4865N/A <call function="'testPassed'"/>
4865N/A <!-- Delete previously added entry -->
4865N/A <call function="'ldapDeleteWithScript'">
4865N/A { 'location' : Pservers[1].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[1].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[1].getHostname(),
4865N/A 'dsInstancePort' : Pservers[1].getPort(),
4865N/A 'dsInstanceDn' : Pservers[1].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[1].getRootPwd(),
4865N/A 'dsDn' : ['cn=added-user.1,ou=People,o=example'],
4865N/A }
4865N/A </call>
4865N/A </sequence>
4865N/A <else>
4865N/A <call function="'testFailed'"/>
4865N/A </else>
4865N/A </if>
4865N/A </sequence>
4865N/A </if>
4865N/A </sequence>
4865N/A <catch exception="'STAXException.*'" typevar="eType" var="eInfo">
4865N/A <message log="1" level="'fatal'">
4865N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
4865N/A </message>
4865N/A </catch>
4865N/A <finally>
4865N/A <call function="'testCase_Postamble'"/>
4865N/A </finally>
4865N/A </try>
4865N/A </testcase>
4865N/A </function>
4865N/A
4865N/A <function name="basic_modify">
4865N/A <!--- Test Case information
4865N/A #@TestMarker fractional-replication basic
4865N/A #@TestName basic modify operation
4865N/A #@TestID basic modify operation
4865N/A #@TestPurpose check modify operation
4865N/A #@TestPreamble
4865N/A #@TestSteps ...
4865N/A #@TestPostamble
4865N/A #@TestResult Success modify on both master and replica is
4865N/A correctly filtered
4865N/A -->
4865N/A <testcase name="getTestCaseName('basic modify operation')">
4865N/A <try>
4865N/A <sequence>
4865N/A <call function="'testCase_Preamble'"/>
5540N/A
5540N/A <script>
5540N/A thisDataDir1="%s/fractional-replication" \
5540N/A % Pservers[0].getDataDir()
5540N/A </script>
5540N/A
4865N/A <call function="'ldapModifyWithScript'">
4865N/A { 'location' : Pservers[0].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[0].getHostname(),
4865N/A 'dsInstancePort' : Pservers[0].getPort(),
4865N/A 'dsInstanceDn' : Pservers[0].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[0].getRootPwd(),
5540N/A 'dsFilename' : '%s/basic-masterModify.ldif' \
5540N/A % thisDataDir1
5540N/A }
4865N/A </call>
4865N/A <call function="'SearchObject'">
4865N/A { 'location' : Pservers[0].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[0].getHostname(),
4865N/A 'dsInstancePort' : Pservers[0].getPort(),
4865N/A 'dsInstanceDn' : Pservers[0].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[0].getRootPwd(),
4865N/A 'dsBaseDN' : 'uid=user.0,ou=People,o=example',
4865N/A 'dsFilter' : 'objectclass=*',
4865N/A 'attributes' : 'postalCode',
4865N/A 'extraParams' : '-s base' }
4865N/A </call>
4865N/A
4865N/A <call function="'ldapsearchVerifyFrac'">
4865N/A { 'servers' : Pservers,
4865N/A 'keptAttributes' : keptAttributes
4865N/A }
4865N/A </call>
4865N/A <if expr="RC == 0">
4865N/A <call function="'testPassed'"/>
4865N/A <else>
4865N/A <call function="'testFailed'"/>
4865N/A </else>
4865N/A </if>
4865N/A </sequence>
4865N/A <catch exception="'STAXException.*'" typevar="eType" var="eInfo">
4865N/A <message log="1" level="'fatal'">
4865N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
4865N/A </message>
4865N/A </catch>
4865N/A <finally>
4865N/A <call function="'testCase_Postamble'"/>
4865N/A </finally>
4865N/A </try>
4865N/A </testcase>
4865N/A </function>
4865N/A
4865N/A
4865N/A <function name="basic_modifyDN">
4865N/A <!--- Test Case information
4865N/A #@TestMarker fractional-replication basic
4865N/A #@TestName basic modifyDN operation
4865N/A #@TestID basic modifyDN operation
4865N/A #@TestPurpose check modifyDN operation
4865N/A #@TestPreamble
4865N/A #@TestSteps ...
4865N/A #@TestPostamble
4865N/A #@TestResult Success modifyDN on both master and replica is
4865N/A correctly filtered
4865N/A -->
4865N/A <testcase name="getTestCaseName('basic modifyDN operation')">
4865N/A <try>
4865N/A <sequence>
4865N/A <call function="'testCase_Preamble'"/>
5540N/A
5540N/A <script>
5540N/A thisDataDir1 = "%s/fractional-replication" \
5540N/A % Pservers[0].getDataDir()
5540N/A </script>
5540N/A
4865N/A <call function="'addEntry'">
4865N/A { 'location' : Pservers[0].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[0].getHostname(),
4865N/A 'dsInstancePort' : Pservers[0].getPort(),
4865N/A 'dsInstanceDn' : Pservers[0].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[0].getRootPwd(),
5540N/A 'entryToBeAdded' : '%s/basic-masterModifyDN.ldif' \
5540N/A % thisDataDir1
4865N/A }
4865N/A </call>
4865N/A <call function="'SearchObject'">
4865N/A { 'location' : Pservers[0].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[0].getHostname(),
4865N/A 'dsInstancePort' : Pservers[0].getPort(),
4865N/A 'dsInstanceDn' : Pservers[0].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[0].getRootPwd(),
4865N/A 'dsBaseDN' : 'uid=user.0,ou=A,ou=masterModifyDN,o=example',
4865N/A 'dsFilter' : 'objectclass=*',
4865N/A 'extraParams' : '-s base' }
4865N/A </call>
4865N/A <call function="'ldapsearchVerifyFrac'">
4865N/A { 'servers' : Pservers,
4865N/A 'keptAttributes' : keptAttributes
4865N/A }
4865N/A </call>
4865N/A <!-- modify the RDN and delete old one -->
4865N/A <call function="'modifyDn'">
4865N/A { 'location' : Pservers[0].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[0].getHostname(),
4865N/A 'dsInstancePort' : Pservers[0].getPort(),
4865N/A 'dsInstanceDn' : Pservers[0].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[0].getRootPwd(),
4865N/A 'DNToModify' : 'uid=user.0,ou=A,ou=masterModifyDN,o=example',
4865N/A 'newRDN' : 'uid=newUser.0',
4865N/A 'deleteOldRDN' : True,
4865N/A }
4865N/A </call>
4865N/A <call function="'ldapsearchVerifyFrac'">
4865N/A { 'servers' : Pservers,
4865N/A 'keptAttributes' : keptAttributes
4865N/A }
4865N/A </call>
4865N/A <!-- modify the RDN and keep old one -->
4865N/A <call function="'modifyDn'">
4865N/A { 'location' : Pservers[0].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[0].getHostname(),
4865N/A 'dsInstancePort' : Pservers[0].getPort(),
4865N/A 'dsInstanceDn' : Pservers[0].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[0].getRootPwd(),
4865N/A 'DNToModify' : 'uid=user.1,ou=A,ou=masterModifyDN,o=example',
4865N/A 'newRDN' : 'uid=newUser.1',
4865N/A 'deleteOldRDN' : False,
4865N/A }
4865N/A </call>
4865N/A <call function="'ldapsearchVerifyFrac'">
4865N/A { 'servers' : Pservers,
4865N/A 'keptAttributes' : keptAttributes
4865N/A }
4865N/A </call>
4865N/A <!-- change superior -->
4865N/A <call function="'modifyDn'">
4865N/A { 'location' : Pservers[0].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[0].getHostname(),
4865N/A 'dsInstancePort' : Pservers[0].getPort(),
4865N/A 'dsInstanceDn' : Pservers[0].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[0].getRootPwd(),
4865N/A 'DNToModify' : 'uid=user.2,ou=A,ou=masterModifyDN,o=example',
4865N/A 'newRDN' : 'uid=newUser.2',
4865N/A 'deleteOldRDN' : False,
4865N/A 'newSuperior' : 'ou=B,ou=masterModifyDN,o=example',
4865N/A }
4865N/A </call>
4865N/A <call function="'ldapsearchVerifyFrac'">
4865N/A { 'servers' : Pservers,
4865N/A 'keptAttributes' : keptAttributes
4865N/A }
4865N/A </call>
4865N/A <call function="'SearchObject'">
4865N/A { 'location' : Pservers[0].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[0].getHostname(),
4865N/A 'dsInstancePort' : Pservers[0].getPort(),
4865N/A 'dsInstanceDn' : Pservers[0].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[0].getRootPwd(),
4865N/A 'dsBaseDN' : 'ou=masterModifyDN,o=example',
4865N/A 'dsFilter' : 'objectclass=*',
4865N/A 'extraParams' : '-s sub' }
4865N/A </call>
4865N/A <message level="'debug'">
4865N/A STAXResult
4865N/A </message>
4865N/A <if expr="RC == 0">
4865N/A <call function="'testPassed'"/>
4865N/A <else>
4865N/A <call function="'testFailed'"/>
4865N/A </else>
4865N/A </if>
4865N/A </sequence>
4865N/A <catch exception="'STAXException.*'" typevar="eType" var="eInfo">
4865N/A <message log="1" level="'fatal'">
4865N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
4865N/A </message>
4865N/A </catch>
4865N/A <finally>
4865N/A <sequence>
4865N/A <call function="'DeleteEntry'">
4865N/A { 'location' : Pservers[1].getHostname(),
4865N/A 'dsPath' : '%s/%s' % (Pservers[1].getDir(),OPENDSNAME),
4865N/A 'dsInstanceHost' : Pservers[1].getHostname(),
4865N/A 'dsInstancePort' : Pservers[1].getPort(),
4865N/A 'dsInstanceDn' : Pservers[1].getRootDn(),
4865N/A 'dsInstancePswd' : Pservers[1].getRootPwd(),
4865N/A 'dsBaseDN' : 'ou=masterModifyDN,o=example',
4865N/A 'extraParams' : '-x'
4865N/A }
4865N/A </call>
4865N/A <call function="'testCase_Postamble'"/>
4865N/A </sequence>
4865N/A </finally>
4865N/A </try>
4865N/A </testcase>
4865N/A </function>
4865N/A
4865N/A</stax>