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 6982N/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. 6982N/A ! When distributing Covered Code, include this CDDL HEADER in each 6982N/A ! file and include the License file at 6982N/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] 5821N/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: Binary Attributes 4673N/A #@TestName ImportLDIF: Binary Attributes 4673N/A #@TestID importldif_binary_attributes_001 4673N/A #@TestPurpose Verify basic 100k import LDIF operations 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 #@TestStep Delete the ldif file. 4673N/A #@TestStep Delete the template file. 4673N/A #@TestPostamble Common Cleanup 4673N/A #@TestResult Test is successful if the result code is 0 4673N/A <
function name="importldif_binary_attributes_001" scope="local">
4673N/A <
testcase name="getTestCaseName('Binary Attributes 100k')">
4673N/A <
call function="'testCase_Preamble'"/>
4673N/A 'Test Name = %s' % STAXCurrentTestcase
4673N/A totalEntries = numberOfEntries + 2
4673N/A <
call function="'StopDsWithScript'">
4673N/A { 'location' : STAF_REMOTE_HOSTNAME }
4673N/A <!-- Check if 'ldifFile' exists --> 4673N/A <
call function="'GetEntry'">
4673N/A 'location' : STAF_REMOTE_HOSTNAME ,
4673N/A <
call function="'testStep'">
4673N/A { 'stepMessage' : 'Make template for makeldif.' }
4673N/A <
call function="'MakeAMakeLdifTemplate'">
4673N/A 'numEntries' : numberOfEntries ,
4673N/A 'additionalAttributes' : True ,
4673N/A 'templateFile' : ldifTemplate ,
4673N/A 'templateLocation' : STAF_REMOTE_HOSTNAME
4673N/A <
call function="'testStep'">
4673N/A { 'stepMessage' : 'Create ldif file for import using makeldif.' }
4673N/A <
call function="'MakeLdifWithScript'">
4673N/A 'location' : STAF_REMOTE_HOSTNAME ,
4673N/A 'templateFile' : ldifTemplate ,
4673N/A <
call function="'testStep'">
4673N/A { 'stepMessage' : 'Template and ldif file already created.' }
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'">
4673N/A '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'] ,
<
call function="'testStep'">
{ 'stepMessage' : 'Delete the ldif file.' }
<
call function="'deleteFile'">
'location' : STAF_REMOTE_HOSTNAME,
<
call function="'testStep'">
{ 'stepMessage' : 'Delete the template file.' }
<
call function="'deleteFile'">
'location' : STAF_REMOTE_HOSTNAME,
'filename' : ldifTemplate
<
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: Binary Attributes #@TestName ImportLDIF: Binary Attributes #@TestID importldif_binary_attributes_002 #@TestPurpose Verify basic 6m import LDIF operations #@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. #@TestStep Delete the ldif file. #@TestStep Delete the template file. #@TestPostamble Common Cleanup #@TestResult Test is successful if the result code is 0 <
function name="importldif_binary_attributes_002" scope="local">
<
testcase name="getTestCaseName('Binary Attributes 6m')">
<
call function="'testCase_Preamble'"/>
'Test Name = %s' % STAXCurrentTestcase
numberOfEntries = 6000000
totalEntries = numberOfEntries + 2
<
call function="'StopDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
% (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
<
call function="'copyFile'">
'location' : STAF_REMOTE_HOSTNAME ,
'remotehost' : STAXServiceMachine
[ "-server", "-Xms2048m", "-Xmx3072m" ])
<
message>'RC %s' % rc</
message>
<
call function="'copyFile'">
'location' : STAXServiceMachine ,
'remotehost' : STAF_REMOTE_HOSTNAME
<
call function="'dsJavaPropertiesWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
<!-- Check if 'ldifFile' exists --> <
call function="'GetEntry'">
'location' : STAF_REMOTE_HOSTNAME ,
<
call function="'testStep'">
{ 'stepMessage' : 'Make template for makeldif.' }
<
call function="'MakeAMakeLdifTemplate'">
'numEntries' : numberOfEntries ,
'additionalAttributes' : True ,
'templateFile' : ldifTemplate ,
'templateLocation' : STAF_REMOTE_HOSTNAME
<
call function="'testStep'">
{ 'stepMessage' : 'Create ldif file for import using makeldif.' }
<
call function="'MakeLdifWithScript'">
'location' : STAF_REMOTE_HOSTNAME ,
'templateFile' : ldifTemplate ,
<
call function="'testStep'">
{ 'stepMessage' : 'Template and ldif file already created.' }
<
call function="'testStep'">
{ 'stepMessage' : 'Import the LDIF file.' }
<
call function="'ImportLdifWithScript'">
'location' : STAF_REMOTE_HOSTNAME ,
returnString = STAXResult[0][1]
msg = 'Processed %s entries, imported %s, skipped 0, rejected 0' \
% (totalEntries,totalEntries)
<
call function="'checktestString'">
'returnString' : returnString ,
<
call function="'testStep'">
{ 'stepMessage' : 'Start the Directory Server.' }
<
call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
returnString = STAXResult[0][1]
msg = 'The database backend userRoot containing %s entries has started' \
<
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.1000000,ou=People,dc=com' ,
'uid=user.1500000,ou=People,dc=com' ,
'uid=user.2000000,ou=People,dc=com' ,
'uid=user.2500000,ou=People,dc=com' ,
'uid=user.3000000,ou=People,dc=com' ,
'uid=user.3500000,ou=People,dc=com' ,
'uid=user.4000000,ou=People,dc=com' ,
'uid=user.4500000,ou=People,dc=com' ,
'uid=user.5000000,ou=People,dc=com' ,
'uid=user.5999999,ou=People,dc=com'] ,
<
call function="'testStep'">
{ 'stepMessage' : 'Delete the ldif file.' }
<
call function="'deleteFile'">
'location' : STAF_REMOTE_HOSTNAME,
<
call function="'testStep'">
{ 'stepMessage' : 'Delete the template file.' }
<
call function="'deleteFile'">
'location' : STAF_REMOTE_HOSTNAME,
'filename' : ldifTemplate
<
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: Binary Attributes #@TestName ImportLDIF: Binary Attributes #@TestID importldif_binary_attributes_003 #@TestPurpose Verify basic 10m import LDIF operations #@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. #@TestStep Delete the ldif file. #@TestStep Delete the template file. #@TestPostamble Common Cleanup #@TestResult Test is successful if the result code is 0 <
function name="importldif_binary_attributes_003" scope="local">
<
testcase name="getTestCaseName('Binary Attributes 10m')">
<
call function="'testCase_Preamble'"/>
'Test Name = %s' % STAXCurrentTestcase
numberOfEntries = 10000000
totalEntries = numberOfEntries + 2
'Import Ldif: Binary Attribute: Create custom indexes'
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'create-local-db-index' ,
'objectType' : 'backend-name' ,
'objectName' : DIRECTORY_INSTANCE_BE ,
'optionsString' : '--index-name st --set index-type:equality --set index-type:substring'
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'create-local-db-index' ,
'objectType' : 'backend-name' ,
'objectName' : DIRECTORY_INSTANCE_BE ,
'optionsString' : '--index-name l --set index-type:presence --set index-type:substring'
<
call function="'StopDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
% (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
<
call function="'copyFile'">
'location' : STAF_REMOTE_HOSTNAME ,
'remotehost' : STAXServiceMachine
[ "-server", "-Xms2048m", "-Xmx3072m" ])
<
message>'RC %s' % rc</
message>
<
call function="'copyFile'">
'location' : STAXServiceMachine ,
'remotehost' : STAF_REMOTE_HOSTNAME
<
call function="'dsJavaPropertiesWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
<!-- Check if 'ldifFile' exists --> <
call function="'GetEntry'">
'location' : STAF_REMOTE_HOSTNAME ,
<
call function="'testStep'">
{ 'stepMessage' : 'Make template for makeldif.' }
<
call function="'MakeAMakeLdifTemplate'">
'numEntries' : numberOfEntries ,
'additionalAttributes' : True ,
'templateFile' : ldifTemplate ,
'templateLocation' : STAF_REMOTE_HOSTNAME
<
call function="'testStep'">
{ 'stepMessage' : 'Create ldif file for import using makeldif.' }
<
call function="'MakeLdifWithScript'">
'location' : STAF_REMOTE_HOSTNAME ,
'templateFile' : ldifTemplate ,
<
call function="'testStep'">
{ 'stepMessage' : 'Template and ldif file already created.' }
<
call function="'testStep'">
{ 'stepMessage' : 'Import the LDIF file.' }
<
call function="'ImportLdifWithScript'">
'location' : STAF_REMOTE_HOSTNAME ,
returnString = STAXResult[0][1]
msg = 'Processed %s entries, imported %s, skipped 0, rejected 0' \
% (totalEntries,totalEntries)
<
call function="'checktestString'">
'returnString' : returnString ,
<
call function="'testStep'">
{ 'stepMessage' : 'Start the Directory Server.' }
<
call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
returnString = STAXResult[0][1]
msg = 'The database backend userRoot containing %s entries has started' \
<
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.1000000,ou=People,dc=com' ,
'uid=user.1500000,ou=People,dc=com' ,
'uid=user.2000000,ou=People,dc=com' ,
'uid=user.2500000,ou=People,dc=com' ,
'uid=user.3000000,ou=People,dc=com' ,
'uid=user.3500000,ou=People,dc=com' ,
'uid=user.4000000,ou=People,dc=com' ,
'uid=user.4500000,ou=People,dc=com' ,
'uid=user.5000000,ou=People,dc=com' ,
'uid=user.5999999,ou=People,dc=com'] ,
<
call function="'testStep'">
{ 'stepMessage' : 'Delete the ldif file.' }
<
call function="'deleteFile'">
'location' : STAF_REMOTE_HOSTNAME,
<
call function="'testStep'">
{ 'stepMessage' : 'Delete the template file.' }
<
call function="'deleteFile'">
'location' : STAF_REMOTE_HOSTNAME,
'filename' : ldifTemplate
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>