4865N/A<?
xml version="1.0" encoding="UTF-8" standalone="no"?>
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 ! You can obtain a copy of the license at 4865N/A ! See the License for the specific language governing permissions 4865N/A ! and limitations under the License. 4865N/A ! When distributing Covered Code, include this CDDL HEADER in each 4865N/A ! file and include the License file at 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 ! Copyright 2009 Sun Microsystems, Inc. 6104N/A ! Portions Copyright 2012-2013 ForgeRock AS 4865N/A <
defaultcall function="fractional-replication_config"/>
4865N/A <
function name="fractional-replication_config">
4974N/A <!--- Test Suite information 4974N/A #@TestSuiteName fractional-replication config 4974N/A #@TestSuitePurpose Verify various configuration fractional replication 4974N/A #@TestMarker fractional-replication config 4974N/A #@TestGroup fractional-replication 4974N/A CurrentTestPath['group']='fractional-replication'
4974N/A CurrentTestPath['suite']=STAXCurrentBlock
4974N/A <
call function="'testSuite_Preamble'"/>
4974N/A <!-- fractional-replication setup --> 4974N/A <
import machine="STAF_LOCAL_HOSTNAME" 4974N/A <
call function="'fractional-replication_setup'" />
4974N/A server = _topologyServerList[0]
4974N/A fractionalTypes = ['fractional-include','fractional-exclude']
4974N/A <
message level="'debug'">'ldapServer=%s' % ldapServer</
message>
4974N/A <!-- Retrieve replication-domain name --> 4974N/A <
call function="'dsconfig'">
4974N/A 'subcommand' : 'list-replication-domains',
4974N/A 'objectType' : 'provider-name',
4974N/A 'objectName' : 'Multimaster Synchronization',
4974N/A replicationDomains = STAXResult[0][1]
4974N/A domain = colSplit[0].strip()
4974N/A domainMap[ldapServer] = (domain,serverId)
4974N/A <
message level="'debug'">'domainMap=%s' % domainMap</
message>
4974N/A <
iterate var="__test" in="testsList">
4974N/A <
call function="'%s' % (__test)" />
4974N/A <
message>'Test Cases Completed.'</
message>
4974N/A <!-- Test Suite Cleanup --> 5821N/A <
message>'Finally: Global Cleanup.'</
message>
4974N/A <!-- fractional-replication cleanup --> 4974N/A <
import machine="STAF_LOCAL_HOSTNAME" 4974N/A <
call function="'fractional-replication_cleanup'" />
4974N/A <
catch exception="'STAFException'">
4974N/A <
message log="1" level="'fatal'">'Cleanup of test suite failed.'</
message>
4974N/A <
call function="'testSuite_Postamble'"/>
4974N/A <
function name="mutual_exclusiv">
4974N/A <!--- Test Case information 4974N/A #@TestMarker fractional-replication config 4974N/A #@TestPurpose Check that fractional-include is mutual exclusiv 4974N/A against fractional-exclude. 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 #@TestResult Success if conflict is detected for both steps 4974N/A <
testcase name="getTestCaseName('mutual exclusiv config')">
4974N/A <
call function="'testCase_Preamble'"/>
4974N/A 'test setting include and exclude to empty'
4974N/A <
call function="'set-ops-fractional-replication-attributes'">
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "exclude" : [('reset',None)],
4974N/A <
call function="'set-ops-fractional-replication-attributes'">
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('reset',None)],
4974N/A 'test setting together include and exclude'
4974N/A <
call function="'reset-fractional-replication-attributes'">
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A <
call function="'set-ops-fractional-replication-attributes'">
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('set','inetOrgPerson:description,audio')],
4974N/A "exclude" : [('set','*:mail')],
4974N/A <
call function="'get-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'test setting include after setting exclude'
4974N/A <
call function="'set-ops-fractional-replication-attributes'">
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('reset',None)],
4974N/A "exclude" : [('set','*:mail')],
4974N/A <
call function="'get-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A <
call function="'set-ops-fractional-replication-attributes'">
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('set','inetOrgPerson:description,audio')],
4974N/A <
call function="'get-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A <
call function="'testCase_Postamble'"/>
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 #@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 #@TestResult Success if conflict is detected for both steps 4974N/A <
testcase name="getTestCaseName('only optional attributes allowed')">
4974N/A <
call function="'testCase_Preamble'"/>
4974N/A <
call function="'get-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'reject fractional-exclude: inetOrgPerson:sn'
4974N/A <
call function="'set-ops-fractional-replication-attributes'">
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('reset',None)],
4974N/A "exclude" : [('set','inetOrgPerson:sn')],
4974N/A <
call function="'get-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'reject fractional-exclude: inetOrgPerson:surnAme'
4974N/A <
call function="'set-ops-fractional-replication-attributes'">
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('reset',None)],
4974N/A "exclude" : [('set','inetOrgPerson:surnAme')],
4974N/A <
call function="'testCase_Postamble'"/>
4974N/A <
function name="alias_attributes">
4974N/A <!--- Test Case information 4974N/A #@TestMarker fractional-replication config 4974N/A #@TestName alias attributes 4974N/A are treated equaly to non alias counterpart 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 #@TestResult Success if conflict is detected for both steps 4974N/A <
testcase name="getTestCaseName('alias attributes')">
4974N/A <
call function="'testCase_Preamble'"/>
4974N/A <
call function="'reset-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'fractional-exclude rejects *:surname (aka "sn")'
4974N/A <
call function="'set-ops-fractional-replication-attributes'">
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('reset',None)],
4974N/A "exclude" : [('set','inetOrgPerson:surname')],
4974N/A <
call function="'get-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
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 'fractional-exclude accepts inetOrgPerson:homeTelephoneNumber (aka "homePhone")'
4974N/A <
call function="'set-ops-fractional-replication-attributes'">
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('add','inetOrgPerson:homeTelephoneNumber,mail')],
4974N/A "exclude" : [('reset',None)],
4974N/A <
call function="'get-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A <!-- TODO verify we can add a entry without homeTelephoneNumber 4974N/A and reject entry with homeTelephoneNumber 4974N/A <
call function="'testCase_Postamble'"/>
4974N/A <
function name="mixing_add_set_reset_remove">
4974N/A <!--- Test Case information 4974N/A #@TestMarker fractional-replication config 4974N/A #@TestSteps test removing exclude and adding include 4974N/A #@TestSteps test partially removing include + adding exclude and include 4974N/A #@TestResult Success if conflict is detected for both steps 4974N/A <
call function="'testCase_Preamble'"/>
4974N/A <
call function="'reset-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'test removing include and adding include'
4974N/A <
call function="'set-ops-fractional-replication-attributes'">
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('add','inetOrgPerson:description,audio')],
4974N/A "exclude" : [('remove','inetOrgPerson:mail')],
4974N/A <
call function="'get-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A <
call function="'set-ops-fractional-replication-attributes'">
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('add','inetOrgPerson:description,audio')],
4974N/A <
call function="'get-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'test partially removing include + adding exclude and include'
4974N/A <
call function="'set-ops-fractional-replication-attributes'">
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('remove','inetOrgPerson:audio'),
4974N/A ('add','netOrgPerson:jpegPhoto,initials')
4974N/A "exclude" : [('add','*:mail')],
4974N/A <
call function="'get-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A <
call function="'set-ops-fractional-replication-attributes'">
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A "include" : [('add','inetOrgPerson:jpegPhoto,employeeNumber'),
4974N/A ('remove','inetOrgPerson:jpegPhoto')
4974N/A <
call function="'get-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A <!-- TODO verify that the inetOrgPerson:audio was removed --> 4974N/A <
call function="'testCase_Postamble'"/>
4974N/A <
function name="mixing_literal_OID">
4974N/A <!--- Test Case information 4974N/A #@TestMarker fractional-replication config 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 #@TestResult Success if mixing in all context 4974N/A <
call function="'testCase_Preamble'"/>
4974N/A 'reset fractional-replication settings'
4974N/A <
call function="'reset-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'try to exclude mandatory literal attribute'
4974N/A 'try to exclude mandatory OID attribute'
4974N/A 'try to include mandatory literal attribute'
4974N/A 'try to include mandatory OID attribute'
4974N/A 'reset fractional-replication settings'
4974N/A <
call function="'reset-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'test setting OID for class'
4974N/A <
call function="'set-ops-fractional-replication-attributes'">
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 <
call function="'get-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'test setting OID for attribute'
4974N/A 'test setting OID for class and attribute'
4974N/A <
call function="'set-ops-fractional-replication-attributes'">
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 <
call function="'get-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A 'test setting mix OID and literal for class and attribute'
4974N/A <
call function="'set-ops-fractional-replication-attributes'">
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 <
call function="'get-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A <
call function="'set-ops-fractional-replication-attributes'">
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 <
call function="'get-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A # *:0.9.2342.19200300.100.1.60 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 <
call function="'testCase_Postamble'"/>
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 #@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 #@TestResult Success if mixing in all context 4974N/A <
testcase name="getTestCaseName('exclude scalability')">
4974N/A <
call function="'testCase_Preamble'"/>
4974N/A <
call function="'reset-fractional-replication-attributes'">
4974N/A 'replicationDomain' : domainMap[ldapServer][0],
4974N/A # generating fractional-exclude option for all optional regardless of objectClass
6104N/A excludeAllOptional = schemaMap[ldapServer].allmay
6104N/A <
message>'%s' % len(excludeAllOptional)</
message>
6104N/A <!-- On Windows, we will add attribtues split the list to avoid command line too long --> 6104N/A <
call function="'set-ops-fractional-replication-attributes'">
6104N/A "replicationDomain" : domainMap[ldapServer][0],
6104N/A "include" : [('reset',None)],
6104N/A "exclude" : [('set','*:' + excludeAllOptional[0])],
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 "replicationDomain" : domainMap[ldapServer][0],
6104N/A "include" : [('reset',None)],
6104N/A "exclude" : [('add','*:' + attr) for attr in attrs],
6104N/A <
call function="'set-ops-fractional-replication-attributes'">
6104N/A "replicationDomain" : domainMap[ldapServer][0],
6104N/A "include" : [('reset',None)],
6104N/A "exclude" : [('set','*:'+','.join(excludeAllOptional))],
4974N/A <
call function="'get-fractional-replication-attributes'">
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A # generating fractional-exclude option for all optional regardless of objectClass
4974N/A # replacing literal with OID value of the attribute
6104N/A <
message>'%s' % len(objClassesMay)</
message>
6104N/A <!-- On Windows, we will add attribtues split the list to avoid command line too long --> 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 "replicationDomain" : domainMap[ldapServer][0],
6104N/A "include" : [('reset',None)],
6104N/A "exclude" : [('add',oc) for oc in ocs],
6104N/A <
call function="'set-ops-fractional-replication-attributes'">
6104N/A "replicationDomain" : domainMap[ldapServer][0],
6104N/A "include" : [('reset',None)],
6104N/A "exclude" : [('add','%s' % oc) for oc in objClassesMay],
4974N/A <
call function="'get-fractional-replication-attributes'">
4974N/A "replicationDomain" : domainMap[ldapServer][0],
4974N/A <
call function="'testCase_Postamble'"/>