From ae33b37154863143bad0f32ed53200baf3537bb6 Mon Sep 17 00:00:00 2001
From: al_xipe <al_xipe@localhost>
Date: Mon, 30 Jul 2007 22:56:17 +0000
Subject: [PATCH] 1. fix for search index \n2. added add index with dsconfig\n3.added delete index with dsconfig\n4.added entry limit test but disabled for now
---
opendj-sdk/opends/tests/functional-tests/testcases/indexes/indexes.xml | 167 ++++++++---
opendj-sdk/opends/tests/functional-tests/testcases/indexes/search.filters | 172 ++++++------
opendj-sdk/opends/tests/functional-tests/shared/functions/tools.xml | 55 +++
opendj-sdk/opends/tests/functional-tests/shared/functions/dsconfig.xml | 396 +++++++++++++++++++++++++++
4 files changed, 648 insertions(+), 142 deletions(-)
diff --git a/opendj-sdk/opends/tests/functional-tests/shared/functions/dsconfig.xml b/opendj-sdk/opends/tests/functional-tests/shared/functions/dsconfig.xml
index 78be3e2..2ab6c32 100755
--- a/opendj-sdk/opends/tests/functional-tests/shared/functions/dsconfig.xml
+++ b/opendj-sdk/opends/tests/functional-tests/shared/functions/dsconfig.xml
@@ -49,6 +49,7 @@
</function>
+
<!-- Set property value using dsconfig -->
<function name="dsconfigSet">
<function-prolog>
@@ -134,7 +135,7 @@
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
- Expected return code value. Default value is 0
+ Expected return code value. Default value is 0
</function-arg-description>
<function-arg-property name="type" value="string"/>
</function-arg-def>
@@ -146,14 +147,11 @@
<script>
mylocation=location
STAFCmdParams=''
- STAFCmd=''
+ STAFCmd=''
if dsPath:
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
-
- if attributeValue:
- attributeValue=attributeValue.replace('"','QUOT')
STAFCmdParamsList=[]
STAFCmdParamsList.append('set-%s-prop ' % (objectName))
@@ -188,12 +186,7 @@
STAXCode=RC
STAXReason=STAXResult
</script>
- <call function="'checktestRC'">
- { 'returncode' : STAXCode ,
- 'result' : STAXReason ,
- 'expected' : expectedRC }
- </call>
-
+
<return>
STAXReason
</return>
@@ -783,6 +776,387 @@
</function>
+ <function name="addIndex">
+ <function-prolog>
+ This function eases adding JEB DB indexes
+ </function-prolog>
+ <function-map-args>
+ <function-arg-def name="location"
+ type="optional"
+ default="'%s' % STAF_REMOTE_HOSTNAME">
+ <function-arg-description>
+ Location of target host
+ </function-arg-description>
+ <function-arg-property name="type" value="hostname"/>
+ </function-arg-def>
+
+ <function-arg-def name="dsPath"
+ type="optional"
+ default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
+ <function-arg-description>
+ Pathname to installation root
+ </function-arg-description>
+ <function-arg-property name="type" value="filepath"/>
+ </function-arg-def>
+
+ <function-arg-def name="host"
+ type="optional"
+ default="'%s' % STAF_REMOTE_HOSTNAME">
+ <function-arg-description>
+ Directory server hostname or IP address
+ </function-arg-description>
+ <function-arg-property name="type" value="hostname"/>
+ </function-arg-def>
+
+ <function-arg-def name="port"
+ type="optional"
+ default="'%s' % DIRECTORY_INSTANCE_PORT">
+ <function-arg-description>
+ Directory server port number
+ </function-arg-description>
+ <function-arg-property name="type" value="Port number"/>
+ </function-arg-def>
+
+ <function-arg-def name="rootDN"
+ type="optional"
+ default="'%s' % DIRECTORY_INSTANCE_DN">
+ <function-arg-description>
+ Bind DN
+ </function-arg-description>
+ <function-arg-property name="type" value="DN"/>
+ </function-arg-def>
+
+ <function-arg-def name="rootPwd"
+ type="optional"
+ default="'%s' % DIRECTORY_INSTANCE_PSWD">
+ <function-arg-description>
+ Bind password
+ </function-arg-description>
+ <function-arg-property name="type" value="string"/>
+ </function-arg-def>
+
+ <function-arg-def name="backendID"
+ default="'%s' % DIRECTORY_INSTANCE_BE"
+ type="optional">
+ <function-arg-description>
+ The Back-end ID on to which to add an index
+ </function-arg-description>
+ </function-arg-def>
+
+ <function-arg-def name="indexAttribute" type="required">
+ <function-arg-description>
+ ldap attribute on to which to add indexing
+ </function-arg-description>
+ <function-arg-property name="type" value="string"/>
+ </function-arg-def>
+
+ <function-arg-def name="indexTypes" type="required">
+ <function-arg-description>
+ type of index to add
+ This has to be provided as a python array like
+ [ 'presence', 'substring' ]
+ </function-arg-description>
+ <function-arg-property name="type" value="enum">
+ <function-arg-property-description>
+ This argument can only have one of those values
+ </function-arg-property-description>
+ <function-arg-property-data type="choice" value="'equality'"/>
+ <function-arg-property-data type="choice" value="'ordering'"/>
+ <function-arg-property-data type="choice" value="'presence'" />
+ <function-arg-property-data type="choice" value="'substring'"/>
+ </function-arg-property>
+ </function-arg-def>
+ </function-map-args>
+ <sequence>
+ <!-- Local variables -->
+ <script>
+ dsconfigParams=''
+ dsconfigCmd=''
+ dsBinPath='%s/%s' % (dsPath,fileFolder)
+ dsconfigCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
+ dsconfigParams = 'create-je-index -h %s -p %s -D "%s" -w %s --backend-name %s --index-name %s --set index-type:%s' % (host,port,rootDN,rootPwd,backendID, indexAttribute, ' --set index-type:'.join(indexTypes))
+ </script>
+
+ <call function="'_dsconfigCommonArgs'"/>
+
+ <message>
+ 'Running [%s %s]' % (dsconfigCmd, dsconfigParams)
+ </message>
+
+ <process name="'dsconfig addIndex'">
+ <location>'%s' % location</location>
+ <command>'%s' % dsconfigCmd</command>
+ <parms>'%s' % dsconfigParams</parms>
+ <workdir>'%s' % dsBinPath</workdir>
+ <envs>
+ ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
+ </envs>
+ <console use="'same'"/>
+ <stderr mode="'stdout'"/>
+ <returnstdout/>
+ </process>
+ <message>
+ '%s returned [%s] with [%s]' % (dsconfigCmd, RC,STAXResult)
+ </message>
+ <return>
+ RC, STAXResult
+ </return>
+ </sequence>
+ </function>
+
+
+ <function name="modifyIndex">
+ <function-prolog>
+ This function eases modifying JEB DB indexes
+ </function-prolog>
+ <function-map-args>
+ <function-arg-def name="location"
+ type="optional"
+ default="'%s' % STAF_REMOTE_HOSTNAME">
+ <function-arg-description>
+ Location of target host
+ </function-arg-description>
+ <function-arg-property name="type" value="hostname"/>
+ </function-arg-def>
+
+ <function-arg-def name="dsPath"
+ type="optional"
+ default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
+ <function-arg-description>
+ Pathname to installation root
+ </function-arg-description>
+ <function-arg-property name="type" value="filepath"/>
+ </function-arg-def>
+
+ <function-arg-def name="host"
+ type="optional"
+ default="'%s' % STAF_REMOTE_HOSTNAME">
+ <function-arg-description>
+ Directory server hostname or IP address
+ </function-arg-description>
+ <function-arg-property name="type" value="hostname"/>
+ </function-arg-def>
+
+ <function-arg-def name="port"
+ type="optional"
+ default="'%s' % DIRECTORY_INSTANCE_PORT">
+ <function-arg-description>
+ Directory server port number
+ </function-arg-description>
+ <function-arg-property name="type" value="Port number"/>
+ </function-arg-def>
+
+ <function-arg-def name="rootDN"
+ type="optional"
+ default="'%s' % DIRECTORY_INSTANCE_DN">
+ <function-arg-description>
+ Bind DN
+ </function-arg-description>
+ <function-arg-property name="type" value="DN"/>
+ </function-arg-def>
+
+ <function-arg-def name="rootPwd"
+ type="optional"
+ default="'%s' % DIRECTORY_INSTANCE_PSWD">
+ <function-arg-description>
+ Bind password
+ </function-arg-description>
+ <function-arg-property name="type" value="string"/>
+ </function-arg-def>
+
+ <function-arg-def name="backendID"
+ default="'%s' % DIRECTORY_INSTANCE_BE"
+ type="optional">
+ <function-arg-description>
+ The Back-end ID on to which to add an index
+ </function-arg-description>
+ </function-arg-def>
+
+ <function-arg-def name="indexAttribute" type="required">
+ <function-arg-description>
+ ldap attribute on to which add indexing
+ </function-arg-description>
+ <function-arg-property name="type" value="string"/>
+ </function-arg-def>
+
+ <function-arg-def name="operation">
+ <function-arg-description>
+ This parameters defines the operation to be performed.
+ </function-arg-description>
+ <function-arg-property name="type" value="enum">
+ <function-arg-property-description>
+ This argument can only have one of the following values
+ </function-arg-property-description>
+ <function-arg-property-data type="choice" value="'add'" />
+ <function-arg-property-data type="choice" value="'remove'"/>
+ <function-arg-property-data type="choice" value="'reset'"/>
+ <function-arg-property-data type="choice" value="'set'"/>
+ </function-arg-property>
+
+ </function-arg-def>
+
+ <function-arg-def name="indexProperty" type="required">
+ <function-arg-description>
+ the property to manipulate if the operation is add or set
+ </function-arg-description>
+ <function-arg-property name="type" value="string"/>
+ </function-arg-def>
+ <function-arg-def name="indexPropertyValue" type="optional">
+ <function-arg-description>
+ the value for the provided property
+ </function-arg-description>
+ <function-arg-property name="type" value="string"/>
+ </function-arg-def>
+ </function-map-args>
+ <sequence>
+ <!-- Local variables -->
+ <script>
+ dsconfigParams=''
+ dsconfigCmd=''
+ dsBinPath='%s/%s' % (dsPath,fileFolder)
+ dsconfigCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
+ operationArguments = indexProperty
+ if indexPropertyValue:
+ operationArguments = '%s:%s' % (indexProperty, indexPropertyValue)
+ dsconfigParams = 'set-je-index-prop -h %s -p %s -D "%s" -w %s --backend-name %s --index-name %s --%s %s' % ( host, port, rootDN, rootPwd, backendID, indexAttribute, operation, operationArguments )
+ </script>
+
+ <call function="'_dsconfigCommonArgs'"/>
+
+ <message>
+ '%s %s' % (dsconfigCmd, dsconfigParams)
+ </message>
+
+ <process name="'dsconfig modifyIndex'">
+ <location>'%s' % location</location>
+ <command>'%s' % dsconfigCmd</command>
+ <parms>'%s' % dsconfigParams</parms>
+ <workdir>'%s' % dsBinPath</workdir>
+ <envs>
+ ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
+ </envs>
+ <console use="'same'"/>
+ <stderr mode="'stdout'"/>
+ <returnstdout/>
+ </process>
+ <return>
+ STAXReason
+ </return>
+ </sequence>
+ </function>
+
+
+ <function name="removeIndex">
+ <function-prolog>
+ This function eases removing JEB DB indexes from STAX
+ </function-prolog>
+ <function-map-args>
+ <function-arg-def name="location"
+ type="optional"
+ default="'%s' % STAF_REMOTE_HOSTNAME">
+ <function-arg-description>
+ Location of target host
+ </function-arg-description>
+ <function-arg-property name="type" value="hostname"/>
+ </function-arg-def>
+
+ <function-arg-def name="dsPath"
+ type="optional"
+ default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
+ <function-arg-description>
+ Pathname to installation root
+ </function-arg-description>
+ <function-arg-property name="type" value="filepath"/>
+ </function-arg-def>
+
+ <function-arg-def name="host"
+ type="optional"
+ default="'%s' % STAF_REMOTE_HOSTNAME">
+ <function-arg-description>
+ Directory server hostname or IP address
+ </function-arg-description>
+ <function-arg-property name="type" value="hostname"/>
+ </function-arg-def>
+
+ <function-arg-def name="port"
+ type="optional"
+ default="'%s' % DIRECTORY_INSTANCE_PORT">
+ <function-arg-description>
+ Directory server port number
+ </function-arg-description>
+ <function-arg-property name="type" value="Port number"/>
+ </function-arg-def>
+
+ <function-arg-def name="rootDN"
+ type="optional"
+ default="'%s' % DIRECTORY_INSTANCE_DN">
+ <function-arg-description>
+ Bind DN
+ </function-arg-description>
+ <function-arg-property name="type" value="DN"/>
+ </function-arg-def>
+
+ <function-arg-def name="rootPwd"
+ type="optional"
+ default="'%s' % DIRECTORY_INSTANCE_PSWD">
+ <function-arg-description>
+ Bind password
+ </function-arg-description>
+ <function-arg-property name="type" value="string"/>
+ </function-arg-def>
+
+ <function-arg-def name="backendID"
+ default="'%s' % DIRECTORY_INSTANCE_BE"
+ type="optional">
+ <function-arg-description>
+ The Back-end ID on to which to remove an index from
+ </function-arg-description>
+ </function-arg-def>
+
+ <function-arg-def name="indexAttribute" type="required">
+ <function-arg-description>
+ ldap attribute on to which to remove indexing
+ </function-arg-description>
+ <function-arg-property name="type" value="string"/>
+ </function-arg-def>
+
+ </function-map-args>
+ <sequence>
+ <!-- Local variables -->
+ <script>
+ dsconfigParams=''
+ dsconfigCmd=''
+ dsBinPath='%s/%s' % (dsPath,fileFolder)
+ dsconfigCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
+ dsconfigParams = 'delete-je-index -h %s -p %s -D "%s" -w %s --backend-name %s --index-name %s' % (host,port,rootDN,rootPwd,backendID, indexAttribute)
+ </script>
+
+ <call function="'_dsconfigCommonArgs'"/>
+
+ <message>
+ 'Running [%s %s]' % (dsconfigCmd, dsconfigParams)
+ </message>
+
+ <process name="'dsconfig removeIndex'">
+ <location>'%s' % location</location>
+ <command>'%s' % dsconfigCmd</command>
+ <parms>'%s' % dsconfigParams</parms>
+ <workdir>'%s' % dsBinPath</workdir>
+ <envs>
+ ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
+ </envs>
+ <console use="'same'"/>
+ <stderr mode="'stdout'"/>
+ <returnstdout/>
+ </process>
+ <message>
+ '%s returned [%s] with [%s]' % (dsconfigCmd, RC,STAXResult)
+ </message>
+ <return>
+ RC, STAXResult
+ </return>
+ </sequence>
+ </function>
<!-- Create synchronization provider using dsconfig -->
diff --git a/opendj-sdk/opends/tests/functional-tests/shared/functions/tools.xml b/opendj-sdk/opends/tests/functional-tests/shared/functions/tools.xml
index 1841505..360f936 100644
--- a/opendj-sdk/opends/tests/functional-tests/shared/functions/tools.xml
+++ b/opendj-sdk/opends/tests/functional-tests/shared/functions/tools.xml
@@ -437,6 +437,8 @@
<function-arg-def name="attributes" type="required">
<function-arg-description>
Specify a list of attributes to trigger index rebuild on
+ This should be passed on as a python array like
+ [ 'uid', 'telephonenumber' ]
</function-arg-description>
</function-arg-def>
</function-map-args>
@@ -444,7 +446,7 @@
<sequence>
<script>
_cmd='%s/rebuild-index%s' % (dsBinPath,fileExt)
- _args=' -b %s -i %s' % ( baseDN, ' '.join(attributes) )
+ _args=' -b %s -i %s' % ( baseDN, ' -i '.join(attributes) )
</script>
<message log="1" level="'info'">
'%s %s' % (_cmd,_args)
@@ -466,5 +468,56 @@
<return>STAXResult</return>
</sequence>
</function>
+
+ <function name="CLI_verify-index">
+ <function-prolog>
+ This wraps the verify-index tool to make it easy to use from STAX
+ </function-prolog>
+ <function-map-args>
+ <function-arg-def name="baseDN" type="required">
+ <function-arg-description>
+ Specify a back-end supporting indexing and triggers a verification of all
+ indexes in the scope of the provided baseDN
+ </function-arg-description>
+ </function-arg-def>
+ <function-arg-def name="attributes" type="required">
+ <function-arg-description>
+ Specify a list of attributes to trigger index verification on
+ This should be passed as a python array like
+ [ 'uid','telephonenumber' ]
+ </function-arg-description>
+ </function-arg-def>
+ <function-arg-def name="clean" type="optional">
+ <function-arg-description>
+ Specify a list of attributes to trigger index verification on
+ </function-arg-description>
+ </function-arg-def>
+ </function-map-args>
+
+ <sequence>
+ <script>
+ _cmd='%s/verify-index%s' % (dsBinPath,fileExt)
+ _args=' -b %s -i %s' % ( baseDN, ' -i '.join(attributes) )
+ </script>
+ <message log="1" level="'info'">
+ '%s %s' % (_cmd,_args)
+ </message>
+
+ <process name="'verify-index'">
+ <location>'%s' % location</location>
+ <command>'%s' % _cmd</command>
+ <parms>'%s' % _args</parms>
+ <workdir>'%s' % dsBinPath</workdir>
+ <envs>
+ ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
+ </envs>
+ <console use="'same'"/>
+ <stderr mode="'stdout'"/>
+ <returnstdout/>
+ </process>
+
+ <return>STAXResult</return>
+ </sequence>
+ </function>
</stax>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/indexes/indexes.xml b/opendj-sdk/opends/tests/functional-tests/testcases/indexes/indexes.xml
index 85ade51..4839ad1 100644
--- a/opendj-sdk/opends/tests/functional-tests/testcases/indexes/indexes.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/indexes/indexes.xml
@@ -34,7 +34,8 @@
CurrentTestPath={'group':'indexes','suite':'indexes'}
envAlreadyLoaded='true'
_setupSteps=['testGroup_Preamble','testSuite_Preamble','indexes_setup']
- _testSteps=['indexes_search','indexes_modify']
+ _testSteps=['indexes_search','indexes_modify','indexes_add','indexes_delete']
+ _cleanupSteps=['indexes_cleanup','testSuite_Postamble','testGroup_Postamble']
</script>
<!---
#@TestSuiteName Indexes
@@ -44,7 +45,7 @@
-->
<try>
- <!-- the pre-requisites are in a separate ite -->
+ <!-- the pre-requisites are in a separate iteration -->
<sequence>
<iterate in="_setupSteps" var="_setupStep">
<call function="_setupStep" />
@@ -60,7 +61,7 @@
<message log="1" level="'fatal'">'Could not start at least one server in the topology. Bailing out.'</message>
</catch>
<finally>
- <iterate in="['indexes_cleanup','testSuite_Postamble','testGroup_Postamble']" var="_cleanupStep">
+ <iterate in="_cleanupSteps" var="_cleanupStep">
<call function="'%s' % _cleanupStep" />
</iterate>
</finally>
@@ -82,7 +83,7 @@
#@TestPostamble none
#@TestResult Success if entry are indexed correctly
-->
- <block name="'indexes_search'">
+ <block name="'Search'">
<sequence>
<message log="1" level="'info'">
'starting the search tests'
@@ -108,7 +109,7 @@
#@TestPostamble none
#@TestResult Success if entry are indexed correctly
-->
- <block name="'indexes_modify'">
+ <block name="'Modify'">
<sequence>
<try>
<sequence>
@@ -116,21 +117,17 @@
{ 'filters' : 'before-modify' }
</call>
<call function="'runFunction'">
- { 'functionName' : 'modifyAnAttribute',
+ { 'functionName' : 'modifyIndex',
'functionException' : 'LDAP.ModifyException',
- 'functionFailureTC' : 'Indexes - Modify' ,
- 'functionMessage' : 'Adding substring index to attribute uid' ,
- 'functionArguments' : { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'ds-cfg-index-attribute=uid,cn=Index,ds-cfg-backend-id=userRoot,cn=Backends,cn=config' ,
- 'attributeName' : 'ds-cfg-index-type' ,
- 'newAttributeValue' : 'substring' ,
- 'changetype' : 'add' }
+ 'functionFailureTC' : '%s: %s: %s' % (CurrentTestPath['group'], CurrentTestPath['suite'], STAXCurrentBlock ) ,
+ 'functionMessage' : 'Adding substring index to attribute uid' ,
+ 'functionArguments' : { 'operation' : 'add' ,
+ 'indexAttribute' : 'uid' ,
+ 'indexProperty' : 'index-type' ,
+ 'indexPropertyValue' : 'substring'
+ }
}
</call>
-
<call function="'runFunction'">
{ 'functionName' : 'StopDsWithScript' ,
'functionException' : 'CLI.stop-ds' ,
@@ -179,13 +176,15 @@
#@TestMarker indexes
#@TestName indexes_add
#@TestIssue TODO: look up the issue in issue tracker
- #@TestPurpose harden the default indexes
+ #@TestPurpose check if the user can add her own indexes
#@TestPreamble none
- #@TestStep iterate through file search.filters
+ #@TestStep iterate through filters prior to adding indexes
+ #@TestStep add the indexes
+ #@TestStep iterate through filters after to adding indexes
#@TestPostamble none
#@TestResult Success if entry are indexed correctly
-->
- <block name="'indexes_add'">
+ <block name="'Add'">
<sequence>
<try>
<sequence>
@@ -193,25 +192,26 @@
{ 'filters' : 'before-add' }
</call>
<call function="'runFunction'">
- { 'functionName' : 'addIndex',
- 'functionException' : 'LDAP.AddIndexException',
- 'functionFailureTC' : 'Indexes - Add' ,
- 'functionMessage' : 'Adding presence index to attribute st ',
- 'functionArguments' : { indexAttribute : 'st' ,
- indexTypes : [ 'presence' ]
+ { 'functionName' : 'addIndex' ,
+ 'functionException' : 'LDAP.AddIndexException' ,
+ 'functionFailureTC' : 'Indexes - Add' ,
+ 'functionMessage' : 'Adding presence and equality index to attribute st',
+ 'functionArguments' : { 'indexAttribute' : 'l' ,
+ 'indexTypes' : [ 'presence', 'equality' ]
}
}
</call>
<call function="'runFunction'">
- { 'functionName' : 'StopDsWithScript' ,
- 'functionException' : 'CLI.stop-ds' ,
- 'functionFailureTC' : 'Indexes - Modify' ,
- 'functionArguments' : { 'location' : STAF_LOCAL_HOSTNAME ,
+ { 'functionName' : 'StopDsWithScript' ,
+ 'functionException' : 'CLI.stop-ds' ,
+ 'functionFailureTC' : '%s: %s: %s' % (CurrentTestPath['group'], CurrentTestPath['suite'], STAXCurrentBlock ) ,
+ 'functionArguments' : { 'location' : STAF_LOCAL_HOSTNAME ,
'dsHost' : DIRECTORY_INSTANCE_HOST,
'dsPort' : DIRECTORY_INSTANCE_PORT,
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
+ 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
+ }
}
</call>
<call function="'runFunction'">
@@ -219,14 +219,14 @@
'functionException' : 'CLI.RebuildIndex' ,
'functionFailureTC' : 'Indexes - Modify' ,
'functionArguments' : { 'baseDN' : DIRECTORY_INSTANCE_SFX ,
- 'attributes' : [ 'st' ]
+ 'attributes' : [ 'l' ]
}
}
</call>
<call function="'runFunction'">
{ 'functionName' : 'StartDsWithScript',
'functionException' : 'CLI.start-ds' ,
- 'functionFailureTC' : 'Indexes - Modify' ,
+ 'functionFailureTC' : '%s: %s: ' ,
'functionArguments' : { 'location' : STAF_LOCAL_HOSTNAME }
}
</call>
@@ -235,27 +235,105 @@
</call>
</sequence>
<catch exception="'STAXException.LDAP.AddIndexException'">
- <message log="1" level="'fatal'">'Fatal Error: Failed to add index for attribute st'</message>
+ <message log="1" level="'fatal'">'Fatal Error: Failed to add index for attribute l'</message>
</catch>
<catch exception="'STAXException.CLI.RebuildIndex'">
- <message log="1" level="'fatal'">'Fatal Error: Failed to rebuild index for attribute st'</message>
+ <message log="1" level="'fatal'">'Fatal Error: Failed to rebuild index for attribute l'</message>
</catch>
</try>
</sequence>
</block>
</function>
- <!--
- <function name="indexes_delete" scope="local">
+ <function name="indexes_remove" scope="local">
+ <!--
+ This test does a bunch of searches on the
+ and then verifies that it worked
+ #@TestMarker indexes
+ #@TestName indexes_remove
+ #@TestIssue TODO: look up the issue in issue tracker
+ #@TestPurpose Check if the user can remove indexes
+ #@TestPreamble none
+ #@TestStep iterate through filters prior to removing index
+ #@TestStep remove index
+ #@TestStep iterate through filters after to removing index
+ #@TestPostamble none
+ #@TestResult Success if entry are indexed as expected
+ -->
+ <block name="'Remove'">
+ <sequence>
+ <try>
+ <sequence>
+ <call function="'loopThroughFilters'">
+ { 'filters' : 'before-remove' }
+ </call>
+ <call function="'runFunction'">
+ { 'functionName' : 'removeIndex' ,
+ 'functionException' : 'LDAP.RemoveIndexException' ,
+ 'functionFailureTC' : '%s: %s: %s' % (CurrentTestPath['group'], CurrentTestPath['suite'], STAXCurrentBlock),
+ 'functionMessage' : 'Removing index on attribute l' ,
+ 'functionArguments' : { 'indexAttribute' : 'l' }
+ }
+ </call>
+ <call function="'loopThroughFilters'">
+ { 'filters' : 'after-remove' }
+ </call>
+ </sequence>
+ <catch exception="'STAXException.LDAP.RemoveIndexException'">
+ <message log="1" level="'fatal'">'Fatal Error: Failed to remove index for attribute l'</message>
+ </catch>
+ </try>
+ </sequence>
+ </block>
</function>
- <function name="indexes_verify" scope="local">
+ <function name="indexes_entry_limit">
+ <!--
+ This test does a bunch of searches on the
+ and then verifies that it worked
+ #@TestMarker indexes
+ #@TestName indexes_remove
+ #@TestIssue TODO: look up the issue in issue tracker
+ #@TestPurpose Check if the user can remove indexes
+ #@TestPreamble none
+ #@TestStep iterate through filters prior to removing index
+ #@TestStep remove index
+ #@TestStep iterate through filters after to removing index
+ #@TestPostamble none
+ #@TestResult Success if entry are indexed as expected
+ -->
+ <block name="'Entry_Limit'">
+ <sequence>
+ <try>
+ <sequence>
+ <call function="'loopThroughFilters'">
+ { 'filters' : 'before-entry-limit' }
+ </call>
+ <call function="'runFunction'">
+ { 'functionName' : 'modifyIndex' ,
+ 'functionException' : 'LDAP.ModifyIndexException' ,
+ 'functionFailureTC' : '%s: %s: %s' % (CurrentTestPath['group'], CurrentTestPath['suite'], STAXCurrentBlock),
+ 'functionMessage' : 'Modify index entry limit on attribute uid' ,
+ 'functionArguments' : { 'operation' : 'set' ,
+ 'indexAttribute' : 'uid' ,
+ 'indexProperty' : 'index-entry-limit' ,
+ 'indexPropertyValue' : '3'
+ }
+ }
+ </call>
+ <call function="'loopThroughFilters'">
+ { 'filters' : 'after-entry-limit' }
+ </call>
+ </sequence>
+ <catch exception="'STAXException.LDAP.RemoveIndexException'">
+ <message log="1" level="'fatal'">'Fatal Error: Failed to remove index for attribute l'</message>
+ </catch>
+ </try>
+ </sequence>
+ </block>
</function>
-
- <function name="indexes_search_limit">
- </function>
- -->
+
<function name="loopThroughFilters" scope="local">
<function-map-args>
@@ -328,7 +406,7 @@
testNumber=0
</script>
- <testcase name="'Indexes: %d.%s: %03d-%03d.%s: %s%02d' % ( len(_testSteps)-_testStepNumber, filters, len(indexTests)-indexTestNumber, indexTestNumber, test.getAttribute(), test.getName(), testNumber)" >
+ <testcase name="'%s: %d.%s: %03d-%03d.%s: %s%02d' % ( CurrentTestPath['group'], len(_testSteps)-_testStepNumber, filters, len(indexTests)-indexTestNumber, indexTestNumber, test.getAttribute(), test.getName(), testNumber)" >
<sequence>
<call function="'testCase_Preamble'" />
<message log="1" level="'trace'">
@@ -347,7 +425,8 @@
<script>
searchReturnCode, searchResultString = STAXResult[0]
srs=searchResultString.split('[')
- srt=srs[1]
+ srt=srs[1].replace('\n','').replace(' ','').replace('\r','')
+
if (str(searchReturnCode) == str(test.getRC())) and srt.startswith(test.getSearchString()):
test.pass()
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/indexes/search.filters b/opendj-sdk/opends/tests/functional-tests/testcases/indexes/search.filters
index df03fa0..fba2e87 100644
--- a/opendj-sdk/opends/tests/functional-tests/testcases/indexes/search.filters
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/indexes/search.filters
@@ -11,18 +11,18 @@
uid exactMatch (|(&(uid=jwallace))) 0 INDEXED
uid exactMatch (|(|(uid=jwallace))) 0 INDEXED
uid exactMatch (|(|(uid=jwallace))) 0 INDEXED
-uid subString uid=j* 0 INDEXED
-uid subString (uid=j*) 0 INDEXED
-uid subString uid=*allace 0 NOT-INDEXED
-uid subString (uid=*allace) 0 NOT-INDEXED
-uid subString (&(uid=*allace)) 0 NOT-INDEXED
-uid subString (|(uid=*allace)) 0 NOT-INDEXED
-uid subString (&(&(uid=*allace))) 0 NOT-INDEXED
-uid subString (&(|(uid=*allace))) 0 NOT-INDEXED
-uid subString (|(&(uid=*allace))) 0 NOT-INDEXED
-uid subString (|(|(uid=*allace))) 0 NOT-INDEXED
-uid subString uid=jw*ce 0 INDEXED
-uid subString (uid=jw*ce) 0 INDEXED
+uid substring uid=j* 0 INDEXED
+uid substring (uid=j*) 0 INDEXED
+uid substring uid=*allace 0 NOT-INDEXED
+uid substring (uid=*allace) 0 NOT-INDEXED
+uid substring (&(uid=*allace)) 0 NOT-INDEXED
+uid substring (|(uid=*allace)) 0 NOT-INDEXED
+uid substring (&(&(uid=*allace))) 0 NOT-INDEXED
+uid substring (&(|(uid=*allace))) 0 NOT-INDEXED
+uid substring (|(&(uid=*allace))) 0 NOT-INDEXED
+uid substring (|(|(uid=*allace))) 0 NOT-INDEXED
+uid substring uid=jw*ce 0 INDEXED
+uid substring (uid=jw*ce) 0 INDEXED
uid approximate uid~=wallace 0 NOT-INDEXED
uid approximate uid~=jwalace 0 NOT-INDEXED
uid negate !(uid=jwallace) 0 NOT-INDEXED
@@ -54,12 +54,12 @@
sn presence Sn=* 0 INDEXED
sn exactMatch sn=Bergin 0 INDEXED
sn exactMatch (sn=Bergin) 0 INDEXED
-sn subString sn=Ber* 0 INDEXED
-sn subString (sn=Ber*) 0 INDEXED
-sn subString sn=*ergin 0 INDEXED
-sn subString (sn=*ergin) 0 INDEXED
-sn subString sn=*ergi* 0 INDEXED
-sn subString (sn=*ergi*) 0 INDEXED
+sn substring sn=Ber* 0 INDEXED
+sn substring (sn=Ber*) 0 INDEXED
+sn substring sn=*ergin 0 INDEXED
+sn substring (sn=*ergin) 0 INDEXED
+sn substring sn=*ergi* 0 INDEXED
+sn substring (sn=*ergi*) 0 INDEXED
sn approximate sn~=begin 0 NOT-INDEXED
sn approximate (sn~=begin) 0 NOT-INDEXED
mail presence mail=* 0 INDEXED
@@ -68,14 +68,14 @@
mail presence mAiL=* 0 INDEXED
mail exactMatch mail=kvaughan@example.com 0 INDEXED
mail exactMatch (mail=kvaughan@example.com) 0 INDEXED
-#mail exactMatch ((mail=kvaughan@example.com)) 0 INDEXED
-#mail exactMatch (((((((mail=kvaughan@example.com))))))) 0 INDEXED
-mail subString mail=kvaughan* 0 INDEXED
-mail subString (mail=kvaughan*) 0 INDEXED
-mail subString mail=*aughan@example.com 0 INDEXED
-mail subString (mail=*aughan@example.com) 0 INDEXED
-mail subString mail=*aughan@example.* 0 INDEXED
-mail subString (mail=*aughan@example.*) 0 INDEXED
+mail exactMatch ((mail=kvaughan@example.com)) 0 INDEXED
+mail exactMatch (((((((mail=kvaughan@example.com))))))) 0 INDEXED
+mail substring mail=kvaughan* 0 INDEXED
+mail substring (mail=kvaughan*) 0 INDEXED
+mail substring mail=*aughan@example.com 0 INDEXED
+mail substring (mail=*aughan@example.com) 0 INDEXED
+mail substring mail=*aughan@example.* 0 INDEXED
+mail substring (mail=*aughan@example.*) 0 INDEXED
givenName presence givenName=* 0 INDEXED
givenName presence (givenName=*) 0 INDEXED
givenName presence givenname=* 0 INDEXED
@@ -102,54 +102,54 @@
givenName exactMatch (GIVENNAME=KIRSTEN) 0 INDEXED
givenName exactMatch gIvEnNaMe=kIrStEn 0 INDEXED
givenName exactMatch (gIvEnNaMe=kIrStEn) 0 INDEXED
-givenName subString givenName=kirst* 0 INDEXED
-givenName subString (givenName=kirst*) 0 INDEXED
-givenName subString GivenName=kirst* 0 INDEXED
-givenName subString (GivenName=kirst*) 0 INDEXED
-givenName subString givenname=kirst* 0 INDEXED
-givenName subString (givenname=kirst*) 0 INDEXED
-givenName subString GIVENNAME=kirst* 0 INDEXED
-givenName subString (GIVENNAME=kirst*) 0 INDEXED
-givenName subString givenName=*rsten 0 INDEXED
-givenName subString (givenName=*rsten) 0 INDEXED
-givenName subString GivenName=*rsten 0 INDEXED
-givenName subString (GivenName=*rsten) 0 INDEXED
-givenName subString givenname=*rsten 0 INDEXED
-givenName subString (givenname=*rsten) 0 INDEXED
-givenName subString givenName=*rste* 0 INDEXED
-givenName subString (givenName=*rste*) 0 INDEXED
-givenName subString GivenName=*rste* 0 INDEXED
-givenName subString (GivenName=*rste*) 0 INDEXED
-givenName subString GIVENNAME=*rste* 0 INDEXED
-givenName subString (GIVENNAME=*rste*) 0 INDEXED
+givenName substring givenName=kirst* 0 INDEXED
+givenName substring (givenName=kirst*) 0 INDEXED
+givenName substring GivenName=kirst* 0 INDEXED
+givenName substring (GivenName=kirst*) 0 INDEXED
+givenName substring givenname=kirst* 0 INDEXED
+givenName substring (givenname=kirst*) 0 INDEXED
+givenName substring GIVENNAME=kirst* 0 INDEXED
+givenName substring (GIVENNAME=kirst*) 0 INDEXED
+givenName substring givenName=*rsten 0 INDEXED
+givenName substring (givenName=*rsten) 0 INDEXED
+givenName substring GivenName=*rsten 0 INDEXED
+givenName substring (GivenName=*rsten) 0 INDEXED
+givenName substring givenname=*rsten 0 INDEXED
+givenName substring (givenname=*rsten) 0 INDEXED
+givenName substring givenName=*rste* 0 INDEXED
+givenName substring (givenName=*rste*) 0 INDEXED
+givenName substring GivenName=*rste* 0 INDEXED
+givenName substring (GivenName=*rste*) 0 INDEXED
+givenName substring GIVENNAME=*rste* 0 INDEXED
+givenName substring (GIVENNAME=*rste*) 0 INDEXED
cn presence cn=* 0 INDEXED
cn presence (cn=*) 0 INDEXED
cn presence CN=* 0 INDEXED
cn presence (CN=*) 0 INDEXED
cn presence Cn=* 0 INDEXED
cn presence (Cn=*) 0 INDEXED
-cn subString cn=Andy* 0 INDEXED
-cn subString (cn=Andy*) 0 INDEXED
-cn subString cn=andy* 0 INDEXED
-cn subString (cn=andy*) 0 INDEXED
-cn subString CN=aNDY* 0 INDEXED
-cn subString (CN=aNDY*) 0 INDEXED
-cn subString cN=andy* 0 INDEXED
-cn subString (cN=andy*) 0 INDEXED
-cn subString cn=andy* 0 INDEXED
-cn subString cn=*ergin 0 INDEXED
-cn subString (cn=*ergin) 0 INDEXED
-cn subString cn=*Bergin 0 INDEXED
-cn subString (cn=*Bergin) 0 INDEXED
-cn subString cN=*Bergin 0 INDEXED
-cn subString (cN=*Bergin) 0 INDEXED
-cn subString cn=*bERGIN 0 INDEXED
-cn subString (cn=*bERGIN) 0 INDEXED
-cn subString CN=*bERGIN 0 INDEXED
-cn subString (CN=*bERGIN) 0 INDEXED
-cn subString (CN=*bERGIN) 0 INDEXED
-cn subString (cn=and*rgin) 0 INDEXED
-cn subString (cn=aN*bErGiN) 0 INDEXED
+cn substring cn=Andy* 0 INDEXED
+cn substring (cn=Andy*) 0 INDEXED
+cn substring cn=andy* 0 INDEXED
+cn substring (cn=andy*) 0 INDEXED
+cn substring CN=aNDY* 0 INDEXED
+cn substring (CN=aNDY*) 0 INDEXED
+cn substring cN=andy* 0 INDEXED
+cn substring (cN=andy*) 0 INDEXED
+cn substring cn=andy* 0 INDEXED
+cn substring cn=*ergin 0 INDEXED
+cn substring (cn=*ergin) 0 INDEXED
+cn substring cn=*Bergin 0 INDEXED
+cn substring (cn=*Bergin) 0 INDEXED
+cn substring cN=*Bergin 0 INDEXED
+cn substring (cN=*Bergin) 0 INDEXED
+cn substring cn=*bERGIN 0 INDEXED
+cn substring (cn=*bERGIN) 0 INDEXED
+cn substring CN=*bERGIN 0 INDEXED
+cn substring (CN=*bERGIN) 0 INDEXED
+cn substring (CN=*bERGIN) 0 INDEXED
+cn substring (cn=and*rgin) 0 INDEXED
+cn substring (cn=aN*bErGiN) 0 INDEXED
telephoneNumber presence telephoneNumber=* 0 INDEXED
telephoneNumber presence (telephoneNumber=*) 0 INDEXED
telephoneNumber presence telephonenumber=* 0 INDEXED
@@ -164,21 +164,21 @@
telephoneNumber presence (|(|(TELEPHONENUMBER=*))) 0 INDEXED
telephoneNumber presence (&(|(TELEPHONENUMBER=*))) 0 INDEXED
telephoneNumber presence (|(&(TELEPHONENUMBER=*))) 0 INDEXED
-telephoneNumber subString telephoneNumber=*8585 0 INDEXED
-telephoneNumber subString (telephoneNumber=*8585) 0 INDEXED
-telephoneNumber subString telephoneNumber=+1* 0 INDEXED
-telephoneNumber subString (telephoneNumber=+1*) 0 INDEXED
-telephoneNumber subString telephoneNumber=*408* 0 INDEXED
-telephoneNumber subString (telephoneNumber=*408*) 0 INDEXED
-telephoneNumber subString telephoneNumber=+1*8585 0 INDEXED
-telephoneNumber subString (telephoneNumber=+1*8585) 0 INDEXED
-telephoneNumber subString telephoneNumber=+1*08*8585 0 INDEXED
-telephoneNumber subString (telephoneNumber=+1*08*8585) 0 INDEXED
-telephoneNumber subString (&(telephoneNumber=+1*08*8585)) 0 INDEXED
-telephoneNumber subString (|(telephoneNumber=+1*08*8585)) 0 INDEXED
-telephoneNumber subString (&(&(telephoneNumber=+1*08*8585))) 0 INDEXED
-telephoneNumber subString (&(|(telephoneNumber=+1*08*8585))) 0 INDEXED
-telephoneNumber subString (|(&(telephoneNumber=+1*08*8585))) 0 INDEXED
-telephoneNumber subString (|(|(|(|(|(|(|(telephoneNumber=+1*08*8585)))))))) 0 INDEXED
-telephoneNumber subString (&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(telephoneNumber=+1*08*8585)))))))))))))))) 0 INDEXED
-telephoneNumber subString (&(|(&(|(&(|(&(|(&(|(&(|(&(|(&(|(telephoneNumber=+1*08*8585))))))))))))))))) 0 INDEXED
+telephoneNumber substring telephoneNumber=*8585 0 INDEXED
+telephoneNumber substring (telephoneNumber=*8585) 0 INDEXED
+telephoneNumber substring telephoneNumber=+1* 0 INDEXED
+telephoneNumber substring (telephoneNumber=+1*) 0 INDEXED
+telephoneNumber substring telephoneNumber=*408* 0 INDEXED
+telephoneNumber substring (telephoneNumber=*408*) 0 INDEXED
+telephoneNumber substring telephoneNumber=+1*8585 0 INDEXED
+telephoneNumber substring (telephoneNumber=+1*8585) 0 INDEXED
+telephoneNumber substring telephoneNumber=+1*08*8585 0 INDEXED
+telephoneNumber substring (telephoneNumber=+1*08*8585) 0 INDEXED
+telephoneNumber substring (&(telephoneNumber=+1*08*8585)) 0 INDEXED
+telephoneNumber substring (|(telephoneNumber=+1*08*8585)) 0 INDEXED
+telephoneNumber substring (&(&(telephoneNumber=+1*08*8585))) 0 INDEXED
+telephoneNumber substring (&(|(telephoneNumber=+1*08*8585))) 0 INDEXED
+telephoneNumber substring (|(&(telephoneNumber=+1*08*8585))) 0 INDEXED
+telephoneNumber substring (|(|(|(|(|(|(|(telephoneNumber=+1*08*8585)))))))) 0 INDEXED
+telephoneNumber substring (&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(telephoneNumber=+1*08*8585)))))))))))))))) 0 INDEXED
+telephoneNumber substring (&(|(&(|(&(|(&(|(&(|(&(|(&(|(&(|(telephoneNumber=+1*08*8585))))))))))))))))) 0 INDEXED
--
Gitblit v1.10.0