4865N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
6104N/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 !
6982N/A ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
6982N/A ! or http://forgerock.org/license/CDDLv1.0.html.
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
6982N/A ! file and include the License file at legal-notices/CDDLv1_0.txt.
6982N/A ! If applicable, add the following below this CDDL HEADER, with the
6982N/A ! fields enclosed by brackets "[]" replaced with your own identifying
6982N/A ! information:
4865N/A ! Portions Copyright [yyyy] [name of copyright owner]
4865N/A !
4865N/A ! CDDL HEADER END
4865N/A !
4865N/A ! Copyright 2009 Sun Microsystems, Inc.
7087N/A ! Portions Copyright 2012-2014 ForgeRock AS
4865N/A ! -->
4865N/A<stax>
4865N/A <defaultcall function="fractional-replication_config"/>
4865N/A
4865N/A <function name="fractional-replication_config">
4865N/A <sequence>
4865N/A <block name="'config'">
4974N/A <try>
4974N/A <sequence>
4974N/A <!--- Test Suite information
4974N/A #@TestSuiteName fractional-replication config
4974N/A #@TestSuitePurpose Verify various configuration fractional replication
4974N/A #@TestSuiteID config tests
4974N/A #@TestSuiteGroup config
4974N/A #@TestMarker fractional-replication config
4974N/A #@TestGroup fractional-replication
4974N/A #@TestScript config.xml
4974N/A #@TestHTMLLink http://opends.dev.java.net/
4974N/A -->
4974N/A <script>
4974N/A if not CurrentTestPath.has_key('group'):
4974N/A CurrentTestPath['group']='fractional-replication'
7087N/A CurrentTestPath['suite']='config'
4974N/A </script>
4865N/A
4974N/A <call function="'testSuite_Preamble'"/>
4865N/A
4974N/A <try>
4974N/A <sequence>
4974N/A <!-- fractional-replication setup -->
4974N/A <import machine="STAF_LOCAL_HOSTNAME"
4974N/A file="'%s/testcases/fractional-replication/fractional-replication_setup.xml'
4974N/A % (TESTS_DIR)"/>
7087N/A <call function="'fractional-replication_setup'">
7087N/A { 'label' : "Config" }
7087N/A </call>
4974N/A
4974N/A <script>
4974N/A server = _topologyServerList[0]
4974N/A ldapServer = '%s:%s' % (server.getHostname(),
4974N/A server.getPort())
4974N/A fractionalTypes = ['fractional-include','fractional-exclude']
4974N/A </script>
4974N/A <message level="'debug'">'ldapServer=%s' % ldapServer</message>
4865N/A
4974N/A <!-- Retrieve replication-domain name -->
4974N/A <call function="'dsconfig'">
4974N/A { 'location' : server.getHostname(),
4974N/A 'dsPath' : '%s/%s' \
4974N/A % (server.getDir(),OPENDSNAME),
4974N/A 'dsInstanceHost' : server.getHostname(),
4974N/A 'dsInstanceAdminPort' : server.getAdminPort(),
4974N/A 'dsInstanceDn' : server.getRootDn(),
4974N/A 'dsInstancePswd' : server.getRootPwd(),
4974N/A 'subcommand' : 'list-replication-domains',
4974N/A 'objectType' : 'provider-name',
4974N/A 'objectName' : 'Multimaster Synchronization',
4974N/A }
4974N/A </call>
4974N/A <if expr='RC == 0'>
4974N/A <sequence>
4974N/A <script>
4974N/A replicationDomains = STAXResult[0][1]
4974N/A for line in replicationDomains.splitlines():
4974N/A if line.startswith(synchroSuffix):
4974N/A colSplit = line.split(':')
4974N/A domain = colSplit[0].strip()
4974N/A serverId = colSplit[2]
4974N/A domainMap[ldapServer] = (domain,serverId)
4974N/A break
4974N/A </script>
4974N/A <message level="'debug'">'domainMap=%s' % domainMap</message>
4974N/A </sequence>
4974N/A </if>
4974N/A <script>
4974N/A testsList=[]
4974N/A testsList.append('mutual_exclusiv')
4974N/A testsList.append('only_optional')
4974N/A testsList.append('alias_attributes')
4974N/A testsList.append('mixing_add_set_reset_remove')
4974N/A testsList.append('mixing_literal_OID')
4974N/A testsList.append('exclude_scalability')
4974N/A </script>
4865N/A
4974N/A <!-- Execute the Tests -->
4974N/A <iterate var="__test" in="testsList">
4974N/A <sequence>
4974N/A <call function="'%s' % (__test)" />
4974N/A </sequence>
4974N/A </iterate>
4974N/A </sequence>
4865N/A
4974N/A <finally>
4974N/A <message>'Test Cases Completed.'</message>
4974N/A </finally>
4974N/A </try>
4974N/A </sequence>
4974N/A <finally>
4865N/A <sequence>
4974N/A <!-- Test Suite Cleanup -->
5821N/A <message>'Finally: Global Cleanup.'</message>
4974N/A <try>
4974N/A <sequence>
4974N/A <!-- fractional-replication cleanup -->
4974N/A <import machine="STAF_LOCAL_HOSTNAME"
4974N/A file="'%s/testcases/fractional-replication/fractional-replication_cleanup.xml'
4974N/A % (TESTS_DIR)"/>
7087N/A <call function="'fractional-replication_cleanup'">
7087N/A { 'label' : "Config" }
7087N/A </call>
4974N/A </sequence>
4974N/A <catch exception="'STAFException'">
4974N/A <sequence>
4974N/A <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
4974N/A </sequence>
4974N/A </catch>
4974N/A <finally>
4974N/A <call function="'testSuite_Postamble'"/>
4974N/A </finally>
4974N/A </try>
4865N/A </sequence>
4974N/A </finally>
4974N/A </try>
4974N/A </block>
4974N/A </sequence>
4974N/A </function>
4865N/A
4974N/A <function name="mutual_exclusiv">
4974N/A <!--- Test Case information
4974N/A #@TestMarker fractional-replication config
4974N/A #@TestName Mutual Exclusiv
4974N/A #@TestID Mutual Exclusiv
4974N/A #@TestPurpose Check that fractional-include is mutual exclusiv
4974N/A against fractional-exclude.
4974N/A #@TestPreamble
4974N/A #@TestSteps test setting include and exclude to empty
4974N/A #@TestSteps test setting together include and exclude
4974N/A #@TestSteps test setting include after setting exclude
4974N/A #@TestPostamble
4974N/A #@TestResult Success if conflict is detected for both steps
4974N/A -->
4974N/A <testcase name="getTestCaseName('mutual exclusiv config')">
4974N/A <sequence>
4974N/A <call function="'testCase_Preamble'"/>
4974N/A <message>
4974N/A 'test setting include and exclude to empty'
4974N/A </message>
4974N/A <call function="'set-ops-fractional-replication-attributes'">
4974N/A {
4974N/A "server" : server,
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('set','')],
4974N/A "exclude" : [('reset',None)],
4974N/A "expectedRC" : 1
4974N/A }
4974N/A </call>
4974N/A <call function="'set-ops-fractional-replication-attributes'">
4974N/A {
4974N/A "server" : server,
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('reset',None)],
4974N/A "exclude" : [('set','')],
4974N/A "expectedRC" : 1
4974N/A }
4974N/A </call>
4974N/A
4974N/A <message>
4974N/A 'test setting together include and exclude'
4974N/A </message>
4974N/A <call function="'reset-fractional-replication-attributes'">
4974N/A {
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "server" : server,
4974N/A }
4974N/A </call>
4974N/A <call function="'set-ops-fractional-replication-attributes'">
4974N/A {
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "server" : server,
4974N/A "include" : [('set','inetOrgPerson:description,audio')],
4974N/A "exclude" : [('set','*:mail')],
4974N/A "expectedRC" : 1
4974N/A }
4974N/A </call>
4974N/A <call function="'get-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A "server" : server,
4974N/A }
4974N/A </call>
4865N/A
4974N/A <message>
4974N/A 'test setting include after setting exclude'
4974N/A </message>
4974N/A <call function="'set-ops-fractional-replication-attributes'">
4974N/A {
4974N/A "server" : server,
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('reset',None)],
4974N/A "exclude" : [('set','*:mail')],
4974N/A "expectedRC" : 0
4974N/A }
4974N/A </call>
4974N/A <call function="'get-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4974N/A <call function="'set-ops-fractional-replication-attributes'">
4974N/A {
4974N/A "server" : server,
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('set','inetOrgPerson:description,audio')],
4974N/A "expectedRC" : 1
4974N/A }
4974N/A </call>
4974N/A <call function="'get-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4974N/A <call function="'testCase_Postamble'"/>
4974N/A </sequence>
4974N/A </testcase>
4974N/A </function>
4865N/A
4974N/A <function name="only_optional">
4974N/A <!--- Test Case information
4974N/A #@TestMarker fractional-replication config
4974N/A #@TestName only optional attributes
4974N/A #@TestID only optional attributes
4974N/A #@TestPurpose Check that we can only refer to optionals
4974N/A attributes
4974N/A #@TestPreamble
4974N/A #@TestSteps reject fractional-exclude: inetOrgPerson:sn
4974N/A #@TestSteps reject fractional-include: inetOrgPerson:surnAme
4974N/A #@TestSteps test we get error when making opt attribute mandatory
4974N/A #@TestPostamble
4974N/A #@TestResult Success if conflict is detected for both steps
4974N/A -->
4974N/A <testcase name="getTestCaseName('only optional attributes allowed')">
4974N/A <sequence>
4974N/A <call function="'testCase_Preamble'"/>
4974N/A <call function="'get-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4974N/A <message>
4974N/A 'reject fractional-exclude: inetOrgPerson:sn'
4974N/A </message>
4974N/A <call function="'set-ops-fractional-replication-attributes'">
4974N/A {
4974N/A "server" : server,
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('reset',None)],
4974N/A "exclude" : [('set','inetOrgPerson:sn')],
4974N/A "expectedRC" : 1
4974N/A }
4974N/A </call>
4974N/A <call function="'get-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4865N/A
4974N/A <message>
4974N/A 'reject fractional-exclude: inetOrgPerson:surnAme'
4974N/A </message>
4974N/A <call function="'set-ops-fractional-replication-attributes'">
4974N/A {
4974N/A "server" : server,
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('reset',None)],
4974N/A "exclude" : [('set','inetOrgPerson:surnAme')],
4974N/A "expectedRC" : 1
4974N/A }
4974N/A </call>
4974N/A <call function="'testCase_Postamble'"/>
4974N/A </sequence>
4974N/A </testcase>
4865N/A </function>
4865N/A
4974N/A <function name="alias_attributes">
4974N/A <!--- Test Case information
4974N/A #@TestMarker fractional-replication config
4974N/A #@TestName alias attributes
4974N/A #@TestID alias attributes
4974N/A #@TestPurpose Check that alias opt/mandatory attributes
4974N/A are treated equaly to non alias counterpart
4974N/A #@TestPreamble
4974N/A #@TestSteps fractional-exclude rejects inetOrgPerson:surname (aka 'sn')
4974N/A #@TestSteps fractional-exclude accepts inetOrgPerson:homeTelephoneNumber (aka 'homePhone')
4974N/A #@TestSteps test we get error when making opt attribute mandatory
4974N/A #@TestPostamble
4974N/A #@TestResult Success if conflict is detected for both steps
4974N/A -->
4974N/A <testcase name="getTestCaseName('alias attributes')">
4974N/A <sequence>
4974N/A <call function="'testCase_Preamble'"/>
4974N/A <call function="'reset-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4974N/A <message>
4974N/A 'fractional-exclude rejects *:surname (aka "sn")'
4974N/A </message>
4974N/A <call function="'set-ops-fractional-replication-attributes'">
4974N/A {
4974N/A "server" : server,
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('reset',None)],
4974N/A "exclude" : [('set','inetOrgPerson:surname')],
4974N/A "expectedRC" : 1
4974N/A }
4974N/A </call>
4974N/A <call function="'get-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4974N/A <!-- TODO verify we can add a entries for which schema make
4974N/A surname : optional -> surname attribute is removed from entry
4974N/A surname : mandatory -> surname attribute is left in entry
4974N/A -->
4974N/A <message>
4974N/A 'fractional-exclude accepts inetOrgPerson:homeTelephoneNumber (aka "homePhone")'
4974N/A </message>
4974N/A <call function="'set-ops-fractional-replication-attributes'">
4974N/A {
4974N/A "server" : server,
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('add','inetOrgPerson:homeTelephoneNumber,mail')],
4974N/A "exclude" : [('reset',None)],
4974N/A "expectedRC" : 0
4974N/A }
4974N/A </call>
4974N/A <call function="'get-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4974N/A <!-- TODO verify we can add a entry without homeTelephoneNumber
4974N/A and reject entry with homeTelephoneNumber
4974N/A -->
4974N/A <call function="'testCase_Postamble'"/>
4974N/A </sequence>
4974N/A </testcase>
4974N/A </function>
4974N/A
4974N/A <function name="mixing_add_set_reset_remove">
4974N/A <!--- Test Case information
4974N/A #@TestMarker fractional-replication config
4974N/A #@TestName mixing add/set/reset/remove
4974N/A #@TestID mixing add/set/reset/remove
4974N/A #@TestPurpose Check that we can mix set/reset/add/remove
4974N/A #@TestPreamble
4974N/A #@TestSteps test removing exclude and adding include
4974N/A #@TestSteps test partially removing include + adding exclude and include
4974N/A #@TestPostamble
4974N/A #@TestResult Success if conflict is detected for both steps
4974N/A -->
4974N/A <testcase name="getTestCaseName('mixing add/set/reset/remove')">
4974N/A <sequence>
4974N/A <call function="'testCase_Preamble'"/>
4974N/A <call function="'reset-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4974N/A <message>
4974N/A 'test removing include and adding include'
4974N/A </message>
4974N/A <call function="'set-ops-fractional-replication-attributes'">
4974N/A {
4974N/A "server" : server,
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('add','inetOrgPerson:description,audio')],
4974N/A "exclude" : [('remove','inetOrgPerson:mail')],
4974N/A "expectedRC" : 1
4974N/A }
4974N/A </call>
4974N/A <call function="'get-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4974N/A <call function="'set-ops-fractional-replication-attributes'">
4974N/A {
4974N/A "server" : server,
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('add','inetOrgPerson:description,audio')],
4974N/A "expectedRC" : 0
4974N/A }
4974N/A </call>
4974N/A <call function="'get-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4974N/A <message>
4974N/A 'test partially removing include + adding exclude and include'
4974N/A </message>
4974N/A <call function="'set-ops-fractional-replication-attributes'">
4974N/A {
4974N/A "server" : server,
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('remove','inetOrgPerson:audio'),
4974N/A ('add','netOrgPerson:jpegPhoto,initials')
4974N/A ],
4974N/A "exclude" : [('add','*:mail')],
4974N/A "expectedRC" : 1
4974N/A }
4974N/A </call>
4974N/A <call function="'get-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4974N/A <call function="'set-ops-fractional-replication-attributes'">
4974N/A {
4974N/A "server" : server,
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('add','inetOrgPerson:jpegPhoto,employeeNumber'),
4974N/A ('remove','inetOrgPerson:jpegPhoto')
4974N/A ],
4974N/A "expectedRC" : 1
4974N/A }
4974N/A </call>
4974N/A <call function="'get-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4974N/A <!-- TODO verify that the inetOrgPerson:audio was removed -->
4974N/A <call function="'testCase_Postamble'"/>
4974N/A </sequence>
4974N/A </testcase>
4974N/A </function>
4974N/A
4974N/A <function name="mixing_literal_OID">
4974N/A <!--- Test Case information
4974N/A #@TestMarker fractional-replication config
4974N/A #@TestName mixing literal/OID
4974N/A #@TestID mixing literal/OID
4974N/A #@TestPurpose Check that we can mix literal/OID
4974N/A #@TestPreamble
4974N/A #@TestSteps reset fractional-replication settings
4974N/A #@TestSteps try to exclude mandatory literal attribute
4974N/A #@TestSteps try to exclude mandatory OID attribute
4974N/A #@TestSteps try to include mandatory literal attribute
4974N/A #@TestSteps try to include mandatory OID attribute
4974N/A #@TestSteps reset fractional-replication settings
4974N/A #@TestSteps test setting OID for class
4974N/A #@TestSteps test setting OID for attribute
4974N/A #@TestSteps test setting OID for class and attribute
4974N/A #@TestSteps test setting mix OID and literal for class and
4974N/A attribute
4974N/A #@TestPostamble
4974N/A #@TestResult Success if mixing in all context
4974N/A -->
4974N/A <testcase name="getTestCaseName('mixing literal/OIDs')">
4974N/A <sequence>
4974N/A <call function="'testCase_Preamble'"/>
4974N/A <message>
4974N/A 'reset fractional-replication settings'
4974N/A </message>
4974N/A <call function="'reset-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4974N/A <message level="'user1'">
4974N/A 'try to exclude mandatory literal attribute'
4974N/A </message>
4974N/A <message level="'user1'">
4974N/A 'try to exclude mandatory OID attribute'
4974N/A </message>
4974N/A <message level="'user1'">
4974N/A 'try to include mandatory literal attribute'
4974N/A </message>
4974N/A <message level="'user1'">
4974N/A 'try to include mandatory OID attribute'
4974N/A </message>
4974N/A <message>
4974N/A 'reset fractional-replication settings'
4974N/A </message>
4974N/A <call function="'reset-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4974N/A <message level="'user1'">
4974N/A 'test setting OID for class'
4974N/A </message>
4974N/A <call function="'set-ops-fractional-replication-attributes'">
4974N/A {
4974N/A "server" : server,
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('reset',None)],
4974N/A "exclude" : [('add','2.16.840.1.113730.3.2.2:jpegPhoto')],
4974N/A "expectedRC" : 0
4974N/A }
4974N/A </call>
4974N/A <call function="'get-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4974N/A
4974N/A <message level="'user1'">
4974N/A 'test setting OID for attribute'
4974N/A </message>
4974N/A <message level="'user1'">
4974N/A 'test setting OID for class and attribute'
4974N/A </message>
4974N/A <call function="'set-ops-fractional-replication-attributes'">
4974N/A {
4974N/A "server" : server,
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('reset',None)],
4974N/A "exclude" : [('add','*:0.9.2342.19200300.100.1.60'),
4974N/A ('add','inetOrgPerson:0.9.2342.19200300.100.1.60'),
4974N/A ('add','2.16.840.1.113730.3.2.2:0.9.2342.19200300.100.1.60')
4974N/A ],
4974N/A "expectedRC" : 0
4974N/A }
4974N/A </call>
4974N/A <call function="'get-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4974N/A
4974N/A <message level="'user1'">
4974N/A 'test setting mix OID and literal for class and attribute'
4974N/A </message>
4974N/A <call function="'set-ops-fractional-replication-attributes'">
4974N/A {
4974N/A "server" : server,
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('reset',None)],
4974N/A "exclude" : [('add','*:mail,jpegPhoto,0.9.2342.19200300.100.1.60'),
4974N/A ('add','inetOrgPerson:jpegPhoto,0.9.2342.19200300.100.1.60'),
4974N/A ('add','2.16.840.1.113730.3.2.2:jpegPhoto,0.9.2342.19200300.100.1.60')
4974N/A ],
4974N/A "expectedRC" : 0
4974N/A }
4974N/A </call>
4974N/A <call function="'get-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4974N/A
4974N/A <call function="'set-ops-fractional-replication-attributes'">
4974N/A {
4974N/A "server" : server,
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('reset',None)],
5762N/A "exclude" : [('remove','*:mail,jpegPhoto,0.9.2342.19200300.100.1.60'),
5762N/A ('remove','2.16.840.1.113730.3.2.2:jpegPhoto,0.9.2342.19200300.100.1.60'),
5762N/A ('remove','inetOrgPerson:jpegPhoto,0.9.2342.19200300.100.1.60')
4974N/A ],
5762N/A "expectedRC" : 0
4974N/A }
4974N/A </call>
4974N/A <call function="'get-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
4974N/A <!--
4974N/A # TODO - verify
4974N/A # should be removed
4974N/A # *:jpegPhoto
4974N/A # *:0.9.2342.19200300.100.1.60
4974N/A # InetOrgPerso:jpegPhoto
4974N/A # InetOrgPerson:0.9.2342.19200300.100.1.60
4974N/A # 2.16.840.1.113730.3.2.2:jpegPhoto,0.9.2342.19200300.100.1.60
4974N/A -->
4974N/A <call function="'testCase_Postamble'"/>
4974N/A </sequence>
4974N/A </testcase>
4974N/A </function>
4974N/A
4974N/A <function name="exclude_scalability">
4974N/A <!--- Test Case information
4974N/A #@TestMarker fractional-replication config
4974N/A #@TestName exclude scalability
4974N/A #@TestID exclude scalability
4974N/A #@TestPurpose Check that we can exclude all optional attribute
4974N/A #@TestPreamble
4974N/A #@TestSteps reset fractional-replication settings
4974N/A #@TestSteps exclude all optional attributes
4974N/A #@TestSteps test setting mix OID and literal for class and
4974N/A attribute
4974N/A #@TestPostamble
4974N/A #@TestResult Success if mixing in all context
4974N/A -->
4974N/A <testcase name="getTestCaseName('exclude scalability')">
4974N/A <sequence>
4974N/A <call function="'testCase_Preamble'"/>
4974N/A <call function="'reset-fractional-replication-attributes'">
4974N/A {
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'server' : server,
4974N/A }
4974N/A </call>
6104N/A
4974N/A <script>
4974N/A # generating fractional-exclude option for all optional regardless of objectClass
6104N/A excludeAllOptional = schemaMap[ldapServer].allmay
4974N/A </script>
6104N/A <message>'%s' % len(excludeAllOptional)</message>
6104N/A
6104N/A <!-- On Windows, we will add attribtues split the list to avoid command line too long -->
6104N/A <if expr="is_windows_platform(server.getHostname())">
6104N/A <sequence>
6104N/A <call function="'set-ops-fractional-replication-attributes'">
6104N/A {
6104N/A "server" : server,
6104N/A "replicationDomain" : domainMap[ldapServer][0],
6104N/A "include" : [('reset',None)],
6104N/A "exclude" : [('set','*:' + excludeAllOptional[0])],
6104N/A "expectedRC" : 0
6104N/A }
6104N/A </call>
6104N/A
6104N/A <script>
6104N/A lenSubList = 10
6104N/A </script>
6104N/A <iterate var="attrs" in="[excludeAllOptional[x:x+lenSubList] for x in xrange(1, len(excludeAllOptional), lenSubList)]">
6104N/A <call function="'set-ops-fractional-replication-attributes'">
6104N/A {
6104N/A "server" : server,
6104N/A "replicationDomain" : domainMap[ldapServer][0],
6104N/A "include" : [('reset',None)],
6104N/A "exclude" : [('add','*:' + attr) for attr in attrs],
6104N/A "expectedRC" : 0
6104N/A }
6104N/A </call>
6104N/A </iterate>
6104N/A </sequence>
6104N/A <else>
6104N/A <call function="'set-ops-fractional-replication-attributes'">
6104N/A {
6104N/A "server" : server,
6104N/A "replicationDomain" : domainMap[ldapServer][0],
6104N/A "include" : [('reset',None)],
6104N/A "exclude" : [('set','*:'+','.join(excludeAllOptional))],
6104N/A "expectedRC" : 0
6104N/A }
6104N/A </call>
6104N/A </else>
6104N/A </if>
6104N/A
4974N/A <call function="'get-fractional-replication-attributes'">
4974N/A {
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "server" : server,
4974N/A }
4974N/A </call>
6104N/A
4974N/A <script>
4974N/A # generating fractional-exclude option for all optional regardless of objectClass
4974N/A from java.util import Random
4974N/A from java.lang import System
4974N/A rnd = Random(System.nanoTime())
4974N/A objClassesMay = []
4974N/A for objClass, mayAttrs in schemaMap[ldapServer].may.items():
4974N/A objClassesMay.append(objClass + ':' + ','.join(mayAttrs))
4974N/A mixMayAttrs = []
4974N/A for ma in mayAttrs:
4974N/A if rnd.nextBoolean() and ma in schemaMap[ldapServer].attrDict.keys():
4974N/A # replacing literal with OID value of the attribute
4974N/A mixMayAttrs.append(schemaMap[ldapServer].attrDict[ma])
4974N/A else:
4974N/A mixMayAttrs.append(ma)
4974N/A if rnd.nextBoolean():
4974N/A objClassesMay.append(schemaMap[ldapServer].objDict[objClass] + ':' + ','.join(mixMayAttrs))
4974N/A else:
4974N/A objClassesMay.append(objClass + ':' + ','.join(mixMayAttrs))
4974N/A </script>
6104N/A <message>'%s' % len(objClassesMay)</message>
6104N/A
6104N/A <!-- On Windows, we will add attribtues split the list to avoid command line too long -->
6104N/A <if expr="is_windows_platform(server.getHostname())">
6104N/A <sequence>
6104N/A <script>
6104N/A lenSubList = 10
6104N/A </script>
6104N/A <iterate var="ocs" in="[objClassesMay[x:x+lenSubList] for x in xrange(0, len(objClassesMay), lenSubList)]">
6104N/A <call function="'set-ops-fractional-replication-attributes'">
6104N/A {
6104N/A "server" : server,
6104N/A "replicationDomain" : domainMap[ldapServer][0],
6104N/A "include" : [('reset',None)],
6104N/A "exclude" : [('add',oc) for oc in ocs],
6104N/A "expectedRC" : 0
6104N/A }
6104N/A </call>
6104N/A </iterate>
6104N/A </sequence>
6104N/A <else>
6104N/A <call function="'set-ops-fractional-replication-attributes'">
6104N/A {
6104N/A "server" : server,
6104N/A "replicationDomain" : domainMap[ldapServer][0],
6104N/A "include" : [('reset',None)],
6104N/A "exclude" : [('add','%s' % oc) for oc in objClassesMay],
6104N/A "expectedRC" : 0
6104N/A }
6104N/A </call>
6104N/A </else>
6104N/A </if>
6104N/A
4974N/A <call function="'get-fractional-replication-attributes'">
4974N/A {
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "server" : server,
4974N/A }
4974N/A </call>
4974N/A <call function="'testCase_Postamble'"/>
4974N/A </sequence>
4974N/A </testcase>
4974N/A </function>
4865N/A</stax>