import_tests.xml revision 9207ffafa7b0544d89aee337cbf709346e4bf8ef
2852N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2887N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
2852N/A<!--
2852N/A ! CDDL HEADER START
2852N/A !
2852N/A ! The contents of this file are subject to the terms of the
2852N/A ! Common Development and Distribution License, Version 1.0 only
2852N/A ! (the "License"). You may not use this file except in compliance
2852N/A ! with the License.
2852N/A !
2852N/A ! You can obtain a copy of the license at
2852N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
2852N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
2852N/A ! See the License for the specific language governing permissions
2852N/A ! and limitations under the License.
2852N/A !
2852N/A ! When distributing Covered Code, include this CDDL HEADER in each
2852N/A ! file and include the License file at
2852N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
2852N/A ! add the following below this CDDL HEADER, with the fields enclosed
2852N/A ! by brackets "[]" replaced with your own identifying information:
2852N/A ! Portions Copyright [yyyy] [name of copyright owner]
2852N/A !
2852N/A ! CDDL HEADER END
2852N/A !
5073N/A ! Copyright 2009-2010 Sun Microsystems, Inc.
6102N/A ! -->
2938N/A
2852N/A<stax>
2852N/A
2852N/A <!--- Test Case information
2852N/A #@TestMarker Backend Import Tests
4618N/A #@TestName Backend: Import: LDIF Default
4618N/A #@TestID LDIF Default
4618N/A #@TestPurpose Verify an import of a LDIF file using the default backend.
4618N/A #@TestPreamble
4618N/A #@TestSteps /import-ldif.sh -l /ldif/Example.ldif -n "userRoot"
4618N/A #@TestPostamble
4618N/A #@TestResult
4618N/A -->
4618N/A
4618N/A <function name="backends_import_001" scope="local">
4618N/A
4618N/A <testcase name="getTestCaseName('LDIF Default')">
4618N/A
4618N/A <try>
4618N/A
4618N/A <sequence>
4618N/A
3328N/A <call function="'testCase_Preamble'"/>
4618N/A
4618N/A <call function="'ImportLdifWithScript'">
4618N/A { 'ldifFile' : '%s/backends/Example.ldif' % remote.data,
4618N/A 'backEnd' : DIRECTORY_INSTANCE_BE
4618N/A }
2938N/A </call>
2938N/A
4618N/A <call function="'checkImport'">
4618N/A { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
4618N/A 'uid=dmiller, ou=People, dc=example,dc=com',
4618N/A 'uid=rhunt, ou=People, dc=example,dc=com'] }
4618N/A </call>
4618N/A
4618N/A </sequence>
4618N/A
4618N/A <catch exception="'STAXException.*'" typevar="eType" var="eInfo">
4618N/A <message log="1" level="'fatal'">
4618N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
4618N/A </message>
4618N/A </catch>
4618N/A
4618N/A <finally>
4618N/A <call function="'testCase_Postamble'"/>
4618N/A </finally>
4618N/A
4618N/A </try>
4618N/A
4618N/A </testcase>
4618N/A
4618N/A </function>
4618N/A
5073N/A <!--- Test Case information
5073N/A #@TestMarker Backend Import Tests
5184N/A #@TestName Backend: Import: LDIF Non Default
5073N/A #@TestID LDIF Non Default
4618N/A #@TestPurpose Verify an import of a LDIF file using a differrent backend to the default.
4618N/A #@TestPreamble
4618N/A #@TestSteps /import-ldif.sh -n "nonDefault" -l /ldif/Example.ldif
4618N/A #@TestPostamble
4618N/A #@TestResult
4618N/A -->
4618N/A
4618N/A <function name="backends_import_002" scope="local">
4618N/A
5184N/A <testcase name="getTestCaseName('LDIF Non Default')">
4618N/A
4618N/A <try>
4618N/A
4618N/A <sequence>
4618N/A
4618N/A <call function="'testCase_Preamble'"/>
4618N/A
4618N/A <call function="'StartDsWithScript'"/>
4618N/A
4618N/A <!--- Check that DS started -->
4618N/A <call function="'isAlive'">
4618N/A { 'noOfLoops' : 10 ,
4618N/A 'noOfMilliSeconds' : 2000
4618N/A }
4618N/A </call>
4618N/A
4618N/A <script>
4618N/A options=[]
4618N/A options.append('--backend-name "nonDefault"')
4618N/A options.append('--set base-dn:"dc=non-default,dc=com"')
4618N/A options.append('--set enabled:true')
4618N/A options.append('--set writability-mode:enabled')
4618N/A options.append('-t local-db')
4618N/A createBackendOptions=' '.join(options)
4618N/A </script>
4618N/A
4618N/A <call function="'dsconfig'">
4618N/A { 'subcommand' : 'create-backend',
4618N/A 'optionsString' : createBackendOptions
4618N/A }
4618N/A </call>
4618N/A
4618N/A <call function="'StopDsWithScript'"/>
4618N/A
4618N/A <call function="'ImportLdifWithScript'">
4618N/A { 'ldifFile' : '%s/backends/nonDefault.ldif' % remote.data,
4618N/A 'backEnd' : 'nonDefault'
4618N/A }
4618N/A </call>
4618N/A
4618N/A <call function="'checkImport'">
4618N/A { 'expectedEntries' : ['uid=scarter,ou=People,dc=non-default,dc=com',
4618N/A 'uid=dmiller, ou=People, dc=non-default,dc=com',
4618N/A 'uid=rhunt, ou=People, dc=non-default,dc=com'] }
5073N/A </call>
5073N/A
5073N/A </sequence>
4618N/A
4618N/A <catch exception="'STAXException.*'" typevar="eType" var="eInfo">
4680N/A <message log="1" level="'fatal'">
4618N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
4618N/A </message>
4618N/A </catch>
4618N/A
4618N/A <finally>
4618N/A <call function="'testCase_Postamble'"/>
4618N/A </finally>
4618N/A </try>
4618N/A </testcase>
4618N/A
4618N/A </function>
4618N/A
4618N/A <!--- Test Case information
4618N/A #@TestMarker Backend Import Tests
4618N/A #@TestName Backend: Import: Fractional Include Branch
4618N/A #@TestID Fractional Include Branch
4618N/A #@TestPurpose Verify an import of a LDIF file specifying a branch that should be included in the import.
4618N/A #@TestPreamble
4618N/A #@TestSteps
4618N/A #@TestPostamble
4618N/A #@TestResult
4618N/A -->
4618N/A <function name="backends_import_003" scope="local">
4618N/A
4618N/A <testcase name="getTestCaseName('Fractional Include Branch')">
4618N/A
4618N/A <try>
4618N/A
4618N/A <sequence>
4618N/A
4618N/A <call function="'testCase_Preamble'"/>
4618N/A
4618N/A <call function="'ImportLdifWithScript'">
4618N/A { 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
4618N/A 'includeBranches' : ['dc=com'] }
4618N/A </call>
4618N/A
4618N/A <call function="'checkImport'">
4618N/A { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
4618N/A 'uid=dmiller, ou=People, dc=example,dc=com',
4618N/A 'uid=rhunt, ou=People, dc=example,dc=com'] }
4618N/A </call>
4618N/A
4618N/A </sequence>
4618N/A
4618N/A <catch exception="'STAXException.*'" typevar="eType" var="eInfo">
4618N/A <message log="1" level="'fatal'">
4618N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
4618N/A </message>
4618N/A </catch>
4618N/A
4618N/A <finally>
4618N/A <call function="'testCase_Postamble'"/>
5073N/A </finally>
5073N/A </try>
4618N/A
5073N/A </testcase>
5073N/A
4347N/A </function>
4618N/A
4618N/A <!--- Test Case information
4618N/A #@TestMarker Backend Import Tests
4618N/A #@TestName Backend: Import: Fractional Include Branch with backend ID
5073N/A #@TestID Fractional Include Branch
5073N/A #@TestPurpose Verify an import of a LDIF file specifying a branch that should be included in the import
5073N/A along with the backendID.
5073N/A
5073N/A #@TestPreamble
4618N/A #@TestSteps
4618N/A #@TestPostamble
4618N/A #@TestResult
4618N/A -->
4618N/A
4618N/A <function name="backends_import_004" scope="local">
4618N/A
4618N/A <testcase name="getTestCaseName('Fractional Include Branch with backend ID')">
4618N/A
4618N/A <try>
4618N/A
4618N/A <sequence>
4618N/A
4618N/A <call function="'testCase_Preamble'"/>
4618N/A
4618N/A <call function="'ImportLdifWithScript'">
4618N/A { 'location' : STAF_REMOTE_HOSTNAME,
4618N/A 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
4618N/A 'includeBranches' : ['dc=com'],
4618N/A 'backEnd' : DIRECTORY_INSTANCE_BE
4618N/A }
4618N/A </call>
4618N/A
4618N/A <call function="'checkImport'">
4618N/A { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
4618N/A 'uid=dmiller, ou=People, dc=example,dc=com',
4618N/A 'uid=rhunt, ou=People, dc=example,dc=com'] }
4618N/A </call>
4618N/A
4618N/A </sequence>
4618N/A
4618N/A <catch exception="'STAXException.*'" typevar="eType" var="eInfo">
4618N/A <message log="1" level="'fatal'">
4618N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
4618N/A </message>
4618N/A </catch>
4618N/A
4618N/A <finally>
4618N/A <call function="'testCase_Postamble'"/>
4618N/A </finally>
4618N/A </try>
4618N/A
4618N/A </testcase>
4618N/A
4618N/A </function>
4618N/A
4618N/A <!--- Test Case information
4618N/A #@TestMarker Backend Import Tests
5073N/A #@TestName Backend: Import: Fractional Include Branches
4618N/A #@TestID Fractional Include Branches
5073N/A #@TestPurpose Verify an import of a LDIF file specifying multiple branches that should be included in the import.
4618N/A #@TestPreamble
6665N/A #@TestSteps
6665N/A #@TestPostamble
6665N/A #@TestResult
6665N/A -->
6665N/A
6665N/A <function name="backends_import_005" scope="local">
6665N/A
6665N/A <testcase name="getTestCaseName('Fractional Include Branches')">
6665N/A
6665N/A <try>
6665N/A
6665N/A <sequence>
6665N/A
6665N/A <call function="'testCase_Preamble'"/>
6665N/A
6665N/A <call function="'ImportLdifWithScript'">
6665N/A { 'location' : STAF_REMOTE_HOSTNAME,
6665N/A 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
6665N/A 'includeBranches' : ['dc=com','dc=example,dc=com']
6665N/A }
6665N/A </call>
6665N/A
6665N/A <call function="'checkImport'">
6665N/A { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
6665N/A 'uid=dmiller, ou=People, dc=example,dc=com',
6665N/A 'uid=rhunt, ou=People, dc=example,dc=com'] }
6665N/A </call>
6665N/A
6665N/A </sequence>
6665N/A
6665N/A <catch exception="'STAXException.*'" typevar="eType" var="eInfo">
6665N/A <message log="1" level="'fatal'">
6665N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
6665N/A </message>
6665N/A </catch>
6665N/A
6665N/A <finally>
6665N/A <call function="'testCase_Postamble'"/>
6665N/A </finally>
6665N/A </try>
6665N/A
6665N/A </testcase>
6665N/A
6665N/A </function>
6665N/A
6665N/A <!--- Test Case information
6665N/A #@TestMarker Backend Import Tests
4618N/A #@TestName Backend: Import: Fractional Exclude Branch
4680N/A #@TestID Fractional Exclude Branch
4618N/A #@TestPurpose Verify an import of a LDIF file specifying a branch that should be excluded in the import.
6665N/A #@TestPreamble
6665N/A #@TestSteps
6665N/A #@TestPostamble
6665N/A #@TestResult
6665N/A -->
6665N/A
6665N/A <function name="backends_import_006" scope="local">
6665N/A
6665N/A <testcase name="getTestCaseName('Fractional Exclude Branch')">
6665N/A
6665N/A <try>
6665N/A
6665N/A <sequence>
6665N/A
6665N/A <call function="'testCase_Preamble'"/>
6665N/A
6665N/A <call function="'ImportLdifWithScript'">
6665N/A { 'location' : STAF_REMOTE_HOSTNAME,
6665N/A 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
6665N/A 'excludeBranches' : ['ou=Departed,ou=People,dc=example,dc=com'],
6665N/A 'backEnd' : DIRECTORY_INSTANCE_BE
6665N/A }
6665N/A </call>
6665N/A
6665N/A <call function="'checkImport'">
6665N/A { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
6665N/A 'uid=dmiller, ou=People, dc=example,dc=com',
6665N/A 'uid=rhunt, ou=People, dc=example,dc=com'] ,
6665N/A 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
6665N/A 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com']
6665N/A }
6665N/A </call>
6665N/A
6665N/A </sequence>
6665N/A
6665N/A <catch exception="'STAXException.*'" typevar="eType" var="eInfo">
6665N/A <message log="1" level="'fatal'">
6665N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
6665N/A </message>
6665N/A </catch>
6665N/A
6665N/A <finally>
6665N/A <call function="'testCase_Postamble'"/>
6665N/A </finally>
6665N/A </try>
6665N/A
6665N/A </testcase>
6665N/A
6665N/A </function>
6665N/A
6665N/A <!--- Test Case information
6665N/A #@TestMarker Backend Import Tests
6665N/A #@TestName Backend: Import: Fractional Exclude Branches
6665N/A #@TestID Fractional Exclude Branches
6665N/A #@TestPurpose Verify an import of a LDIF file specifying multiple branches that should be excluded in the import.
6665N/A #@TestPreamble
6665N/A #@TestSteps
4618N/A #@TestPostamble
4618N/A #@TestResult
4618N/A -->
4618N/A
4618N/A <function name="backends_import_007" scope="local">
4618N/A
4618N/A <testcase name="getTestCaseName('Fractional Exclude Branches')">
4618N/A
4618N/A <try>
4618N/A
6665N/A <sequence>
4618N/A
4618N/A <call function="'testCase_Preamble'"/>
4618N/A
4618N/A <call function="'ImportLdifWithScript'">
6665N/A { 'location' : STAF_REMOTE_HOSTNAME,
6665N/A 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
6665N/A 'excludeBranches' : ['ou=Departed,ou=People,dc=example,dc=com', 'ou=unit1, ou=People, dc=example,dc=com'],
4618N/A 'backEnd' : DIRECTORY_INSTANCE_BE
6665N/A }
4618N/A </call>
4618N/A
4618N/A <call function="'checkImport'">
4618N/A { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
4618N/A 'uid=dmiller, ou=People, dc=example,dc=com',
4618N/A 'uid=rhunt, ou=People, dc=example,dc=com'] ,
4161N/A 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
4618N/A 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com',
4618N/A 'uid=arammell, ou=unit1, ou=People, dc=example,dc=com']
4618N/A }
4618N/A </call>
4618N/A
4618N/A </sequence>
4618N/A
4618N/A <catch exception="'STAXException.*'" typevar="eType" var="eInfo">
4618N/A <message log="1" level="'fatal'">
4618N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
4618N/A </message>
4618N/A </catch>
4618N/A
4161N/A <finally>
4618N/A <call function="'testCase_Postamble'"/>
4618N/A </finally>
4618N/A </try>
2938N/A
2938N/A </testcase>
2852N/A
</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'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Append.ldif' % remote.data,
'append' : 'TRUE',
'backEnd' : DIRECTORY_INSTANCE_BE
}
</call>
<call function="'checkImport'">
{ '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']
}
</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'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'ldifFile' : '%s/backends/Append.ldif' % remote.data,
'append' : 'TRUE',
'replaceExisting' : 'TRUE',
'backEnd' : DIRECTORY_INSTANCE_BE,
'knownIssue' : '6927338'
}
</call>
<call function="'checkImport'">
{ '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']
}
</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' : '839'
}
</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' : '839'
}
</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/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/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>