<?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 legal-notices/CDDLv1_0.txt
! or http://forgerock.org/license/CDDLv1.0.html.
! 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 legal-notices/CDDLv1_0.txt.
! 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 2012-2013 ForgeRock AS.
! -->
<stax>
<defaultcall function="replication_aci"/>
<function name="replication_aci" scope="local">
<sequence>
<block name="'replication_aci'">
<try>
<sequence>
<script>
if not CurrentTestPath.has_key('group'):
CurrentTestPath['group']='replication'
CurrentTestPath['suite'] = 'aci'
_groupdir='%s/testcases/replication' % TESTS_DIR
_label = 'Replication ACI'
</script>
<!--- Test Suite information
#@TestSuiteName Replication ACI Tests
#@TestSuitePurpose Verify that the ACI operations are replicated
correctly between two servers.
#@TestSuiteID ACI Tests
#@TestSuiteGroup ACI
#@TestGroup Replication
#@TestScript replication_aci.xml
#@TestHTMLLink http://www.forgerock.org/
-->
<call function="'testSuite_Preamble'"/>
<try>
<sequence>
<import machine="STAF_LOCAL_HOSTNAME"
file="'%s/testcases/replication/replication_setup.xml'
% (TESTS_DIR)"/>
<call function="'replication_setup'">
{ 'dataFile' : 'Short_Example.ldif' ,
'label' : _label }
</call>
<!-- List of Import of Test Functions -->
<script>
importList=[]
importList.append('aci/aci_tests')
</script>
<!-- Import the files for this test suite -->
<iterate var="_import" in="importList">
<import machine="STAF_LOCAL_HOSTNAME"
file="'%s/%s.xml' % (_groupdir,_import)"/>
</iterate>
<!-- Specific to replication tests -->
<script>
msg1 = 'Replication: ACI:'
class Entry:
def __init__(self, rdn, suffix):
self.userDn = '%s,ou=People,%s' \
% (rdn, suffix)
self.suffix = suffix
self.listAttr = []
self.listAttr.append('objectclass:top')
self.listAttr.append('objectclass:organizationalperson')
self.listAttr.append('objectclass:inetorgperson')
self.listAttr.append('objectclass:person')
def getDn(self):
return self.userDn
def getSuffix(self):
return self.suffix
def getAttrList(self):
return self.listAttr
def addAttr(self, attrType, attrValue):
self.listAttr.append('%s:%s' % (attrType, attrValue))
</script>
<!-- List of Test Cases -->
<script>
testsList=[]
if globalSplitServers is None:
# External changelog not supported in replication split servers mode
# This test case will only be run in normal mode
testsList.append('replication_aci_001')
if UPGRADE_OPENDJNAME == '':
# The global acis are not updated by the upgrade process
# This test case will only be run on fresh install
testsList.append('replication_aci_002')
testsList.append('replication_aci_003')
testsList.append('replication_aci_004')
testsList.append('replication_aci_005')
testsList.append('replication_aci_006')
testsList.append('replication_aci_007')
testsList.append('replication_aci_008')
testsList.append('replication_aci_009')
</script>
<!-- Execute the Tests -->
<iterate var="__test" in="testsList">
<sequence>
<call function="'%s' % (__test)" />
</sequence>
</iterate>
</sequence>
<catch exception="'STAFException.TestSuite.SetupException'">
<sequence>
<message log="1" level="'fatal'">
'Setup of test suite failed.'
</message>
<rethrow/>
</sequence>
</catch>
<finally>
<message>'Test Cases Completed.'</message>
</finally>
</try>
</sequence>
<finally>
<sequence>
<!-- Test Suite Cleanup -->
<message>'Finally: Replication Cleanup.'</message>
<try>
<sequence>
<import machine="STAF_LOCAL_HOSTNAME"
file="'%s/testcases/replication/replication_cleanup.xml'
% (TESTS_DIR)"/>
<call function="'replication_cleanup'">
{ 'label' : _label }
</call>
</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>
</stax>