From 49c1f2519d0d9700bd6201b2807897f792fd80a0 Mon Sep 17 00:00:00 2001
From: mkeyes <mkeyes@localhost>
Date: Fri, 01 Jun 2007 18:37:51 +0000
Subject: [PATCH] Added some functional tests based on statements and examples in the wiki documentation.
---
opends/tests/functional-tests/shared/data/aci/aci_target/add_aci33.ldif | 30 ++
opends/tests/functional-tests/shared/data/aci/aci_startup.ldif | 18 +
opends/tests/functional-tests/shared/data/aci/aci_targetattr/add_aci11.ldif | 30 ++
opends/tests/functional-tests/shared/data/aci/aci_target/add_aci34.ldif | 30 ++
opends/tests/functional-tests/testcases/aci/aci_bindtypes.xml | 175 +++++++++++++-
opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_userdn_aci1.ldif | 30 ++
opends/tests/functional-tests/testcases/aci/aci_target.xml | 303 +++++++++++++++++++++++++
opends/tests/functional-tests/testcases/aci/aci_targetattr.xml | 45 +++
8 files changed, 648 insertions(+), 13 deletions(-)
diff --git a/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_userdn_aci1.ldif b/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_userdn_aci1.ldif
new file mode 100644
index 0000000..c78ca86
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_userdn_aci1.ldif
@@ -0,0 +1,30 @@
+# 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
+#
+# Portions Copyright 2007 Sun Microsystems, Inc.
+#
+
+dn: ou=aci branch, o=Bind Type Tests, o=ACI Tests, dc=example,dc=com
+changetype: modify
+add: aci
+aci: (targetattr="*")(targetfilter="(roomnumber=4135)")(version 3.0; acl "add_userdn_aci1"; allow (search,read) userdn="ldap:///all";)
+
diff --git a/opends/tests/functional-tests/shared/data/aci/aci_startup.ldif b/opends/tests/functional-tests/shared/data/aci/aci_startup.ldif
index 3224236..5621ef5 100644
--- a/opends/tests/functional-tests/shared/data/aci/aci_startup.ldif
+++ b/opends/tests/functional-tests/shared/data/aci/aci_startup.ldif
@@ -404,6 +404,24 @@
roomnumber: 4612
userpassword: sprain
+dn: uid=acarter\, and Sons, ou=People, ou=aci branch, o=ACI Tests, dc=example,dc=com
+cn: Abe Carter
+sn: Carter
+givenname: Abe
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Accounting
+ou: People
+l: Sunnyvale
+uid: acarter
+mail: acarter@example.com
+telephonenumber: +1 408 555 4798
+facsimiletelephonenumber: +1 408 555 9751
+roomnumber: 4612
+userpassword: sprain
+
dn: uid=tmorris, ou=People, ou=aci branch, o=ACI Tests, dc=example,dc=com
cn: Ted Morris
sn: Morris
diff --git a/opends/tests/functional-tests/shared/data/aci/aci_target/add_aci33.ldif b/opends/tests/functional-tests/shared/data/aci/aci_target/add_aci33.ldif
new file mode 100644
index 0000000..8748b57
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/aci/aci_target/add_aci33.ldif
@@ -0,0 +1,30 @@
+# 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
+#
+# Portions Copyright 2007 Sun Microsystems, Inc.
+#
+
+dn: ou=aci branch, o=ACI Tests, dc=example,dc=com
+changetype: modify
+add: aci
+aci: (target="ldap:///uid=*carter*, ou=People, ou=aci branch, o=ACI Tests, dc=example,dc=com")(targetattr="*")(version 3.0; acl "add_aci33"; allow (search,read) userdn="ldap:///all";)
+
diff --git a/opends/tests/functional-tests/shared/data/aci/aci_target/add_aci34.ldif b/opends/tests/functional-tests/shared/data/aci/aci_target/add_aci34.ldif
new file mode 100644
index 0000000..764cce4
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/aci/aci_target/add_aci34.ldif
@@ -0,0 +1,30 @@
+# 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
+#
+# Portions Copyright 2007 Sun Microsystems, Inc.
+#
+
+dn: ou=aci branch, o=ACI Tests, dc=example,dc=com
+changetype: modify
+add: aci
+aci: (target="ldap:///ou=aci branch, o=ACI Tests, dc=example,dc=com")(version 3.0; acl "add_aci34"; allow (search,read) userdn="ldap:///all";)
+
diff --git a/opends/tests/functional-tests/shared/data/aci/aci_targetattr/add_aci11.ldif b/opends/tests/functional-tests/shared/data/aci/aci_targetattr/add_aci11.ldif
new file mode 100644
index 0000000..9ea71d0
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/aci/aci_targetattr/add_aci11.ldif
@@ -0,0 +1,30 @@
+# 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
+#
+# Portions Copyright 2007 Sun Microsystems, Inc.
+#
+
+dn: ou=aci branch, o=ACI Tests, dc=example,dc=com
+changetype: modify
+add: aci
+aci: (target="ldap:///ou=aci branch, o=ACI Tests, dc=example,dc=com")(targetattr="cn*")(version 3.0; acl "add_aci11"; allow (search,read) userdn="ldap:///all";)
+
diff --git a/opends/tests/functional-tests/testcases/aci/aci_bindtypes.xml b/opends/tests/functional-tests/testcases/aci/aci_bindtypes.xml
index 5a880e8..3e7e170 100755
--- a/opends/tests/functional-tests/testcases/aci/aci_bindtypes.xml
+++ b/opends/tests/functional-tests/testcases/aci/aci_bindtypes.xml
@@ -1942,7 +1942,7 @@
#@TestPostamble none
#@TestResult Success if OpenDS returns 0
for all ldap operations, and
- and entry is returned only for step 1.
+ no entries are returned for any step.
-->
<testcase name="'ACI: Bind Types: groupdn equals one static group with wildcard'">
<sequence>
@@ -1992,20 +1992,10 @@
'testString' : 'dn: uid=scarter,ou=People,ou=aci branch,o=Bind Type Tests,o=ACI Tests' }
</call>
- <if expr="returnCode != '1'">
+ <if expr="returnCode != '0'">
<tcstatus result="'fail'"/>
</if>
-<!-- The rest of the test case should be uncommented when Issue 1582 is resolved.
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'cn:' }
- </call>
-
- <if expr="returnCode != '1'">
- <tcstatus result="'fail'"/>
- </if>
-
<message>
'ACI: Bind Types: groupdn equals one static group with wildcard, user searching in non-targeted branch'
</message>
@@ -2086,7 +2076,7 @@
<if expr="returnCode != '0'">
<tcstatus result="'fail'"/>
</if>
--->
+
<message>
'ACI: Bind Types: groupdn equals one static group with wildcard, admin deleting aci'
</message>
@@ -5158,6 +5148,165 @@
</sequence>
</testcase>
+<!-- UserDN tests -->
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Bind Type Tests
+ #@TestName userdn with filter
+ #@TestIssue 454
+ #@TestPurpose Test behavior with userdn and filter
+ #@TestPreamble Admin adds an aci to the dn of one existing branch.
+ #@TestStep Client searches entry in the targeted branch dn as a group member.
+ #@TestStep Client searches entry in a non-targeted branch dn as a group member.
+ #@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 entry is returned only for step 1.
+ -->
+ <testcase name="'ACI: Bind Types: groupdn equals userdn with filter'">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <script>
+ curr_aci_ldif_file = 'add_userdn_aci1.ldif'
+ curr_aci=retrieve_aci('%s/aci/aci_bindtypes/%s' % (LOCAL_DATA_DIR,curr_aci_ldif_file));
+ </script>
+
+ <message>
+ 'ACI: Bind Types: userdn with filter, 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_bindtypes/%s' % (STAGED_DATA_DIR,curr_aci_ldif_file) }
+ </call>
+
+ <if expr="RC != 0">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <message>
+ 'ACI: Bind Types: userdn with filter, user searching targeted entry with group member'
+ </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=Bind Type Tests,o=ACI Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'roomnumber=4135' ,
+ 'extraParams' : '-T'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=dmiller,ou=People,ou=aci branch,o=Bind Type Tests,o=ACI Tests' }
+ </call>
+
+ <if expr="returnCode != '1'">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Bind Type Tests,o=ACI Tests' }
+ </call>
+
+ <if expr="returnCode != '1'">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=dmillertwo,uid=dmillerone,uid=dmiller,ou=People,ou=aci branch,o=Bind Type Tests,o=ACI Tests' }
+ </call>
+
+ <if expr="returnCode != '1'">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <message>
+ 'ACI: Bind Types: userdn with filter, user searching in non-targeted branch with group member'
+ </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=non-aci branch,o=Bind Type Tests,o=ACI Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'roomnumber=4135' ,
+ 'extraParams' : '-T'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=dmiller,ou=People,ou=non-aci branch,o=Bind Type Tests,o=ACI Tests' }
+ </call>
+
+ <if expr="returnCode != '0'">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <message>
+ 'ACI: Bind Types: userdn with filter, 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_bindtypes/del_aci.ldif' % STAGED_DATA_DIR }
+ </call>
+
+ <if expr="RC != 0">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <message>
+ 'ACI: Bind Types: userdn with filter, 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=Bind Type Tests,o=ACI Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'roomnumber=4135' ,
+ 'extraParams' : '-T'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestStringNotPresent'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=dmiller,ou=People,ou=aci branch,o=Bind Type 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.
diff --git a/opends/tests/functional-tests/testcases/aci/aci_target.xml b/opends/tests/functional-tests/testcases/aci/aci_target.xml
index 573b601..9b4c237 100755
--- a/opends/tests/functional-tests/testcases/aci/aci_target.xml
+++ b/opends/tests/functional-tests/testcases/aci/aci_target.xml
@@ -3150,6 +3150,309 @@
</sequence>
</testcase>
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Target Tests
+ #@TestName Target equals dn with comma
+ #@TestIssue 434
+ #@TestPurpose Test with the target set equal to a dn with comma
+ #@TestPreamble Admin adds an aci with the target equal to the dn of one existing branch.
+ #@TestStep Client searches entry with the targeted branch dn.
+ #@TestStep Client searches entry that is not with the targeted branch dn.
+ #@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 entry is returned only for step 1.
+ -->
+ <!-- cross reference to http://docs.sun.com/source/816-6698-10/aci.html -->
+ <!-- cross reference to DS6 docs -->
+ <testcase name="'ACI: Target: Target Equals DN with comma'">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <script>
+ curr_aci_ldif_file = 'add_aci33.ldif'
+ curr_aci=retrieve_aci('%s/aci/aci_target/%s' % (LOCAL_DATA_DIR,curr_aci_ldif_file));
+ </script>
+
+ <message>
+ 'ACI: Target: Target Equals DN with comma, 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_target/%s' % (STAGED_DATA_DIR,curr_aci_ldif_file) }
+ </call>
+
+ <if expr="RC != 0">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <message>
+ 'ACI: Target: Target Equals DN with comma, 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' : 'ou=People,ou=aci branch,o=ACI Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'uid=*carter*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,ou=aci branch,o=ACI Tests' }
+ </call>
+
+ <if expr="returnCode != '1'">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=acarter' }
+ </call>
+
+ <if expr="returnCode != '1'">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <message>
+ 'ACI: Target: Target Equals DN with comma, user searching non-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' : 'ou=People,ou=non-aci branch,o=ACI Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'uid=*carter*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,ou=aci branch,o=ACI Tests' }
+ </call>
+
+ <if expr="returnCode != '0'">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=acarter' }
+ </call>
+
+ <if expr="returnCode != '0'">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <message>
+ 'ACI: Target: Target Equals DN with comma, 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_target/del_aci.ldif' % STAGED_DATA_DIR }
+ </call>
+
+ <if expr="RC != 0">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <message>
+ 'ACI: Target: Target Equals DN with comma, 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=scarter,ou=People,ou=aci branch,o=ACI Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestStringNotPresent'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,ou=aci branch,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 Target Tests
+ #@TestName Target equals dn, default targetattr
+ #@TestIssue 434
+ #@TestPurpose Test with the target set equal to a dn, default targetattr
+ #@TestPreamble Admin adds an aci with the target equal to the dn of one existing branch.
+ #@TestStep Client searches entry with the targeted branch dn.
+ #@TestStep Client searches entry that is not with the targeted branch dn.
+ #@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
+ no entries returned for any search step.
+ -->
+ <!-- cross reference to http://docs.sun.com/source/816-6698-10/aci.html -->
+ <!-- cross reference to DS6 docs -->
+ <testcase name="'ACI: Target: Target Equals DN, default targetattr'">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <script>
+ curr_aci_ldif_file = 'add_aci34.ldif'
+ curr_aci=retrieve_aci('%s/aci/aci_target/%s' % (LOCAL_DATA_DIR,curr_aci_ldif_file));
+ </script>
+
+ <message>
+ 'ACI: Target: Target Equals DN, default targetattr, 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_target/%s' % (STAGED_DATA_DIR,curr_aci_ldif_file) }
+ </call>
+
+ <if expr="RC != 0">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <message>
+ 'ACI: Target: Target Equals DN, default targetattr, 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=scarter,ou=People,ou=aci branch,o=ACI Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,ou=aci branch,o=ACI Tests' }
+ </call>
+
+ <if expr="returnCode != '0'">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <message>
+ 'ACI: Target: Target Equals DN, default targetattr, user searching non-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=scarter,ou=People,ou=non-aci branch,o=ACI Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,ou=aci branch,o=ACI Tests' }
+ </call>
+
+ <if expr="returnCode != '0'">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <message>
+ 'ACI: Target: Target Equals DN, default targetattr, 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_target/del_aci.ldif' % STAGED_DATA_DIR }
+ </call>
+
+ <if expr="RC != 0">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <message>
+ 'ACI: Target: Target Equals DN, default targetattr, 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=scarter,ou=People,ou=aci branch,o=ACI Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestStringNotPresent'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,ou=aci branch,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.
diff --git a/opends/tests/functional-tests/testcases/aci/aci_targetattr.xml b/opends/tests/functional-tests/testcases/aci/aci_targetattr.xml
index 1fba883..cf084b4 100755
--- a/opends/tests/functional-tests/testcases/aci/aci_targetattr.xml
+++ b/opends/tests/functional-tests/testcases/aci/aci_targetattr.xml
@@ -1480,6 +1480,51 @@
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker ACI Targetattr Tests
+ #@TestName Targetattr equals one attribute with wildcard
+ #@TestIssue 435
+ #@TestPurpose Test with the targetattr set equal to a specific attribute with wildcard
+ #@TestPreamble Admin adds an aci to one branch with the targetattr equal to a specific attribute.
+ #@TestStep Client searches entry with the targeted dn for the targetattr.
+ #@TestStep Client searches entry that does not have the targeted dn for the targetattr.
+ #@TestStep Remove aci.
+ #@TestStep Client searches entry with the previously targeted dn for the targetattr.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 21.
+ -->
+ <testcase name="'ACI: Targetattr: Targetattr Equals One Attribute with wildcard'">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <script>
+ curr_aci_ldif_file = 'add_aci11.ldif'
+ curr_aci=retrieve_aci('%s/aci/aci_targetattr/%s' % (LOCAL_DATA_DIR,curr_aci_ldif_file));
+ </script>
+
+ <message>
+ 'ACI: Targetattr: Targetattr Equals One Attribute with 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_targetattr/%s' % (STAGED_DATA_DIR,curr_aci_ldif_file) }
+ </call>
+
+ <if expr="RC != 21">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <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 Targetattr Tests
#@TestName Postamble
#@TestIssue 435
#@TestPurpose Test default aci settings
--
Gitblit v1.10.0