importldif_properties_tests.xml revision 5693
4673N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
4673N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
4673N/A<!--
4673N/A ! CDDL HEADER START
4673N/A !
4673N/A ! The contents of this file are subject to the terms of the
4673N/A ! Common Development and Distribution License, Version 1.0 only
4673N/A ! (the "License"). You may not use this file except in compliance
4673N/A ! with the License.
4673N/A !
4673N/A ! You can obtain a copy of the license at
4673N/A ! trunk/opends/resource/legal-notices/CDDLv1_0.txt
4673N/A ! or http://forgerock.org/license/CDDLv1.0.html.
4673N/A ! See the License for the specific language governing permissions
4673N/A ! and limitations under the License.
4673N/A !
4673N/A ! When distributing Covered Code, include this CDDL HEADER in each
4673N/A ! file and include the License file at
4673N/A ! trunk/opends/resource/legal-notices/CDDLv1_0.txt. If applicable,
4673N/A ! add the following below this CDDL HEADER, with the fields enclosed
4673N/A ! by brackets "[]" replaced with your own identifying information:
4673N/A ! Portions Copyright [yyyy] [name of copyright owner]
4673N/A !
4673N/A ! CDDL HEADER END
4673N/A !
4673N/A ! Copyright 2012 ForgeRock AS.
4673N/A ! -->
4673N/A<stax>
4673N/A
4673N/A <!-- Definition of Test Cases -->
4673N/A
4673N/A <!--- Test Cases : ImportLDIF: Binary Attributes -->
4673N/A
4673N/A <!--- Test Case information
4673N/A #@TestMarker ImportLDIF: Large Import Buffer
4673N/A #@TestName ImportLDIF: Large Import Buffer
4673N/A #@TestID importldif_properties_001
4673N/A #@TestPurpose Verify import LDIF with Large Import Buffer
4673N/A #@TestPreamble Common Setup
4673N/A #@TestStep Make template for makeldif.
4673N/A #@TestStep Create ldif file for import using makeldif.
4673N/A #@TestStep Import the LDIF file.
4673N/A #@TestStep Start the Directory Server.
4673N/A #@TestStep Verify import LDIF operations.
4673N/A #@TestPostamble Common Cleanup
4673N/A #@TestResult Test is successful if the result code is 0
4673N/A -->
4673N/A <function name="importldif_properties_001" scope="local">
4673N/A <testcase name="getTestCaseName('Large Import Buffer')">
4673N/A <sequence>
4673N/A <try>
4673N/A <sequence>
4673N/A
4673N/A <call function="'testCase_Preamble'"/>
4673N/A <message>
4673N/A 'Test Name = %s' % STAXCurrentTestcase
4673N/A </message>
4673N/A
4673N/A <message>
4673N/A 'Import Ldif: Large Import Buffer: Preamble - Change import buffer size'
4673N/A </message>
4673N/A
4673N/A <call function="'dsconfig'">
4673N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
4673N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
4673N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
4673N/A 'subcommand' : 'set-backend-prop' ,
4673N/A 'objectType' : 'backend-name' ,
4673N/A 'objectName' : 'userRoot',
4673N/A 'optionsString' : '--set import-queue-size:1000' ,
4673N/A 'expectedRC' : 0 }
4673N/A </call>
4673N/A
4673N/A <message>
4673N/A 'Import Ldif: Large Import Buffer: Preamble - Stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
4673N/A </message>
4673N/A
4673N/A <!-- StopDS -->
4673N/A <call function="'StopDsWithScript'">
4673N/A { 'location' : STAF_REMOTE_HOSTNAME }
4673N/A </call>
4673N/A
4673N/A <script>
4673N/A numberOfEntries = 100000
4673N/A totalEntries = numberOfEntries + 2
4673N/A bin_attr_filename = '%s_entries.ldif' % numberOfEntries
4673N/A import os.path
4673N/A curr_filename=remote.temp + "/" + bin_attr_filename
4673N/A curr_file_exists='0'
4673N/A if os.path.exists(curr_filename):
4673N/A curr_file_exists='1'
4673N/A </script>
4673N/A
4673N/A <message>
4673N/A 'Import Ldif: Large Import Buffer: Looking for file, %s. File exists? (0=false, 1=true) %s' % (curr_filename, curr_file_exists)
4673N/A </message>
4673N/A
4673N/A <if expr="curr_file_exists=='0'">
4673N/A <sequence>
4673N/A <message>
4673N/A 'Import Ldif: Large Import Buffer: Preamble - Make an make-ldif template file'
4673N/A </message>
4673N/A <call function="'MakeAMakeLdifTemplate'">
4673N/A { 'numEntries' : numberOfEntries ,
4673N/A 'templateFile' : '%s/import_Entries_100k.template' % (remote.temp) ,
4673N/A 'extraLine' : 'jpegPhoto:: &lt;random:base64:38000&gt;'}
4673N/A </call>
4673N/A
4673N/A <message>
4673N/A 'Import Ldif: Large Import Buffer: Preamble - Make the ldif file'
4673N/A </message>
4673N/A
4673N/A <call function="'MakeLdifWithScript'">
4673N/A { 'templateFile' : '%s/import_Entries_100k.template' % (remote.temp) ,
4673N/A 'ldifFile' : curr_filename }
4673N/A </call>
4673N/A </sequence>
4673N/A </if>
4673N/A
4673N/A <call function="'testStep'">
4673N/A { 'stepMessage' : 'Import the LDIF file.' }
4673N/A </call>
4673N/A
4673N/A <call function="'ImportLdifWithScript'">
4673N/A {
4673N/A 'location' : STAF_REMOTE_HOSTNAME ,
4673N/A 'ldifFile' : ldifFile ,
4673N/A 'backEnd' : 'userRoot'
4673N/A }
4673N/A </call>
4673N/A
4673N/A <script>
4673N/A returnString = STAXResult[0][1]
4673N/A msg = 'Processed %s entries, imported %s, skipped 0, rejected 0' \
4673N/A % (totalEntries,totalEntries)
4673N/A </script>
4673N/A
4673N/A <call function="'checktestString'">
4673N/A {
4673N/A 'returnString' : returnString ,
4673N/A 'expectedString' : msg
4673N/A }
4673N/A </call>
4673N/A
4673N/A <call function="'testStep'">
4673N/A { 'stepMessage' : 'Start the Directory Server.' }
4673N/A </call>
4673N/A
4673N/A <call function="'StartDsWithScript'">
4673N/A { 'location' : STAF_REMOTE_HOSTNAME }
4673N/A </call>
4673N/A
4673N/A <script>
4673N/A returnString = STAXResult[0][1]
4673N/A msg = 'The database backend userRoot containing %s entries has started' \
4673N/A % totalEntries
4673N/A </script>
4673N/A
4673N/A <call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : msg
}
</call>
<!--- Check that DS started -->
<call function="'isAlive'">
{
'noOfLoops' : 10 ,
'noOfMilliSeconds' : 5000
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Verify import LDIF operations.' }
</call>
<call function="'checkImport'">
{
'expectedEntries' : ['uid=user.0,ou=People,dc=com' ,
'uid=user.10000,ou=People,dc=com' ,
'uid=user.20000,ou=People,dc=com' ,
'uid=user.30000,ou=People,dc=com' ,
'uid=user.40000,ou=People,dc=com' ,
'uid=user.50000,ou=People,dc=com' ,
'uid=user.60000,ou=People,dc=com' ,
'uid=user.70000,ou=People,dc=com' ,
'uid=user.80000,ou=People,dc=com' ,
'uid=user.90000,ou=People,dc=com' ,
'uid=user.99999,ou=People,dc=com'] ,
'startDS' : 'no'
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker ImportLDIF: Many Threads
#@TestName ImportLDIF: Many Threads
#@TestID importldif_properties_002
#@TestPurpose Verify import LDIF with Many Threads
#@TestPreamble Common Setup
#@TestStep Make template for makeldif.
#@TestStep Create ldif file for import using makeldif.
#@TestStep Import the LDIF file.
#@TestStep Start the Directory Server.
#@TestStep Verify import LDIF operations.
#@TestPostamble Common Cleanup
#@TestResult Test is successful if the result code is 0
-->
<function name="importldif_properties_002" scope="local">
<testcase name="getTestCaseName('Many Threads')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>'Update java.properties file %s/%s/config/java.properties' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)</message>
<script>
rc = java_properties('%s/%s/config/java.properties' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME),
'import-ldif.offline',
[ "-server", "-Xms2048m" ])
</script>
<message>'RC %s' % rc</message>
<call function="'dsJavaPropertiesWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<message>
'Import Ldif: Many Threads: Preamble - Change import thread count'
</message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-backend-prop' ,
'objectType' : 'backend-name' ,
'objectName' : 'userRoot',
'optionsString' : '--set import-thread-count:2048' ,
'expectedRC' : 0 }
</call>
<message>
'Import Ldif: Many Threads: Preamble - Stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
</message>
<call function="'StopDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'dsHost' : DIRECTORY_INSTANCE_HOST,
'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsBindDN' : DIRECTORY_INSTANCE_DN,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
</call>
<script>
numberOfEntries = 100000
totalEntries = numberOfEntries + 2
bin_attr_filename = '%s_entries.ldif' % numberOfEntries
import os.path
curr_filename=remote.temp + "/" + bin_attr_filename
curr_file_exists='0'
if os.path.exists(curr_filename):
curr_file_exists='1'
</script>
<message>
'Import Ldif: Many Threads: Looking for file, %s. File exists? (0=false, 1=true) %s' % (curr_filename, curr_file_exists)
</message>
<if expr="curr_file_exists=='0'">
<sequence>
<message>
'Import Ldif: Many Threads: Preamble - Make an make-ldif template file'
</message>
<call function="'MakeAMakeLdifTemplate'">
{ 'numEntries' : numberOfEntries ,
'templateFile' : '%s/import_Entries_100k.template' % (remote.temp) ,
'extraLine' : 'jpegPhoto:: &lt;random:base64:38000&gt;'}
</call>
<message>
'Import Ldif: Many Threads: Preamble - Make the ldif file'
</message>
<call function="'MakeLdifWithScript'">
{ 'templateFile' : '%s/import_Entries_100k.template' % (remote.temp) ,
'ldifFile' : curr_filename }
</call>
</sequence>
</if>
<message>
'Import Ldif: Many Threads: Import large ldif file'
</message>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'difFile' : curr_filename ,
'backEnd' : 'userRoot'}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{ 'returnString' : returnString ,
'expectedString' : 'Processed 100002 entries' }
</call>
<message>
'Import Ldif: Many Threads: Start DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
</message>
<call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<!--- Check that DS started -->
<call function="'isAlive'">
{ 'noOfLoops' : 10 ,
'noOfMilliSeconds' : 5000 }
</call>
<message>
'Import Ldif: Many Threads: Search for certain entries that were imported'
</message>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=user.1,ou=People,dc=com' ,
'uid=user.10000,ou=People,dc=com' ,
'uid=user.20000,ou=People,dc=com' ,
'uid=user.30000,ou=People,dc=com' ,
'uid=user.40000,ou=People,dc=com' ,
'uid=user.50000,ou=People,dc=com' ,
'uid=user.60000,ou=People,dc=com' ,
'uid=user.70000,ou=People,dc=com' ,
'uid=user.80000,ou=People,dc=com' ,
'uid=user.90000,ou=People,dc=com' ,
'uid=user.99999,ou=People,dc=com'] ,
'startDS' : 'no'
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker ImportLDIF: Low Index Entry Limit
#@TestName ImportLDIF: Low Index Entry Limit
#@TestID importldif_properties_003
#@TestPurpose Verify import LDIF with Low Index Entry Limit
#@TestPreamble Common Setup
#@TestStep Make template for makeldif.
#@TestStep Create ldif file for import using makeldif.
#@TestStep Import the LDIF file.
#@TestStep Start the Directory Server.
#@TestStep Verify import LDIF operations.
#@TestPostamble Common Cleanup
#@TestResult Test is successful if the result code is 0
-->
<function name="importldif_properties_003" scope="local">
<testcase name="getTestCaseName('Low Index Entry Limit')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Import Ldif: Low Index Entry Limit: Preamble - Change import thread count'
</message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-backend-prop' ,
'objectType' : 'backend-name' ,
'objectName' : 'userRoot',
'optionsString' : '--set index-entry-limit:4' ,
'expectedRC' : 0 }
</call>
<message>
'Import Ldif: Low Index Entry Limit: Preamble - Stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
</message>
<call function="'StopDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'dsHost' : DIRECTORY_INSTANCE_HOST,
'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsBindDN' : DIRECTORY_INSTANCE_DN,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
</call>
<script>
numberOfEntries = 100000
totalEntries = numberOfEntries + 2
bin_attr_filename = '%s_entries.ldif' % numberOfEntries
import os.path
curr_filename=remote.temp + "/" + bin_attr_filename
curr_file_exists='0'
if os.path.exists(curr_filename):
curr_file_exists='1'
</script>
<message>
'Import Ldif: Low Index Entry Limit: Looking for file, %s. File exists? (0=false, 1=true) %s' % (curr_filename, curr_file_exists)
</message>
<if expr="curr_file_exists=='0'">
<sequence>
<message>
'Import Ldif: Low Index Entry Limit: Preamble - Make an make-ldif template file'
</message>
<call function="'MakeAMakeLdifTemplate'">
{ 'numEntries' : numberOfEntries ,
'templateFile' : '%s/import_Entries_100k.template' % (remote.temp) ,
'extraLine' : 'jpegPhoto:: &lt;random:base64:38000&gt;'}
</call>
<message>
'Import Ldif: Low Index Entry Limit: Preamble - Make the ldif file'
</message>
<call function="'MakeLdifWithScript'">
{ 'templateFile' : '%s/import_Entries_100k.template' % (remote.temp) ,
'ldifFile' : curr_filename }
</call>
</sequence>
</if>
<message>
'Import Ldif: Low Index Entry Limit: Import large ldif file'
</message>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'ldifFile' : curr_filename ,
'backEnd' : 'userRoot'}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{ 'returnString' : returnString ,
'expectedString' : 'Processed 100002 entries' }
</call>
<message>
'Import Ldif: Low Index Entry Limit: Start DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
</message>
<call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<!--- Check that DS started -->
<call function="'isAlive'">
{ 'noOfLoops' : 10 ,
'noOfMilliSeconds' : 5000 }
</call>
<message>
'Import Ldif: Low Index Entry Limit: Search for certain entries that were imported'
</message>
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=user.1,ou=People,dc=com' ,
'uid=user.10000,ou=People,dc=com' ,
'uid=user.20000,ou=People,dc=com' ,
'uid=user.30000,ou=People,dc=com' ,
'uid=user.40000,ou=People,dc=com' ,
'uid=user.50000,ou=People,dc=com' ,
'uid=user.60000,ou=People,dc=com' ,
'uid=user.70000,ou=People,dc=com' ,
'uid=user.80000,ou=People,dc=com' ,
'uid=user.90000,ou=People,dc=com' ,
'uid=user.99999,ou=People,dc=com'] ,
'startDS' : 'no'
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
</stax>