<?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 legal-notices/CDDLv1_0.txt
! or http://forgerock.org/license/CDDLv1.0.html.
! 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 legal-notices/CDDLv1_0.txt.
! 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 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="core_search_timelimit" />
<function name="core_search_timelimit">
<sequence>
<block name="'search-timelimit'">
<try>
<sequence>
<script>
if not CurrentTestPath.has_key('group'):
CurrentTestPath['group']='core'
CurrentTestPath['suite']=STAXCurrentBlock
</script>
<call function="'testSuite_Preamble'" />
<call function="'common_setup'">
{
'quickStart' : False,
'startServer' : True,
'stopServer' : False,
'loadData' : True,
'ldifFile' : '%s/core/ldifs/core_test_1K.ldif' % remote.data
}
</call>
<!--- Set the server wide size limit 0 to allow time limit tests to run properly-->
<sequence>
<message>
'Set the server wide size limit 0 to allow time limit tests to run properly'
</message>
<call function="'modifyGlobal'">
{ 'dsInstanceHost' : server.host,
'dsInstanceDn' : server.dn,
'dsInstancePswd' : server.password,
'attributeName' : 'size-limit',
'attributeValue' : '0'
}
</call>
<call function="'checktestRC'">
{ 'returncode' : RC,
'result' : STAXResult
}
</call>
</sequence>
<!--- Test Case : Search Time Limit: Time Limit Exceeded -->
<testcase name="getTestCaseName('Time Limit Exceeded')">
<sequence>
<call function="'testCase_Preamble'" />
<message>
'Core STmL1: Check the response of OpenDS when an ldap search request is conducted with a search time limit defined in the command line and the search time is exceeeded'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : server.host,
'dsInstancePort' : server.port,
'dsInstanceDn' : server.dn,
'dsInstancePswd' : server.password,
'dsBaseDN' : 'o=core tests,dc=example,dc=com',
'dsFilter' : 'objectclass=*',
'extraParams' : '-l 1',
'expectedRC' : 3
}
</call>
<call function="'testCase_Postamble'" />
</sequence>
</testcase>
<!--- Test Case : Search Time Limit: Time Limit Not Exceeded -->
<testcase name="getTestCaseName('Time Limit Not Exceeded')">
<sequence>
<call function="'testCase_Preamble'" />
<message>
'Core STmL2: Check the response of OpenDS when an ldap search request is conducted with a search time limit defined in the command line and the search time is not exceeed'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : server.host,
'dsInstancePort' : server.port,
'dsInstanceDn' : server.dn,
'dsInstancePswd' : server.password,
'dsBaseDN' : 'o=core tests,dc=example,dc=com',
'dsFilter' : 'objectclass=*',
'extraParams' : '-l 500'
}
</call>
<call function="'checktestRC'">
{ 'returncode' : RC ,
'result' : STAXResult
}
</call>
<call function="'testCase_Postamble'" />
</sequence>
</testcase>
<!--- Test Case : Search Time Limit: Server Wide Time Limit 1 second -->
<testcase name="getTestCaseName('Server Wide Time Limit 1 second')">
<sequence>
<call function="'testCase_Preamble'" />
<message>
'Core STmL3: Change the server-wide search time limit to 1 second'
</message>
<call function="'modifyGlobal'">
{ 'dsInstanceHost' : server.host,
'dsInstanceDn' : server.dn,
'dsInstancePswd' : server.password,
'attributeName' : 'time-limit',
'attributeValue' : '1s'
}
</call>
<call function="'checktestRC'">
{ 'returncode' : RC ,
'result' : STAXResult
}
</call>
<call function="'testCase_Postamble'" />
</sequence>
</testcase>
<!--- Test Case : Search Time Limit: Server Wide Time Limit Exceeded -->
<testcase name="getTestCaseName('Server Wide Time Limit Exceeded')">
<sequence>
<call function="'testCase_Preamble'" />
<message>
'Core STmL4: Check the response of OpenDS when an ldap search request is conducted with a search time limit defined by the server-wide parameter, ds-cfg-time-limit, and the search time limit is exceeded'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : server.host,
'dsInstancePort' : server.port,
'dsBaseDN' : 'o=core tests,dc=example,dc=com',
'dsFilter' : 'objectclass=*',
'expectedRC' : 3
}
</call>
<call function="'testCase_Postamble'" />
</sequence>
</testcase>
<!--- Test Case : Search Time Limit: Server Wide Time Limit 120 seconds -->
<testcase name="getTestCaseName('Server Wide Time Limit 120 seconds')">
<sequence>
<call function="'testCase_Preamble'" />
<message>
'Core STmL5: Change the server-wide search time limit to 120 seconds'
</message>
<call function="'modifyGlobal'">
{ 'dsInstanceHost' : server.host,
'dsInstanceDn' : server.dn,
'dsInstancePswd' : server.password,
'attributeName' : 'time-limit',
'attributeValue' : '120s'
}
</call>
<call function="'checktestRC'">
{ 'returncode' : RC ,
'result' : STAXResult
}
</call>
<call function="'testCase_Postamble'" />
</sequence>
</testcase>
<!--- Test Case : Search Time Limit: Server Wide Time Limit Not Exceeded -->
<testcase name="getTestCaseName('Server Wide Time Limit Not Exceeded')">
<sequence>
<call function="'testCase_Preamble'" />
<message>
'Core STmL6: Check the response of OpenDS when an ldap search request is conducted with a search time limit defined by the server-wide parameter, ds-cfg-time-limit, and the search time limit is not exceeded'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : server.host,
'dsInstancePort' : server.port,
'dsBaseDN' : 'o=core tests,dc=example,dc=com',
'dsFilter' : 'objectclass=*'}
</call>
<call function="'checktestRC'">
{ 'returncode' : RC,
'result' : STAXResult
}
</call>
<call function="'testCase_Postamble'" />
</sequence>
</testcase>
<!--- Test Case : Search Time Limit: Directory Manager Time Limit 1 -->
<testcase name="getTestCaseName('Directory Manager Time Limit 1')">
<sequence>
<call function="'testCase_Preamble'" />
<message>
'Core STmL7: Change the search time limit for cn=Directory Manager to 1'
</message>
<call function="'addEntry'">
{ 'dsInstanceHost' : server.host,
'dsInstancePort' : server.port,
'dsInstanceDn' : server.dn,
'dsInstancePswd' : server.password,
'entryToBeAdded' : '%s/core/ldifs/mod_timelimit3.ldif' % remote.data
}
</call>
<call function="'checktestRC'">
{ 'returncode' : RC ,
'result' : STAXResult
}
</call>
<call function="'testCase_Postamble'" />
</sequence>
</testcase>
<!--- Test Case : Search Time Limit: User Specific Time Limit Exceeded -->
<testcase name="getTestCaseName('User Specific Time Limit Exceeded')">
<sequence>
<call function="'testCase_Preamble'" />
<message>
'Core STmL8: Check the response of OpenDS when an ldap search request is conducted with a user search time limit defined by the user-specific parameter, ds-rlim-time-limit, and the search time limit is exceeded'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : server.host,
'dsInstancePort' : server.port,
'dsInstanceDn' : server.dn,
'dsInstancePswd' : server.password,
'dsBaseDN' : 'o=core tests,dc=example,dc=com',
'dsFilter' : 'objectclass=*',
'expectedRC' : 3
}
</call>
<call function="'testCase_Postamble'" />
</sequence>
</testcase>
<!--- Test Case : Search Time Limit: Time Limit Not Applicable -->
<testcase name="getTestCaseName('Time Limit Not Applicable')">
<sequence>
<call function="'testCase_Preamble'" />
<message>
'Core STmL9: Check the response of OpenDS when an ldap search request is conducted with a user search time limit defined by the user-specific parameter, ds-rlim-time-limit, and the search is conducted as a bind to a different user'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : server.host,
'dsInstancePort' : server.port,
'dsBaseDN' : 'o=core tests,dc=example,dc=com',
'dsFilter' : 'objectclass=*'
}
</call>
<call function="'checktestRC'">
{ 'returncode' : RC,
'result' : STAXResult
}
</call>
<call function="'testCase_Postamble'" />
</sequence>
</testcase>
<!--- Test Case : Search Time Limit: Directory Manager Time Limit 60 -->
<testcase name="getTestCaseName('Directory Manager Time Limit 60')">
<sequence>
<call function="'testCase_Preamble'" />
<message>
'Core STmL10: Change the search time limit for cn=Directory Manager to 60'
</message>
<call function="'addEntry'">
{ 'dsInstanceHost' : server.host,
'dsInstancePort' : server.port,
'dsInstanceDn' : server.dn,
'dsInstancePswd' : server.password,
'entryToBeAdded' : '%s/core/ldifs/mod_timelimit4.ldif' % remote.data
}
</call>
<call function="'checktestRC'">
{ 'returncode' : RC ,
'result' : STAXResult
}
</call>
<call function="'testCase_Postamble'" />
</sequence>
</testcase>
<!--- Test Case : Search Time Limit: No Time Limit -->
<testcase name="getTestCaseName('No Time Limit')">
<sequence>
<call function="'testCase_Preamble'" />
<message>
'Core STmL11: Check the response of OpenDS when an ldap search request is conducted with a user search time limit defined by the user-specific parameter ds-rlim-time-limit, equal to 60 and the search is conducted against 1150 entries'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : server.host,
'dsInstancePort' : server.port,
'dsInstanceDn' : server.dn,
'dsInstancePswd' : server.password,
'dsBaseDN' : 'o=core tests,dc=example,dc=com',
'dsFilter' : 'objectclass=*'
}
</call>
<call function="'checktestRC'">
{ 'returncode' : RC ,
'result' : STAXResult
}
</call>
<call function="'testCase_Postamble'" />
</sequence>
</testcase>
</sequence>
<finally>
<sequence>
<!-- Test Suite Cleanup -->
<message>'Finally: Global ACI Cleanup.'</message>
<try>
<call function="'common_cleanup'" />
<catch exception="'STAFException'">
<sequence>
<message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
</sequence>
</catch>
<finally>
<call function="'testSuite_Postamble'"/>
</finally>
</try>
</sequence>
</finally>
</try>
</block>
</sequence>
</function>
</stax>