importldif_indexes_tests.xml revision 3437829f938dbb44527d91fbbc5f430a1243c5a5
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams<?xml version="1.0" encoding="UTF-8" standalone="no"?>
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams ! CDDL HEADER START
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams ! The contents of this file are subject to the terms of the
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams ! Common Development and Distribution License, Version 1.0 only
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams ! (the "License"). You may not use this file except in compliance
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams ! with the License.
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams ! or http://forgerock.org/license/CDDLv1.0.html.
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams ! See the License for the specific language governing permissions
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams ! and limitations under the License.
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams ! When distributing Covered Code, include this CDDL HEADER in each
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac ! file and include the License file at legal-notices/CDDLv1_0.txt.
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac ! If applicable, add the following below this CDDL HEADER, with the
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac ! fields enclosed by brackets "[]" replaced with your own identifying
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac ! information:
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams ! Portions Copyright [yyyy] [name of copyright owner]
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams ! CDDL HEADER END
87f13d7c78b4de35c94c8b4f84d68453e23e1994csovant ! Copyright 2012-2013 ForgeRock AS.
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams <!-- Definition of Test Cases -->
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams <!--- Test Cases : ImportLDIF: Indexes -->
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams <!--- Test Case information
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams #@TestMarker ImportLDIF: Indexes
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams #@TestName ImportLDIF: Indexes
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams #@TestID importldif_indexes_001
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams #@TestPurpose Verify import LDIF with Indexes
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams #@TestPreamble Common Setup
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams #@TestStep Make template for makeldif.
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams #@TestStep Create ldif file for import using makeldif.
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams #@TestStep Import the LDIF file.
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams #@TestStep Start the Directory Server.
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams #@TestStep Verify import LDIF operations.
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams #@TestPostamble Common Cleanup
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams #@TestResult Test is successful if the result code is 0
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams <function name="importldif_indexes_001" scope="local">
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams <testcase name="getTestCaseName('Many Indexes')">
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'Import Ldif: Many Indexes: Preamble - Create many indexes'
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams indexes_five = ['cn', 'givenName', 'sn', 'uid']
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams <iterate var="currIndex" in="indexes_five" indexvar="index">
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'subcommand' : 'set-local-db-index-prop' ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'objectType' : 'backend-name' ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'objectName' : 'userRoot',
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'optionsString' : '--index-name %s --add index-type:approximate --add index-type:equality --add index-type:ordering --add index-type:presence --add index-type:substring ' % currIndex ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'expectedRC' : 0 }
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams indexes_three = ['aci', 'mail', 'member', 'objectclass', 'telephonenumber', 'uniquemember']
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams <iterate var="currIndex" in="indexes_three" indexvar="index">
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'subcommand' : 'set-local-db-index-prop' ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'objectType' : 'backend-name' ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'objectName' : 'userRoot',
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'optionsString' : '--index-name %s --add index-type:equality --add index-type:presence --add index-type:substring ' % currIndex ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'expectedRC' : 0 }
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'subcommand' : 'create-local-db-index' ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'objectType' : 'backend-name' ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'objectName' : 'userRoot',
eef18571250bbe04cbeb42b8ff6d47753b14af7fcsovant 'optionsString' : '--index-name description --set index-type:approximate --set index-type:equality --set index-type:presence --set index-type:substring ' ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'expectedRC' : 0 }
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'subcommand' : 'create-local-db-index' ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'objectType' : 'backend-name' ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'objectName' : 'userRoot',
eef18571250bbe04cbeb42b8ff6d47753b14af7fcsovant 'optionsString' :'--index-name employeeNumber --set index-type:approximate --set index-type:equality --set index-type:ordering --set index-type:presence --set index-type:substring ' ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'expectedRC' : 0 }
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'Import Ldif: Many Indexes: Preamble - List indexes'
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'subcommand' : 'list-local-db-indexes' ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'objectType' : 'backend-name' ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'objectName' : 'userRoot',
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'expectedRC' : 0 }
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'Import Ldif: Many Indexes: Preamble - Stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams { 'location' : STAF_REMOTE_HOSTNAME,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'dsHost' : DIRECTORY_INSTANCE_HOST,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'dsBindDN' : DIRECTORY_INSTANCE_DN,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'Import Ldif: Many Indexes: Preamble - Make an make-ldif template file'
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams numberOfEntries='160'
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams { 'numEntries' : numberOfEntries ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'templateFile' : '%s/import_Entries_160.template' % (remote.temp) }
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'Import Ldif: Many Indexes: Preamble - Make the ldif file'
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams { 'templateFile' : '%s/import_Entries_160.template' % (remote.temp) ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'ldifFile' : '%s/import_Entries_160.ldif' % (remote.temp) }
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'Import Ldif: Many Indexes: Import large ldif file'
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams { 'location' : STAF_REMOTE_HOSTNAME ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'ldifFile' : '%s/import_Entries_160.ldif' % remote.temp,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'backEnd' : 'userRoot'}
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams returnString = STAXResult[0][1]
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams { 'returnString' : returnString ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'expectedString' : 'skipped 0, rejected 0' }
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'Import Ldif: Many Indexes: Start DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams { 'location' : STAF_REMOTE_HOSTNAME }
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams <!--- Check that DS started -->
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams { 'noOfLoops' : 10 ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'noOfMilliSeconds' : 5000 }
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'Import Ldif: Many Indexes: Search for certain entries that were imported'
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams { 'expectedEntries' : ['uid=user.1,ou=People,dc=com' ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'uid=user.100,ou=People,dc=com' ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'uid=user.159,ou=People,dc=com'] ,
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams 'startDS' : 'no'
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams <catch exception="'STAXException'" typevar="eType" var="eInfo">
6858c16497a49284f9fcba5fa12093b121306ca6gary.williams '%s: Test failed. eInfo(%s)' % (eType,eInfo)