aci_targetscope.xml revision d25372dc8e65a9ed019a88fdf659ca61313f1b31
<?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 2008 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="aci_targetscope"/>
<function name="aci_targetscope">
<sequence>
<block name="'aci-target-scope'">
<sequence>
<script>
if not CurrentTestPath.has_key('group'):
CurrentTestPath['group']='aci'
CurrentTestPath['suite']=STAXCurrentBlock
</script>
<call function="'testSuite_Preamble'"/>
<!---
Place suite-specific test information here.
#@TestSuiteName ACI Targetscope Tests
#@TestSuitePurpose Test the basic ACI Targetscope Support.
#@TestSuiteGroup Basic ACI Targetscope Tests
#@TestScript aci_targetscope.xml
-->
<import machine="STAF_LOCAL_HOSTNAME"
file="'%s/testcases/aci/aci_setup.xml' % (TESTS_DIR)"/>
<call function="'aci_setup'" />
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker ACI Targetscope Tests
#@TestName Preamble
#@TestIssue none
#@TestPurpose Test default aci settings
#@TestPreamble none
#@TestStep Admin removes global search ACI.
#@TestStep Admin adds entries for the test cases.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0
and no entries are returned
for all operations.
-->
<!-- cross reference to http://docs.sun.com/source/816-6698-10/aci.html -->
<!-- cross reference to DS6 docs -->
<testcase name="getTestCaseName('Preamble')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'ACI: Targetscope: Preamble - Removing Search Global ACI'
</message>
<call function="'modifyGlobalAci'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'aciValue' : GLOBAL_ACI_SEARCH ,
'opType' : 'remove' }
</call>
<message>
'ACI: Targetscope: Preamble - Adding Entries For Targetscope Tests'
</message>
<call function="'addEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'entryToBeAdded' : '%s/aci/aci_targetscope/aci_startup_targetscope.ldif' % remote.data }
</call>
<call function="'checktestRC'">
{ 'returncode' : RC ,
'result' : STAXResult }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker ACI Bind Type Tests
#@TestName targetscope - base
#@TestIssue none
#@TestPurpose Test behavior of targetscope equals base
#@TestPreamble Admin adds an aci to the dn of one existing branch.
#@TestStep Client searches entry in the targeted branch dn for entry with children, parent.
#@TestStep Client searches entry in the targeted branch dn for entry with children, first child.
#@TestStep Client searches entry in the targeted branch dn for entry with children, second child.
#@TestStep Remove aci.
#@TestStep Client searches entry with the previously targeted branch dn.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0
for all ldap operations, and
and parent entry is returned in step 1.
-->
<testcase name="getTestCaseName('base')">
<sequence>
<call function="'testCase_Preamble'"/>
<script>
curr_aci_ldif_file = 'add_aci1.ldif'
curr_aci=retrieve_aci('%s/aci/aci_targetscope/%s' % (local.data,curr_aci_ldif_file));
</script>
<message>
'ACI: Targetscope: base, preamble adding aci,\n %s' % curr_aci
</message>
<call function="'modifyEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'entryToBeModified' : '%s/aci/aci_targetscope/%s' % (remote.data,curr_aci_ldif_file) }
</call>
<if expr="RC != 0">
<tcstatus result="'fail'"/>
</if>
<message>
'ACI: Targetscope: base, user searching targeted entry'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'ACIRules' ,
'dsBaseDN' : 'uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'cn sn uid' ,
'extraParams' : '-T' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '0' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillertwo,uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '0' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'cn:' ,
'expectedResult' : '1' }
</call>
<message>
'ACI: Targetscope: base, user searching in first child level'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'ACIRules' ,
'dsBaseDN' : 'uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'cn sn uid' ,
'extraParams' : '-T' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '0' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillertwo,uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '0' }
</call>
<message>
'ACI: Targetscope: base, user searching in second child level'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'ACIRules' ,
'dsBaseDN' : 'uid=dmillertwo,uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'cn sn uid' ,
'extraParams' : '-T' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillertwo,uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '0' }
</call>
<message>
'ACI: Targetscope: base, admin deleting aci'
</message>
<call function="'modifyEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'entryToBeModified' : '%s/aci/aci_targetscope/del_aci.ldif' % remote.data }
</call>
<if expr="RC != 0">
<tcstatus result="'fail'"/>
</if>
<message>
'ACI: Targetscope: base, user searching previously targeted entry'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'ACIRules' ,
'dsBaseDN' : 'uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'cn sn uid' ,
'extraParams' : '-T' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestStringNotPresent'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker ACI Bind Type Tests
#@TestName targetscope - onelevel
#@TestIssue none
#@TestPurpose Test behavior of targetscope equals onelevel
#@TestPreamble Admin adds an aci to the dn of one existing branch.
#@TestStep Client searches entry in the targeted branch dn for entry with children, parent.
#@TestStep Client searches entry in the targeted branch dn for entry with children, first child.
#@TestStep Client searches entry in the targeted branch dn for entry with children, second child.
#@TestStep Remove aci.
#@TestStep Client searches entry with the previously targeted branch dn.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0
for all ldap operations.
Child entry are returned in steps 1 and 2.
-->
<testcase name="getTestCaseName('onelevel')">
<sequence>
<call function="'testCase_Preamble'"/>
<script>
curr_aci_ldif_file = 'add_aci2.ldif'
curr_aci=retrieve_aci('%s/aci/aci_targetscope/%s' % (local.data,curr_aci_ldif_file));
</script>
<message>
'ACI: Targetscope: onelevel, preamble adding aci,\n %s' % curr_aci
</message>
<call function="'modifyEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'entryToBeModified' : '%s/aci/aci_targetscope/%s' % (remote.data,curr_aci_ldif_file) }
</call>
<if expr="RC != 0">
<tcstatus result="'fail'"/>
</if>
<message>
'ACI: Targetscope: onelevel, user searching targeted entry'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'ACIRules' ,
'dsBaseDN' : 'uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'cn sn uid' ,
'extraParams' : '-T' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '0' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillertwo,uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '0' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'cn:' ,
'expectedResult' : '1' }
</call>
<message>
'ACI: Targetscope: onelevel, user searching in first child level'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'ACIRules' ,
'dsBaseDN' : 'uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'cn sn uid' ,
'extraParams' : '-T' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillertwo,uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '0' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'cn:' ,
'expectedResult' : '1' }
</call>
<message>
'ACI: Targetscope: onelevel, user searching in second child level'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'ACIRules' ,
'dsBaseDN' : 'uid=dmillertwo,uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'cn sn uid' ,
'extraParams' : '-T' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillertwo,uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '0' }
</call>
<message>
'ACI: Targetscope: onelevel, admin deleting aci'
</message>
<call function="'modifyEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'entryToBeModified' : '%s/aci/aci_targetscope/del_aci.ldif' % remote.data }
</call>
<if expr="RC != 0">
<tcstatus result="'fail'"/>
</if>
<message>
'ACI: Targetscope: onelevel, user searching previously targeted entry'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'ACIRules' ,
'dsBaseDN' : 'uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'cn sn uid' ,
'extraParams' : '-T' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestStringNotPresent'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker ACI Bind Type Tests
#@TestName targetscope - subtree
#@TestIssue none
#@TestPurpose Test behavior of targetscope equals onelevel
#@TestPreamble Admin adds an aci to the dn of one existing branch.
#@TestStep Client searches entry in the targeted branch dn for entry with children, parent.
#@TestStep Client searches entry in the targeted branch dn for entry with children, first child.
#@TestStep Client searches entry in the targeted branch dn for entry with children, second child.
#@TestStep Remove aci.
#@TestStep Client searches entry with the previously targeted branch dn.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0
for all ldap operations.
All entries are returned in steps 1, 2 and 3.
-->
<testcase name="getTestCaseName('subtree')">
<sequence>
<call function="'testCase_Preamble'"/>
<script>
curr_aci_ldif_file = 'add_aci3.ldif'
curr_aci=retrieve_aci('%s/aci/aci_targetscope/%s' % (local.data,curr_aci_ldif_file));
</script>
<message>
'ACI: Targetscope: subtree, preamble adding aci,\n %s' % curr_aci
</message>
<call function="'modifyEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'entryToBeModified' : '%s/aci/aci_targetscope/%s' % (remote.data,curr_aci_ldif_file) }
</call>
<if expr="RC != 0">
<tcstatus result="'fail'"/>
</if>
<message>
'ACI: Targetscope: subtree, user searching targeted entry'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'ACIRules' ,
'dsBaseDN' : 'uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'cn sn uid' ,
'extraParams' : '-T' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillertwo,uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'cn:' ,
'expectedResult' : '1' }
</call>
<message>
'ACI: Targetscope: subtree, user searching in first child level'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'ACIRules' ,
'dsBaseDN' : 'uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'cn sn uid' ,
'extraParams' : '-T' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillertwo,uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'cn:' ,
'expectedResult' : '1' }
</call>
<message>
'ACI: Targetscope: subtree, user searching in second child level'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'ACIRules' ,
'dsBaseDN' : 'uid=dmillertwo,uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'cn sn uid' ,
'extraParams' : '-T' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillertwo,uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'cn:' ,
'expectedResult' : '1' }
</call>
<message>
'ACI: Targetscope: subtree, admin deleting aci'
</message>
<call function="'modifyEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'entryToBeModified' : '%s/aci/aci_targetscope/del_aci.ldif' % remote.data }
</call>
<if expr="RC != 0">
<tcstatus result="'fail'"/>
</if>
<message>
'ACI: Targetscope: subtree, user searching previously targeted entry'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'ACIRules' ,
'dsBaseDN' : 'uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'cn sn uid' ,
'extraParams' : '-T' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestStringNotPresent'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker ACI Bind Type Tests
#@TestName targetscope - subordinate
#@TestIssue none
#@TestPurpose Test behavior of targetscope equals onelevel
#@TestPreamble Admin adds an aci to the dn of one existing branch.
#@TestStep Client searches entry in the targeted branch dn for entry with children, parent.
#@TestStep Client searches entry in the targeted branch dn for entry with children, first child.
#@TestStep Client searches entry in the targeted branch dn for entry with children, second child.
#@TestStep Remove aci.
#@TestStep Client searches entry with the previously targeted branch dn.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0
for all ldap operations.
All entries except the parent are returned in steps 1, 2 and 3.
-->
<testcase name="getTestCaseName('subordinate')">
<sequence>
<call function="'testCase_Preamble'"/>
<script>
curr_aci_ldif_file = 'add_aci4.ldif'
curr_aci=retrieve_aci('%s/aci/aci_targetscope/%s' % (local.data,curr_aci_ldif_file));
</script>
<message>
'ACI: Targetscope: subordinate, preamble adding aci,\n %s' % curr_aci
</message>
<call function="'modifyEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'entryToBeModified' : '%s/aci/aci_targetscope/%s' % (remote.data,curr_aci_ldif_file) }
</call>
<if expr="RC != 0">
<tcstatus result="'fail'"/>
</if>
<message>
'ACI: Targetscope: subordinate, user searching targeted entry'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'ACIRules' ,
'dsBaseDN' : 'uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'cn sn uid' ,
'extraParams' : '-T' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '0' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillertwo,uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'cn:' ,
'expectedResult' : '1' }
</call>
<message>
'ACI: Targetscope: subordinate, user searching in first child level'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'ACIRules' ,
'dsBaseDN' : 'uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'cn sn uid' ,
'extraParams' : '-T' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillertwo,uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'cn:' ,
'expectedResult' : '1' }
</call>
<message>
'ACI: Targetscope: subordinate, user searching in second child level'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'ACIRules' ,
'dsBaseDN' : 'uid=dmillertwo,uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'cn sn uid' ,
'extraParams' : '-T' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmillertwo,uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' ,
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'cn:' ,
'expectedResult' : '1' }
</call>
<message>
'ACI: Targetscope: subordinate, admin deleting aci'
</message>
<call function="'modifyEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'entryToBeModified' : '%s/aci/aci_targetscope/del_aci.ldif' % remote.data }
</call>
<if expr="RC != 0">
<tcstatus result="'fail'"/>
</if>
<message>
'ACI: Targetscope: subordinate, user searching previously targeted entry'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'ACIRules' ,
'dsBaseDN' : 'uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'cn sn uid' ,
'extraParams' : '-T' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestStringNotPresent'">
{ 'returnString' : returnString ,
'testString' : 'dn: uid=dmiller,ou=People,ou=aci branch,o=Targetscope Tests,o=ACI Tests' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker ACI Bind Type Tests
#@TestName targetscope - syntax, bad keyword
#@TestIssue none
#@TestPurpose Test behavior of targetscope equals bad keyword
#@TestPreamble none
#@TestStep Admin adds an aci to the dn of one existing branch.
#@TestPostamble none
#@TestResult Success if OpenDS returns 21.
-->
<testcase name="getTestCaseName('bad keyword')">
<sequence>
<call function="'testCase_Preamble'"/>
<script>
curr_aci_ldif_file = 'add_syntax_aci1.ldif'
curr_aci=retrieve_aci('%s/aci/aci_targetscope/%s' % (local.data,curr_aci_ldif_file));
</script>
<message>
'ACI: Targetscope: bad keyword, preamble adding aci,\n %s' % curr_aci
</message>
<call function="'modifyEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'entryToBeModified' : '%s/aci/aci_targetscope/%s' % (remote.data,curr_aci_ldif_file) ,
'expectedRC' : 21
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker ACI Bind Type Tests
#@TestName targetscope - syntax, wildcard
#@TestIssue none
#@TestPurpose Test behavior of targetscope equals wildcard
#@TestPreamble none
#@TestStep Admin adds an aci to the dn of one existing branch.
#@TestPostamble none
#@TestResult Success if OpenDS returns 21.
-->
<testcase name="getTestCaseName('wildcard')">
<sequence>
<call function="'testCase_Preamble'"/>
<script>
curr_aci_ldif_file = 'add_syntax_aci2.ldif'
curr_aci=retrieve_aci('%s/aci/aci_targetscope/%s' % (local.data,curr_aci_ldif_file));
</script>
<message>
'ACI: Targetscope: wildcard, preamble adding aci,\n %s' % curr_aci
</message>
<call function="'modifyEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'entryToBeModified' : '%s/aci/aci_targetscope/%s' % (remote.data,curr_aci_ldif_file) ,
'expectedRC' : 21
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker ACI Bind Type Tests
#@TestName targetscope - syntax, not equals
#@TestIssue none
#@TestPurpose Test behavior of targetscope with not equals
#@TestPreamble none
#@TestStep Admin adds an aci to the dn of one existing branch.
#@TestPostamble none
#@TestResult Success if OpenDS returns 21.
-->
<testcase name="getTestCaseName('not equals')">
<sequence>
<call function="'testCase_Preamble'"/>
<script>
curr_aci_ldif_file = 'add_syntax_aci3.ldif'
curr_aci=retrieve_aci('%s/aci/aci_targetscope/%s' % (local.data,curr_aci_ldif_file));
</script>
<message>
'ACI: Targetscope: not equals, preamble adding aci,\n %s' % curr_aci
</message>
<call function="'modifyEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'entryToBeModified' : '%s/aci/aci_targetscope/%s' % (remote.data,curr_aci_ldif_file) ,
'expectedRC' : 21
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker ACI Target Tests
#@TestName Postamble
#@TestIssue none
#@TestPurpose Test default aci settings
#@TestPreamble none
#@TestStep Admin deletes the entries that were used for testing.
#@TestStep Admin puts back the global ACI for searches.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0
and no entries are returned
for all operations.
-->
<testcase name="getTestCaseName('Postamble')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'ACI: Targetscope: Postamble - deleting entries'
</message>
<call function="'DeleteEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsBaseDN' : 'o=Targetscope Tests, o=ACI Tests,dc=example,dc=com' ,
'extraParams' : '-x'}
</call>
<if expr="RC != 0">
<tcstatus result="'fail'"/>
</if>
<message>
'ACI: Targetscope: Resetting Search Global ACI'
</message>
<call function="'modifyGlobalAci'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'aciValue' : GLOBAL_ACI_SEARCH ,
'opType' : 'add' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<import machine="STAF_LOCAL_HOSTNAME"
file="'%s/testcases/aci/aci_cleanup.xml' % (TESTS_DIR)"/>
<call function="'aci_cleanup'" />
<call function="'testSuite_Postamble'"/>
</sequence>
</block>
</sequence>
</function>
</stax>