<?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 2009-2010 Sun Microsystems, Inc.
! Portions Copyright 2011 ForgeRock AS.
! -->
<stax>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: LDIF Default
#@TestID LDIF Default
#@TestPurpose Verify an import of a LDIF file using the default backend.
#@TestPreamble
#@TestSteps /import-ldif.sh -l /ldif/Example.ldif -n "userRoot"
#@TestPostamble
#@TestResult
-->
<function name="backends_import_001" scope="local">
<testcase name="getTestCaseName('LDIF Default')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'ldifFile' : '%s/backends/Example.ldif' % remote.data,
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller, ou=People, dc=example,dc=com',
'uid=rhunt, ou=People, dc=example,dc=com'] }
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: LDIF Non Default
#@TestID LDIF Non Default
#@TestPurpose Verify an import of a LDIF file using a differrent backend to the default.
#@TestPreamble
#@TestSteps /import-ldif.sh -n "nonDefault" -l /ldif/Example.ldif
#@TestPostamble
#@TestResult
-->
<function name="backends_import_002" scope="local">
<testcase name="getTestCaseName('LDIF Non Default')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'StartDsWithScript'"/>
<!--- Check that DS started -->
<call function="'isAlive'">
{ 'noOfLoops' : 10 ,
'noOfMilliSeconds' : 2000
}
</call>
<script>
options=[]
options.append('--backend-name "nonDefault"')
options.append('--set base-dn:"dc=non-default,dc=com"')
options.append('--set enabled:true')
options.append('--set writability-mode:enabled')
options.append('-t local-db')
createBackendOptions=' '.join(options)
</script>
<call function="'dsconfig'">
{ 'subcommand' : 'create-backend',
'optionsString' : createBackendOptions
}
</call>
<call function="'StopDsWithScript'"/>
<call function="'ImportLdifWithScript'">
{ 'ldifFile' : '%s/backends/nonDefault.ldif' % remote.data,
'backEnd' : 'nonDefault'
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=non-default,dc=com',
'uid=dmiller, ou=People, dc=non-default,dc=com',
'uid=rhunt, ou=People, dc=non-default,dc=com'] }
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Fractional Include Branch
#@TestID Fractional Include Branch
#@TestPurpose Verify an import of a LDIF file specifying a branch that should be included in the import.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_003" scope="local">
<testcase name="getTestCaseName('Fractional Include Branch')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
'includeBranches' : ['dc=com'] }
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller, ou=People, dc=example,dc=com',
'uid=rhunt, ou=People, dc=example,dc=com'] }
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Fractional Include Branch with backend ID
#@TestID Fractional Include Branch
#@TestPurpose Verify an import of a LDIF file specifying a branch that should be included in the import
along with the backendID.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_004" scope="local">
<testcase name="getTestCaseName('Fractional Include Branch with backend ID')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Include.ldif' % remote.data,
'includeBranches' : ['dc=com'],
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller, ou=People, dc=example,dc=com',
'uid=rhunt, ou=People, dc=example,dc=com'] }
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Fractional Include Branches
#@TestID Fractional Include Branches
#@TestPurpose Verify an import of a LDIF file specifying multiple branches that should be included in the import.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_005" scope="local">
<testcase name="getTestCaseName('Fractional Include Branches')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Include.ldif' % remote.data,
'includeBranches' : ['dc=com','dc=example,dc=com']
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller, ou=People, dc=example,dc=com',
'uid=rhunt, ou=People, dc=example,dc=com'] }
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Fractional Exclude Branch
#@TestID Fractional Exclude Branch
#@TestPurpose Verify an import of a LDIF file specifying a branch that should be excluded in the import.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_006" scope="local">
<testcase name="getTestCaseName('Fractional Exclude Branch')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
'excludeBranches' : ['ou=Departed,ou=People,dc=example,dc=com'],
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller, ou=People, dc=example,dc=com',
'uid=rhunt, ou=People, dc=example,dc=com'] ,
'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
'uid=brammage,ou=Departed,ou=People,dc=example,dc=com']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Fractional Exclude Branches
#@TestID Fractional Exclude Branches
#@TestPurpose Verify an import of a LDIF file specifying multiple branches that should be excluded in the import.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_007" scope="local">
<testcase name="getTestCaseName('Fractional Exclude Branches')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
'excludeBranches' : ['ou=Departed,ou=People,dc=example,dc=com', 'ou=unit1, ou=People, dc=example,dc=com'],
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller, ou=People, dc=example,dc=com',
'uid=rhunt, ou=People, dc=example,dc=com'] ,
'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
'uid=brammage,ou=Departed,ou=People,dc=example,dc=com',
'uid=arammell, ou=unit1, ou=People, dc=example,dc=com']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Fractional Branches Mix
#@TestID Fractional Branches Mix
#@TestPurpose Verify an import of a LDIF file specifying a mix of include and exclude branches.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_008" scope="local">
<testcase name="getTestCaseName('Fractional Branches Mix')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
'includeBranches' : ['dc=com'],
'excludeBranches' : ['ou=Departed,ou=People,dc=example,dc=com']
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller, ou=People, dc=example,dc=com',
'uid=rhunt, ou=People, dc=example,dc=com'] ,
'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
'uid=brammage,ou=Departed,ou=People,dc=example,dc=com']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Fractional Include Attribute
#@TestID Fractional Include Attribute
#@TestPurpose Verify an import of a LDIF file specifying an attribute that should be included in the import.
#@TestPreamble
#@TestSteps /import-ldif.sh -n "userRoot" -i dc -l Include.ldif
#@TestPostamble
#@TestResult
-->
<function name="backends_import_009" scope="local">
<testcase name="getTestCaseName('Fractional Include Attribute')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Include.ldif' % remote.data,
'includeAttributes' : ['dc'],
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['dc=com','dc=example,dc=com','ou=People,dc=example,dc=com'] }
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Fractional Include Attributes
#@TestID Fractional Include Attributes
#@TestPurpose Verify an import of a LDIF file specifying multiple attributes that should be included in the import.
#@TestPreamble
#@TestSteps /import-ldif.sh -n "userRoot" -i cn -i dc -i ou -i sn -l Include.ldif
#@TestPostamble
#@TestResult
-->
<function name="backends_import_010" scope="local">
<testcase name="getTestCaseName('Fractional Include Attributes')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Include.ldif' % remote.data,
'includeAttributes' : ['dc','cn','ou','sn'],
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller, ou=People, dc=example,dc=com',
'uid=rhunt, ou=People, dc=example,dc=com']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Fractional Exclude Attribute
#@TestID Fractional Exclude Attribute
#@TestPurpose Verify an import of a LDIF file specifying an attribute that should be excluded in the import.
#@TestPreamble
#@TestSteps /import-ldif.sh -n "userRoot" -e userpassword -l Example.ldif
#@TestPostamble
#@TestResult
-->
<function name="backends_import_011" scope="local">
<testcase name="getTestCaseName('Fractional Exclude Attribute')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
'excludeAttributes' : ['userpassword'],
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com'],
'missingAttributes' : ['userpassword']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Fractional Exclude Attributes
#@TestID Fractional Exclude Attributes
#@TestPurpose Verify an import of a LDIF file specifying multiple attribute that should be excluded in the import.
#@TestPreamble
#@TestSteps /import-ldif.sh -n "userRoot" -e userpassword -e mail -e roomnumber -l Example.ldif
#@TestPostamble
#@TestResult
-->
<function name="backends_import_012" scope="local">
<testcase name="getTestCaseName('Fractional Exclude Attributes')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
'excludeAttributes' : ['userpassword','mail','roomnumber'],
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com'],
'missingAttributes' : ['userpassword']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Fractional Mix
#@TestID Fractional Mix
#@TestPurpose Verify an import of a LDIF file specifying a mix of fractional attributes and branches.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_013" scope="local">
<testcase name="getTestCaseName('Fractional Mix')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Example.ldif' % remote.data,
'includeAttributes' : ['dc','cn','ou','sn'],
'includeBranches' : ['dc=com','dc=example,dc=com','ou=People,dc=example,dc=com'],
'excludeBranches' : ['ou=Departed,ou=People,dc=example,dc=com']
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller, ou=People, dc=example,dc=com',
'uid=rhunt, ou=People, dc=example,dc=com'],
'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
'uid=brammage,ou=Departed,ou=People,dc=example,dc=com']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Filtered Include
#@TestID Filtered Include
#@TestPurpose Verify an import of a LDIF file specifying a search filter control which entries are included in the import.
#@TestPreamble
#@TestSteps /import-ldif.sh -n "userRoot" -I "objectclass=*" -l Include.ldif
#@TestPostamble
#@TestResult
-->
<function name="backends_import_014" scope="local">
<testcase name="getTestCaseName('Filtered Include')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Include.ldif' % remote.data,
'includeFilters' : ['objectclass=*'],
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller,ou=People,dc=example,dc=com',
'uid=rhunt,ou=People,dc=example,dc=com']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Filtered Exclude
#@TestID Filtered Exclude
#@TestPurpose Verify an import of a LDIF file specifying a search filter control which entries are excluded in the import.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_015" scope="local">
<testcase name="getTestCaseName('Filtered Exclude')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
'excludeFilters' : ['objectclass=person'],
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['dc=example,dc=com',
'ou=People,dc=example,dc=com'],
'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller,ou=People,dc=example,dc=com',
'uid=rhunt,ou=People,dc=example,dc=com']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Filtered Includes
#@TestID Filtered Includes
#@TestPurpose Verify an import of a LDIF file specifying multiple search filters control which entries are included in the import.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_016" scope="local">
<testcase name="getTestCaseName('Filtered Includes')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Include.ldif' % remote.data,
'includeFilters' : ['objectclass=domain','objectclass=organizationalunit'],
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['dc=example,dc=com',
'ou=People,dc=example,dc=com'],
'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller,ou=People,dc=example,dc=com',
'uid=rhunt,ou=People,dc=example,dc=com']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Filtered Excludes
#@TestID Filtered Excludes
#@TestPurpose Verify an import of a LDIF file specifying multiple search filters control which entries are excluded in the import.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_017" scope="local">
<testcase name="getTestCaseName('Filtered Excludes')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
'excludeFilters' : ['objectclass=person','objectclass=organizationalunit'],
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['dc=example,dc=com'],
'missingEntries' : ['ou=People,dc=example,dc=com']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Filtered Includes Complex
#@TestID Filtered Includes Complex
#@TestPurpose Verify an import of a LDIF file specifying complex search filters control which entries are included in the import.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_018" scope="local">
<testcase name="getTestCaseName('Filtered Includes Complex')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Include.ldif' % remote.data,
'includeFilters' : ['|(objectclass=person)(objectclass=domain)(objectclass=organizationalunit)'],
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller,ou=People,dc=example,dc=com',
'uid=rhunt,ou=People,dc=example,dc=com']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Filtered Excludes Complex
#@TestID Filtered Excludes Complex
#@TestPurpose Verify an import of a LDIF file specifying complex search filters control which entries are excluded in the import.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_019" scope="local">
<testcase name="getTestCaseName('Filtered Excludes Complex')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
'excludeFilters' : ['&amp;(objectclass=person)(ou=Departed)'],
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=rhunt,ou=People,dc=example,dc=com'],
'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Fractional Filtered Mix
#@TestID Fractional Filtered Mix
#@TestPurpose Verify an import of a LDIF file specifying a mix of fractional and filtered.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_020" scope="local">
<testcase name="getTestCaseName('Fractional Filtered Mix')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
'excludeFilters' : ['&amp;(objectclass=person)(ou=Departed)'],
'includeBranches' : ['dc=com'],
'excludeAttributes' : ['userpassword']
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=rhunt,ou=People,dc=example,dc=com'],
'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Append
#@TestID Append
#@TestPurpose Verify an import of a LDIF file specifying that the import process should append to the existing database.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_021" scope="local">
<testcase name="getTestCaseName('Append')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<!-- Import Example.ldif -->
<call function="'ImportLdifWithScript'">
{ 'ldifFile' : '%s/backends/Example.ldif' % remote.data,
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<!-- Import Example.ldif -->
<call function="'ImportLdifWithScript'">
{ 'ldifFile' : '%s/backends/Append.ldif' % remote.data,
'append' : 'TRUE',
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'dsBaseDN' : 'dc=example,dc=com',
'expectedEntries' : ['ou=Departed,ou=People,dc=example,dc=com',
'uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
'uid=brammage,ou=Departed,ou=People,dc=example,dc=com'] ,
'expectedNoEntries' : '163'
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Append Replace Existing
#@TestID Append Replace Existing
#@TestPurpose Verify an import of a LDIF file specifying that an existing entry should be replaced when appending to an existing database.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_022" scope="local">
<testcase name="getTestCaseName('Append Replace Existing')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<!-- Import Example.ldif -->
<call function="'ImportLdifWithScript'">
{ 'ldifFile' : '%s/backends/Example.ldif' % remote.data,
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<!-- Import Example.ldif -->
<call function="'ImportLdifWithScript'">
{ 'ldifFile' : '%s/backends/Append.ldif' % remote.data,
'append' : 'TRUE',
'replaceExisting' : 'TRUE',
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'dsBaseDN' : 'dc=example,dc=com',
'expectedEntries' : ['ou=Departed,ou=People,dc=example,dc=com',
'uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
'uid=brammage,ou=Departed,ou=People,dc=example,dc=com'] ,
'expectedNoEntries' : '163'
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Compressed
#@TestID Compressed
#@TestPurpose Verify an import of a LDIF file specifying the data to import is compressed.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_023" scope="local">
<testcase name="getTestCaseName('Compressed')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Example.ldif.gz' % remote.data,
'isCompressed' : 'TRUE',
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller,ou=People,dc=example,dc=com',
'uid=rhunt,ou=People,dc=example,dc=com']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Encrypted
#@TestID Encrypted
#@TestPurpose Verify an import of a LDIF file specifying the data to import is encrypted.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_024" scope="local">
<testcase name="getTestCaseName('Encrypted')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Example.ldif' % remote.data,
'isEncrypted' : 'TRUE',
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller,ou=People,dc=example,dc=com',
'uid=rhunt,ou=People,dc=example,dc=com']
}
</call>
<!-- Known issue -->
<call function="'checktestRC'">
{ 'returncode' : 1 ,
'expected' : 0 ,
'result' : 'Encrypted LDIF import is not implemented',
'issue' : 'OPENDJ-448'
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Hashed Signed
#@TestID Hashed Signed
#@TestPurpose Verify an import of a LDIF file specifying the data to import is hashed/signed.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_025" scope="local">
<testcase name="getTestCaseName('Hash Signed')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Example.ldif' % remote.data,
'isEncrypted' : 'TRUE',
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller,ou=People,dc=example,dc=com',
'uid=rhunt,ou=People,dc=example,dc=com']
}
</call>
<!-- Known issue -->
<call function="'checktestRC'">
{ 'returncode' : 1 ,
'expected' : 0 ,
'result' : 'Hash Signed LDIF import is not implemented',
'issue' : 'OPENDJ-448'
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!-- Test Not Implemented. Feature not avaliable -->
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Rejects File
#@TestID Rejects File
#@TestPurpose Verify an import of a LDIF file specifying the a path to a file into which rejected entries may be written if they are not accepted during the import process, when the rejects file is not overwritten.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_026" scope="local">
<testcase name="getTestCaseName('Rejects File')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Example.ldif' % remote.data,
'rejectFile' : '%s/backends/import_026-rejects.txt' % remote.temp,
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller,ou=People,dc=example,dc=com',
'uid=rhunt,ou=People,dc=example,dc=com']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Rejects File Overwrite
#@TestID Rejects File Overwrite
#@TestPurpose Verify an import of a LDIF file specifying the a path to a file into which rejected entries may be written if they are not accepted during the import process, when the rejects file is overwritten.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_027" scope="local">
<testcase name="getTestCaseName('Rejects File Overwrite')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Example.ldif' % remote.data,
'rejectFile' : '%s/backends/import_027-rejects.txt' % remote.temp,
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller,ou=People,dc=example,dc=com',
'uid=rhunt,ou=People,dc=example,dc=com']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Skip Schema Validation Accept
#@TestID Skip Schema Validation Accept
#@TestPurpose Verify an import of a LDIF file containing invalided schema is accepted when skip schema validation is specified
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_028" scope="local">
<testcase name="getTestCaseName('Skip Schema Validation Accept')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Schema.ldif' % remote.data,
'skipSchemaValidation' : 'TRUE',
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller,ou=People,dc=example,dc=com',
'uid=kwinters,ou=People,dc=example,dc=com']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Skip Schema Validation Reject
#@TestID skip schema validation reject
#@TestPurpose Verify an import of a LDIF file containing invalided schema is rejected when skip schema validation is not specified
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<function name="backends_import_029" scope="local">
<testcase name="getTestCaseName('Skip Schema Validation Reject')">
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Schema.ldif' % remote.data,
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=dmiller,ou=People,dc=example,dc=com'],
'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=kwinters,ou=People,dc=example,dc=com']
}
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
</function>
<!--- Test Case information
#@TestMarker Backend Import Tests
#@TestName Backend: Import: Error Codes
#@TestID Error Codes
#@TestPurpose Verify an import fails with an error code.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
<!-- Need to know what the error codes are -->
</stax>