import_ldif_bin_attr_10m.xml revision da97433d5cd26e422a370d186f98659383c06721
<?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
! trunk/opends/resource/legal-notices/OpenDS.LICENSE
! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
! 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
! trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="import_ldif_bin_attr_10m"/>
<function name="import_ldif_bin_attr_10m">
<sequence>
<block name="'bin-attr_10m'">
<sequence>
<script>
if not CurrentTestPath.has_key('group'):
CurrentTestPath['group']='import_ldif'
CurrentTestPath['suite']=STAXCurrentBlock
</script>
<call function="'testSuite_Preamble'"/>
<script>
timerDuration = '620m'
numberOfEntries = 10000000
ldifTemplate = '%s/%s_entries.template' % (remote.temp, numberOfEntries)
ldifFile = '%s/%s_entries.ldif' % (remote.temp, numberOfEntries)
totalEntries = numberOfEntries + 2
</script>
<import machine="STAF_LOCAL_HOSTNAME"
file="'%s/testcases/import_ldif/import_ldif_setup.xml' % (TESTS_DIR)"/>
<call function="'import_ldif_setup'" />
<testcase name="getTestCaseName('Preamble')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Import Ldif: Binary Attribute: Create custom indexes'
</message>
<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>
<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>
<message>
'Import Ldif: Binary Attribute: 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>
<message>
'Update java.properties file %s/%s/config/java.properties' \
% (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
</message>
<call function="'copyFile'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'srcfile' : '%s/%s/config/java.properties' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME) ,
'destfile' : '%s/java.properties' % local.temp ,
'remotehost' : STAXServiceMachine
}
</call>
<script>
rc = java_properties('%s/java.properties' % local.temp,
'import-ldif.offline',
[ "-server", "-Xms2048m", "-Xmx3072m" ])
</script>
<message>'RC %s' % rc</message>
<call function="'copyFile'">
{
'location' : STAXServiceMachine ,
'srcfile' : '%s/java.properties' % local.temp ,
'destfile' : '%s/%s/config/java.properties' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME) ,
'remotehost' : STAF_REMOTE_HOSTNAME
}
</call>
<call function="'dsJavaPropertiesWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<!-- Check if 'ldifFile' exists -->
<call function="'GetEntry'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'entry' : ldifFile ,
'attribute' : 'TYPE'
}
</call>
<if expr="RC == 48">
<sequence>
<message>
'Import Ldif: Binary Attribute: File %s does not exist, create it' % ldifFile
</message>
<message>
'Import Ldif: Binary Attribute: Preamble - Make an make-ldif template file (%s)' \
% numberOfEntries
</message>
<call function="'MakeAMakeLdifTemplate'">
{
'numEntries' : numberOfEntries ,
'additionalAttributes' : True ,
'templateFile' : ldifTemplate ,
'templateLocation' : STAF_REMOTE_HOSTNAME
}
</call>
<message>
'Import Ldif: Binary Attribute: Preamble - Make the ldif file'
</message>
<call function="'MakeLdifWithScript'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'templateFile' : ldifTemplate ,
'ldifFile' : ldifFile
}
</call>
</sequence>
<else>
<message>
'Import Ldif: Binary Attribute: File %s exists, do nothing' % ldifFile
</message>
</else>
</if>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<testcase name="getTestCaseName('Import Large Ldif File')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Import Ldif: Binary Attribute: Import large ldif file'
</message>
<call function="'ImportLdifWithScript'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'dsLdifFile' : ldifFile ,
'dsBackEnd' : 'userRoot'
}
</call>
<script>
returnString = STAXResult[0][1]
msgIndexLocation1 = 'Index l.presence phase two processing completed'
msgIndexLocation2 = 'Index l.substring phase two processing completed'
msgIndexStreet1 = 'Index st.equality phase two processing completed'
msgIndexStreet2 = 'Index st.substring phase two processing completed'
msgCount = 'Processed %s entries, imported %s, skipped 0, rejected 0' \
% (totalEntries,totalEntries)
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : msgIndexLocation1
}
</call>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : msgIndexLocation2
}
</call>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : msgIndexStreet1
}
</call>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : msgIndexStreet2
}
</call>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : msgCount
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<testcase name="getTestCaseName('Start Directory After Import')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Import Ldif: Binary Attribute: Start DS running on port %s' \
% (DIRECTORY_INSTANCE_PORT)
</message>
<call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<script>
returnString = STAXResult[0][1]
msg = 'The database backend userRoot containing %s entries has started' \
% totalEntries
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : msg
}
</call>
<!--- Check that DS started -->
<call function="'isAlive'">
{
'noOfLoops' : 10 ,
'noOfMilliSeconds' : 5000
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<testcase name="getTestCaseName('Search For Imported Entries')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Import Ldif: Binary Attribute: Search for certain entries that were imported'
</message>
<call function="'checkImport'">
{
'expectedEntries' : ['uid=user.0,ou=People,dc=com' ,
'uid=user.1000000,ou=People,dc=com' ,
'uid=user.2000000,ou=People,dc=com' ,
'uid=user.3000000,ou=People,dc=com' ,
'uid=user.4000000,ou=People,dc=com' ,
'uid=user.5000000,ou=People,dc=com' ,
'uid=user.6000000,ou=People,dc=com' ,
'uid=user.7000000,ou=People,dc=com' ,
'uid=user.8000000,ou=People,dc=com' ,
'uid=user.9000000,ou=People,dc=com' ,
'uid=user.9999999,ou=People,dc=com'] ,
'startDS' : 'no'
}
</call>
<message>
'Import Ldif: Binary Attribute: Delete ldif and template files'
</message>
<call function="'deleteFile'">
{
'location' : STAF_REMOTE_HOSTNAME,
'filename' : ldifFile
}
</call>
<call function="'deleteFile'">
{
'location' : STAF_REMOTE_HOSTNAME,
'filename' : ldifTemplate
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<testcase name="getTestCaseName('Rebuild all indexes online')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Import Ldif: Binary Attribute: 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>
<message>
'Import Ldif: Binary Attribute: Rebuild all indexes online'
</message>
<call function="'rebuildIndexWithScript'">
{
'dsBaseDN' : 'dc=com' ,
'dsRebuildAll' : 'True'
}
</call>
<script>
returnString = STAXResult[0][1]
msgIndexLocation1 = 'Index l.presence phase two processing completed'
msgIndexLocation2 = 'Index l.substring phase two processing completed'
msgIndexStreet1 = 'Index st.equality phase two processing completed'
msgIndexStreet2 = 'Index st.substring phase two processing completed'
msgCount = 'Rebuild complete. Processed %s entries' % totalEntries
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : msgIndexLocation1
}
</call>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : msgIndexLocation2
}
</call>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : msgIndexStreet1
}
</call>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : msgIndexStreet2
}
</call>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : msgCount
}
</call>
<call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<!--- Check that DS started -->
<call function="'isAlive'">
{
'noOfLoops' : 10 ,
'noOfMilliSeconds' : 5000
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<import machine="STAF_LOCAL_HOSTNAME"
file="'%s/testcases/import_ldif/import_ldif_cleanup.xml' % (TESTS_DIR)"/>
<call function="'import_ldif_cleanup'">
{ 'suiteSuffix' : 'import_1m' }
</call>
<call function="'testSuite_Postamble'"/>
</sequence>
</block>
</sequence>
</function>
</stax>