4673N/A<?
xml version="1.0" encoding="UTF-8" standalone="no"?>
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 ! You can obtain a copy of the license at 4673N/A ! See the License for the specific language governing permissions 4673N/A ! and limitations under the License. 4673N/A ! When distributing Covered Code, include this CDDL HEADER in each 4673N/A ! file and include the License file at 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 ! Copyright 2012 ForgeRock AS. 4673N/A <!-- Definition of Test Cases --> 4673N/A <!--- Test Cases : ImportLDIF: Binary Attributes --> 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 <
function name="importldif_properties_001" scope="local">
4673N/A <
testcase name="getTestCaseName('Large Import Buffer')">
4673N/A <
call function="'testCase_Preamble'"/>
4673N/A 'Test Name = %s' % STAXCurrentTestcase
4673N/A 'Import Ldif: Large Import Buffer: Preamble - Change import buffer size'
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 'optionsString' : '--set import-queue-size:1000' ,
4673N/A 'Import Ldif: Large Import Buffer: Preamble - Stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
4673N/A <
call function="'StopDsWithScript'">
4673N/A { 'location' : STAF_REMOTE_HOSTNAME }
4673N/A totalEntries = numberOfEntries + 2
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 <
if expr="curr_file_exists=='0'">
4673N/A 'Import Ldif: Large Import Buffer: Preamble - Make an make-ldif template file'
4673N/A <
call function="'MakeAMakeLdifTemplate'">
4673N/A { 'numEntries' : numberOfEntries ,
4673N/A 'extraLine' : 'jpegPhoto:: <random:base64:38000>'}
4673N/A 'Import Ldif: Large Import Buffer: Preamble - Make the ldif file'
4673N/A <
call function="'MakeLdifWithScript'">
4673N/A 'ldifFile' : curr_filename }
4673N/A <
call function="'testStep'">
4673N/A { 'stepMessage' : 'Import the LDIF file.' }
4673N/A <
call function="'ImportLdifWithScript'">
4673N/A 'location' : STAF_REMOTE_HOSTNAME ,
4673N/A returnString = STAXResult[0][1]
4673N/A msg = 'Processed %s entries, imported %s, skipped 0, rejected 0' \
4673N/A % (totalEntries,totalEntries)
4673N/A <
call function="'checktestString'">
4673N/A 'returnString' : returnString ,
4673N/A <
call function="'testStep'">
4673N/A { 'stepMessage' : 'Start the Directory Server.' }
4673N/A <
call function="'StartDsWithScript'">
4673N/A { 'location' : STAF_REMOTE_HOSTNAME }
4673N/A returnString = STAXResult[0][1]
4673N/A msg = 'The database backend userRoot containing %s entries has started' \
4673N/A <
call function="'checktestString'">
'returnString' : returnString ,
<!--- Check that DS started --> <
call function="'isAlive'">
'noOfMilliSeconds' : 5000
<
call function="'testStep'">
{ 'stepMessage' : 'Verify import LDIF operations.' }
<
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'] ,
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>
<!--- 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')">
<
call function="'testCase_Preamble'"/>
[ "-server", "-Xms2048m" ])
<
message>'RC %s' % rc</
message>
<
call function="'dsJavaPropertiesWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
'Import Ldif: Many Threads: Preamble - Change import thread count'
<
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' ,
'Import Ldif: Many Threads: Preamble - Stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
<
call function="'StopDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'dsHost' : DIRECTORY_INSTANCE_HOST,
'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsBindDN' : DIRECTORY_INSTANCE_DN,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
totalEntries = numberOfEntries + 2
'Import Ldif: Many Threads: Looking for file, %s. File exists? (0=false, 1=true) %s' % (curr_filename, curr_file_exists)
<
if expr="curr_file_exists=='0'">
'Import Ldif: Many Threads: Preamble - Make an make-ldif template file'
<
call function="'MakeAMakeLdifTemplate'">
{ 'numEntries' : numberOfEntries ,
'extraLine' : 'jpegPhoto:: <random:base64:38000>'}
'Import Ldif: Many Threads: Preamble - Make the ldif file'
<
call function="'MakeLdifWithScript'">
'ldifFile' : curr_filename }
'Import Ldif: Many Threads: Import large ldif file'
<
call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'difFile' : curr_filename ,
returnString = STAXResult[0][1]
<
call function="'checktestString'">
{ 'returnString' : returnString ,
'expectedString' : 'Processed 100002 entries' }
'Import Ldif: Many Threads: Start DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
<
call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
<!--- Check that DS started --> <
call function="'isAlive'">
'noOfMilliSeconds' : 5000 }
'Import Ldif: Many Threads: Search for certain entries that were imported'
<
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'] ,
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>
<!--- 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')">
<
call function="'testCase_Preamble'"/>
'Import Ldif: Low Index Entry Limit: Preamble - Change import thread count'
<
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' ,
'Import Ldif: Low Index Entry Limit: Preamble - Stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
<
call function="'StopDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'dsHost' : DIRECTORY_INSTANCE_HOST,
'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsBindDN' : DIRECTORY_INSTANCE_DN,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
totalEntries = numberOfEntries + 2
'Import Ldif: Low Index Entry Limit: Looking for file, %s. File exists? (0=false, 1=true) %s' % (curr_filename, curr_file_exists)
<
if expr="curr_file_exists=='0'">
'Import Ldif: Low Index Entry Limit: Preamble - Make an make-ldif template file'
<
call function="'MakeAMakeLdifTemplate'">
{ 'numEntries' : numberOfEntries ,
'extraLine' : 'jpegPhoto:: <random:base64:38000>'}
'Import Ldif: Low Index Entry Limit: Preamble - Make the ldif file'
<
call function="'MakeLdifWithScript'">
'ldifFile' : curr_filename }
'Import Ldif: Low Index Entry Limit: Import large ldif file'
<
call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'ldifFile' : curr_filename ,
returnString = STAXResult[0][1]
<
call function="'checktestString'">
{ 'returnString' : returnString ,
'expectedString' : 'Processed 100002 entries' }
'Import Ldif: Low Index Entry Limit: Start DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
<
call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
<!--- Check that DS started --> <
call function="'isAlive'">
'noOfMilliSeconds' : 5000 }
'Import Ldif: Low Index Entry Limit: Search for certain entries that were imported'
<
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'] ,
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>