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