From 3e41beab87e8fbb48ba422254d2211df13da010d Mon Sep 17 00:00:00 2001
From: mkeyes <mkeyes@localhost>
Date: Tue, 01 May 2007 21:15:13 +0000
Subject: [PATCH] Adding some userdn ACI test cases for Issue 453.

---
 opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_compare_tests/add_aci2.3.ldif |   30 ++
 opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_compare_tests/add_aci2.2.ldif |   30 ++
 opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_compare_tests/add_aci2.1.ldif |   30 ++
 opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_compare_tests.xml               |  584 ++++++++++++++++++++++++++++++++++++++++++++++++
 opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_compare_tests/add_aci2.4.ldif |   30 ++
 5 files changed, 704 insertions(+), 0 deletions(-)

diff --git a/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_compare_tests/add_aci2.1.ldif b/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_compare_tests/add_aci2.1.ldif
new file mode 100644
index 0000000..32a8491
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_compare_tests/add_aci2.1.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: (targetattr="*")(version 3.0; acl "add_aci2.1"; allow (compare) userdn="ldap:///ou=People, o=ACI Tests, dc=example,dc=com";)
+
diff --git a/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_compare_tests/add_aci2.2.ldif b/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_compare_tests/add_aci2.2.ldif
new file mode 100644
index 0000000..efa0a86
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_compare_tests/add_aci2.2.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: (targetattr="*")(version 3.0; acl "add_aci2.2"; allow (compare) userdn!="ldap:///ou=People, o=ACI Tests, dc=example,dc=com";)
+
diff --git a/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_compare_tests/add_aci2.3.ldif b/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_compare_tests/add_aci2.3.ldif
new file mode 100644
index 0000000..677e437
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_compare_tests/add_aci2.3.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: (targetattr="*")(version 3.0; acl "add_aci2.3"; allow (compare) userdn="ldap:///uid=auser,ou=People, o=ACI Tests, dc=example,dc=com || ldap:///uid=buser, ou=People, o=ACI Tests, dc=example,dc=com";)
+
diff --git a/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_compare_tests/add_aci2.4.ldif b/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_compare_tests/add_aci2.4.ldif
new file mode 100644
index 0000000..91c5069
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_compare_tests/add_aci2.4.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: (targetattr="*")(version 3.0; acl "add_aci2.4"; allow (compare) userdn!="ldap:///uid=auser,ou=People, o=ACI Tests, dc=example,dc=com || ldap:///uid=buser, ou=People, o=ACI Tests, dc=example,dc=com";)
+
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_compare_tests.xml b/opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_compare_tests.xml
index 384c25f..1319c57 100644
--- a/opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_compare_tests.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_compare_tests.xml
@@ -366,6 +366,590 @@
               </sequence>
             </testcase>
 
+          <!---
+                Place test-specific test information here.
+                The tag, TestMarker, must be the same as the tag, TestSuiteName.
+                #@TestMarker                ACI Compare Tests
+                #@TestName                  Compare Attr - userdn equals a branch dn
+                #@TestIssue                 441
+                #@TestPurpose               Compare an attribute in an entry against an ACI where userdn equals a branch dn
+                #@TestPreamble              Admin adds an aci to the dn of one existing branch.
+                #@TestStep                  Client compares an attribute in an entry in the targeted branch.
+                #@TestStep                  Client compares an attribute in an entry in the targeted branch with another user.
+                #@TestStep                  Client compares an attribute in an entry that is not in the targeted branch.
+                #@TestStep                  Remove aci.
+                #@TestStep                  Client compares an attribute in an entry in the previously targeted branch.
+                #@TestPostamble             none
+                #@TestResult                Success if OpenDS returns 0
+                                            for ACI add and delete operations, and 
+                                            50 for all other steps.
+            -->
+            <!-- cross reference to http://docs.sun.com/source/816-6698-10/aci.html -->
+            <!-- cross reference to DS6 docs -->
+            <testcase name="'ACI: Compare: Compare Attr - userdn equals a branch dn'">
+              <sequence>
+                <call function="'testCase_Preamble'"/>
+                          
+                <script>
+                    curr_aci_ldif_file = 'add_aci2.1.ldif'
+                    curr_aci=retrieve_aci('%s/aci/aci_compare_tests/%s' % (LOCAL_DATA_DIR,curr_aci_ldif_file));
+                </script>
+        
+                <message>
+                   'ACI: Compare: Compare Attr - userdn equals a branch dn, 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_compare_tests/%s' % (STAGED_DATA_DIR,curr_aci_ldif_file) }
+                </call>
+    
+                <if expr="RC != 0">
+                    <tcstatus result="'fail'"/>
+                </if>
+    
+                <message>
+                 'ACI: Compare: Compare Attr - userdn equals a branch dn, user comparing attribute in targeted branch'
+                </message>
+  
+                <call function="'compareEntry'">
+                { 'dsInstanceHost'          : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'        : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'          : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+                    'dsInstancePswd'        : 'ACIRules' ,
+                    'attrToBeCompared'      : 'l:Santa Clara',
+                    'entryToBeCompared'     : 'uid=tclow, ou=People, ou=aci branch, o=ACI Tests, dc=example,dc=com' }
+                </call>
+
+                <if expr="RC != 50">
+                    <tcstatus result="'fail'"/>
+                </if>
+
+                <message>
+                 'ACI: Compare: Compare Attr - userdn equals a branch dn, user comparing attribute in targeted branch'
+                </message>
+  
+                <call function="'compareEntry'">
+                { 'dsInstanceHost'          : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'        : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'          : 'uid=buser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+                    'dsInstancePswd'        : 'ACIRules' ,
+                    'attrToBeCompared'      : 'l:Santa Clara',
+                    'entryToBeCompared'     : 'uid=tclow, ou=People, ou=aci branch, o=ACI Tests, dc=example,dc=com' }
+                </call>
+
+                <if expr="RC != 50">
+                    <tcstatus result="'fail'"/>
+                </if>
+
+                <message>
+                 'ACI: Compare: Compare Attr - userdn equals a branch dn, user comparing attribute in non-targeted branch'
+                </message>
+  
+                <call function="'compareEntry'">
+                { 'dsInstanceHost'          : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'        : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'          : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+                    'dsInstancePswd'        : 'ACIRules' ,
+                    'attrToBeCompared'      : 'l:Santa Clara',
+                    'entryToBeCompared'     : 'uid=tclow, ou=People, ou=non-aci branch, o=ACI Tests, dc=example,dc=com' }
+                </call>
+
+                <if expr="RC != 50">
+                    <tcstatus result="'fail'"/>
+                </if>
+
+                <message>
+                   'ACI: Compare: Compare Attr - userdn equals a branch dn, 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_compare_tests/del_aci.ldif' % STAGED_DATA_DIR }
+                </call>
+    
+                <if expr="RC != 0">
+                    <tcstatus result="'fail'"/>
+                </if>
+    
+                <message>
+                   'ACI: Compare: Compare Attr - userdn equals a branch dn, user comparing attribute in previously targeted branch'
+                </message>
+    
+                <call function="'compareEntry'">
+                { 'dsInstanceHost'          : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'        : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'          : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+                    'dsInstancePswd'        : 'ACIRules' ,
+                    'attrToBeCompared'      : 'l:Cupertino',
+                    'entryToBeCompared'     : 'uid=jreuter, ou=People, ou=aci branch, o=ACI Tests, dc=example,dc=com' }
+                </call>
+
+                <call function="'checktestRC'">
+                    { 'returncode' : RC ,
+                      'result'     : STAXResult ,
+                      'expected'   : 50 }
+                </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 Compare Tests
+                #@TestName                  Compare Attr - userdn not equals a branch dn
+                #@TestIssue                 441
+                #@TestPurpose               Compare an attribute in an entry against an ACI where userdn equals a branch dn
+                #@TestPreamble              Admin adds an aci to the dn of one existing branch.
+                #@TestStep                  Client compares an attribute in an entry in the targeted branch.
+                #@TestStep                  Client compares an attribute in an entry in the targeted branch with another user.
+                #@TestStep                  Client compares an attribute in an entry that is not in the targeted branch.
+                #@TestStep                  Remove aci.
+                #@TestStep                  Client compares an attribute in an entry in the previously targeted branch.
+                #@TestPostamble             none
+                #@TestResult                Success if OpenDS returns 0
+                                            for ACI add and delete operations, 
+                                            0 for steps 1 and 2, and
+                                            50 for all other steps.
+                                            The return string for steps 1 and 2 is evaluated to contain the substring, true.
+            -->
+            <!-- cross reference to http://docs.sun.com/source/816-6698-10/aci.html -->
+            <!-- cross reference to DS6 docs -->
+            <testcase name="'ACI: Compare: Compare Attr - userdn not equals a branch dn'">
+              <sequence>
+                <call function="'testCase_Preamble'"/>
+                          
+                <script>
+                    curr_aci_ldif_file = 'add_aci2.2.ldif'
+                    curr_aci=retrieve_aci('%s/aci/aci_compare_tests/%s' % (LOCAL_DATA_DIR,curr_aci_ldif_file));
+                </script>
+        
+                <message>
+                   'ACI: Compare: Compare Attr - userdn not equals a branch dn, 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_compare_tests/%s' % (STAGED_DATA_DIR,curr_aci_ldif_file) }
+                </call>
+    
+                <if expr="RC != 0">
+                    <tcstatus result="'fail'"/>
+                </if>
+    
+                <message>
+                 'ACI: Compare: Compare Attr - userdn not equals a branch dn, user comparing attribute in targeted branch'
+                </message>
+  
+                <call function="'compareEntry'">
+                { 'dsInstanceHost'          : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'        : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'          : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+                    'dsInstancePswd'        : 'ACIRules' ,
+                    'attrToBeCompared'      : 'l:Santa Clara',
+                    'entryToBeCompared'     : 'uid=tclow, ou=People, ou=aci branch, o=ACI Tests, dc=example,dc=com' }
+                </call>
+
+                <script> 
+                 returnString = STAXResult[0][1]
+                </script> 
+    
+                <call function="'searchStringForSubstring'">
+                    { 'returnString'       : returnString ,
+                      'testString'         : 'true' }
+                </call>
+                
+                <if expr="returnCode != '1'">
+                    <tcstatus result="'fail'"/>
+                </if>
+    
+                <message>
+                 'ACI: Compare: Compare Attr - userdn not equals a branch dn, user comparing attribute in targeted branch'
+                </message>
+  
+                <call function="'compareEntry'">
+                { 'dsInstanceHost'          : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'        : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'          : 'uid=buser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+                    'dsInstancePswd'        : 'ACIRules' ,
+                    'attrToBeCompared'      : 'l:Santa Clara',
+                    'entryToBeCompared'     : 'uid=tclow, ou=People, ou=aci branch, o=ACI Tests, dc=example,dc=com' }
+                </call>
+
+                <script> 
+                 returnString = STAXResult[0][1]
+                </script> 
+    
+                <call function="'searchStringForSubstring'">
+                    { 'returnString'       : returnString ,
+                      'testString'         : 'true' }
+                </call>
+                
+                <if expr="returnCode != '1'">
+                    <tcstatus result="'fail'"/>
+                </if>
+    
+               <message>
+                 'ACI: Compare: Compare Attr - userdn not equals a branch dn, user comparing attribute in non-targeted branch'
+                </message>
+  
+                <call function="'compareEntry'">
+                { 'dsInstanceHost'          : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'        : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'          : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+                    'dsInstancePswd'        : 'ACIRules' ,
+                    'attrToBeCompared'      : 'l:Santa Clara',
+                    'entryToBeCompared'     : 'uid=tclow, ou=People, ou=non-aci branch, o=ACI Tests, dc=example,dc=com' }
+                </call>
+
+                <if expr="RC != 50">
+                    <tcstatus result="'fail'"/>
+                </if>
+
+                <message>
+                   'ACI: Compare: Compare Attr - userdn not equals a branch dn, 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_compare_tests/del_aci.ldif' % STAGED_DATA_DIR }
+                </call>
+    
+                <if expr="RC != 0">
+                    <tcstatus result="'fail'"/>
+                </if>
+    
+                <message>
+                   'ACI: Compare: Compare Attr - userdn not equals a branch dn, user comparing attribute in previously targeted branch'
+                </message>
+    
+                <call function="'compareEntry'">
+                { 'dsInstanceHost'          : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'        : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'          : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+                    'dsInstancePswd'        : 'ACIRules' ,
+                    'attrToBeCompared'      : 'l:Cupertino',
+                    'entryToBeCompared'     : 'uid=jreuter, ou=People, ou=aci branch, o=ACI Tests, dc=example,dc=com' }
+                </call>
+
+                <call function="'checktestRC'">
+                    { 'returncode' : RC ,
+                      'result'     : STAXResult ,
+                      'expected'   : 50 }
+                </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 Compare Tests
+                #@TestName                  Compare Attr - userdn equals two dns
+                #@TestIssue                 441
+                #@TestPurpose               Compare an attribute in an entry against an ACI where userdn equals two dns
+                #@TestPreamble              Admin adds an aci to the dn of one existing branch.
+                #@TestStep                  Client compares an attribute in an entry in the targeted branch.
+                #@TestStep                  Client compares an attribute in an entry in the targeted branch with another user.
+                #@TestStep                  Client compares an attribute in an entry that is not in the targeted branch.
+                #@TestStep                  Remove aci.
+                #@TestStep                  Client compares an attribute in an entry in the previously targeted branch.
+                #@TestPostamble             none
+                #@TestResult                Success if OpenDS returns 0
+                                            for ACI add and delete operations, 
+                                            0 for steps 1 and 2, and
+                                            50 for all other steps.
+                                            The return string for steps 1 and 2 is evaluated to contain the substring, true.
+            -->
+            <!-- cross reference to http://docs.sun.com/source/816-6698-10/aci.html -->
+            <!-- cross reference to DS6 docs -->
+            <testcase name="'ACI: Compare: Compare Attr - userdn equals two dns'">
+              <sequence>
+                <call function="'testCase_Preamble'"/>
+                          
+                <script>
+                    curr_aci_ldif_file = 'add_aci2.3.ldif'
+                    curr_aci=retrieve_aci('%s/aci/aci_compare_tests/%s' % (LOCAL_DATA_DIR,curr_aci_ldif_file));
+                </script>
+        
+                <message>
+                   'ACI: Compare: Compare Attr - userdn equals two dns, 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_compare_tests/%s' % (STAGED_DATA_DIR,curr_aci_ldif_file) }
+                </call>
+    
+                <if expr="RC != 0">
+                    <tcstatus result="'fail'"/>
+                </if>
+    
+                <message>
+                 'ACI: Compare: Compare Attr - userdn equals two dns, user comparing attribute in targeted branch'
+                </message>
+  
+                <call function="'compareEntry'">
+                { 'dsInstanceHost'          : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'        : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'          : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+                    'dsInstancePswd'        : 'ACIRules' ,
+                    'attrToBeCompared'      : 'l:Santa Clara',
+                    'entryToBeCompared'     : 'uid=tclow, ou=People, ou=aci branch, o=ACI Tests, dc=example,dc=com' }
+                </call>
+
+                <script> 
+                 returnString = STAXResult[0][1]
+                </script> 
+    
+                <call function="'searchStringForSubstring'">
+                    { 'returnString'       : returnString ,
+                      'testString'         : 'true' }
+                </call>
+                
+                <if expr="returnCode != '1'">
+                    <tcstatus result="'fail'"/>
+                </if>
+    
+                <message>
+                 'ACI: Compare: Compare Attr - userdn equals two dns, user comparing attribute in targeted branch'
+                </message>
+  
+                <call function="'compareEntry'">
+                { 'dsInstanceHost'          : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'        : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'          : 'uid=buser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+                    'dsInstancePswd'        : 'ACIRules' ,
+                    'attrToBeCompared'      : 'l:Santa Clara',
+                    'entryToBeCompared'     : 'uid=tclow, ou=People, ou=aci branch, o=ACI Tests, dc=example,dc=com' }
+                </call>
+
+                <script> 
+                 returnString = STAXResult[0][1]
+                </script> 
+    
+                <call function="'searchStringForSubstring'">
+                    { 'returnString'       : returnString ,
+                      'testString'         : 'true' }
+                </call>
+                
+                <if expr="returnCode != '1'">
+                    <tcstatus result="'fail'"/>
+                </if>
+    
+                <message>
+                 'ACI: Compare: Compare Attr - userdn equals two dns, user comparing attribute in non-targeted branch'
+                </message>
+  
+                <call function="'compareEntry'">
+                { 'dsInstanceHost'          : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'        : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'          : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+                    'dsInstancePswd'        : 'ACIRules' ,
+                    'attrToBeCompared'      : 'l:Santa Clara',
+                    'entryToBeCompared'     : 'uid=tclow, ou=People, ou=non-aci branch, o=ACI Tests, dc=example,dc=com' }
+                </call>
+
+                <if expr="RC != 50">
+                    <tcstatus result="'fail'"/>
+                </if>
+
+                <message>
+                   'ACI: Compare: Compare Attr - userdn equals two dns, 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_compare_tests/del_aci.ldif' % STAGED_DATA_DIR }
+                </call>
+    
+                <if expr="RC != 0">
+                    <tcstatus result="'fail'"/>
+                </if>
+    
+                <message>
+                   'ACI: Compare: Compare Attr - userdn equals two dns, user comparing attribute in previously targeted branch'
+                </message>
+    
+                <call function="'compareEntry'">
+                { 'dsInstanceHost'          : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'        : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'          : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+                    'dsInstancePswd'        : 'ACIRules' ,
+                    'attrToBeCompared'      : 'l:Cupertino',
+                    'entryToBeCompared'     : 'uid=jreuter, ou=People, ou=aci branch, o=ACI Tests, dc=example,dc=com' }
+                </call>
+
+                <call function="'checktestRC'">
+                    { 'returncode' : RC ,
+                      'result'     : STAXResult ,
+                      'expected'   : 50 }
+                </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 Compare Tests
+                #@TestName                  Compare Attr - userdn not equals two dns
+                #@TestIssue                 441
+                #@TestPurpose               Compare an attribute in an entry against an ACI where userdn equals a branch dn
+                #@TestPreamble              Admin adds an aci to the dn of one existing branch.
+                #@TestStep                  Client compares an attribute in an entry in the targeted branch.
+                #@TestStep                  Client compares an attribute in an entry in the targeted branch with another user.
+                #@TestStep                  Client compares an attribute in an entry that is not in the targeted branch.
+                #@TestStep                  Remove aci.
+                #@TestStep                  Client compares an attribute in an entry in the previously targeted branch.
+                #@TestPostamble             none
+                #@TestResult                Success if OpenDS returns 0
+                                            for ACI add and delete operations, and
+                                            50 for all other steps.
+            -->
+            <!-- cross reference to http://docs.sun.com/source/816-6698-10/aci.html -->
+            <!-- cross reference to DS6 docs -->
+            <testcase name="'ACI: Compare: Compare Attr - userdn not equals two dns'">
+              <sequence>
+                <call function="'testCase_Preamble'"/>
+                          
+                <script>
+                    curr_aci_ldif_file = 'add_aci2.4.ldif'
+                    curr_aci=retrieve_aci('%s/aci/aci_compare_tests/%s' % (LOCAL_DATA_DIR,curr_aci_ldif_file));
+                </script>
+        
+                <message>
+                   'ACI: Compare: Compare Attr - userdn not equals two dns, 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_compare_tests/%s' % (STAGED_DATA_DIR,curr_aci_ldif_file) }
+                </call>
+    
+                <if expr="RC != 0">
+                    <tcstatus result="'fail'"/>
+                </if>
+    
+                <message>
+                 'ACI: Compare: Compare Attr - userdn not equals two dns, user comparing attribute in targeted branch'
+                </message>
+  
+                <call function="'compareEntry'">
+                { 'dsInstanceHost'          : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'        : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'          : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+                    'dsInstancePswd'        : 'ACIRules' ,
+                    'attrToBeCompared'      : 'l:Santa Clara',
+                    'entryToBeCompared'     : 'uid=tclow, ou=People, ou=aci branch, o=ACI Tests, dc=example,dc=com' }
+                </call>
+
+                <if expr="RC != 50">
+                    <tcstatus result="'fail'"/>
+                </if>
+
+                <message>
+                 'ACI: Compare: Compare Attr - userdn not equals two dns, user comparing attribute in targeted branch'
+                </message>
+  
+                <call function="'compareEntry'">
+                { 'dsInstanceHost'          : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'        : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'          : 'uid=buser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+                    'dsInstancePswd'        : 'ACIRules' ,
+                    'attrToBeCompared'      : 'l:Santa Clara',
+                    'entryToBeCompared'     : 'uid=tclow, ou=People, ou=aci branch, o=ACI Tests, dc=example,dc=com' }
+                </call>
+
+                <if expr="RC != 50">
+                    <tcstatus result="'fail'"/>
+                </if>
+
+               <message>
+                 'ACI: Compare: Compare Attr - userdn not equals two dns, user comparing attribute in non-targeted branch'
+                </message>
+  
+                <call function="'compareEntry'">
+                { 'dsInstanceHost'          : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'        : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'          : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+                    'dsInstancePswd'        : 'ACIRules' ,
+                    'attrToBeCompared'      : 'l:Santa Clara',
+                    'entryToBeCompared'     : 'uid=tclow, ou=People, ou=non-aci branch, o=ACI Tests, dc=example,dc=com' }
+                </call>
+
+                <if expr="RC != 50">
+                    <tcstatus result="'fail'"/>
+                </if>
+
+                <message>
+                   'ACI: Compare: Compare Attr - userdn not equals two dns, 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_compare_tests/del_aci.ldif' % STAGED_DATA_DIR }
+                </call>
+    
+                <if expr="RC != 0">
+                    <tcstatus result="'fail'"/>
+                </if>
+    
+                <message>
+                   'ACI: Compare: Compare Attr - userdn not equals two dns, user comparing attribute in previously targeted branch'
+                </message>
+    
+                <call function="'compareEntry'">
+                { 'dsInstanceHost'          : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'        : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'          : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+                    'dsInstancePswd'        : 'ACIRules' ,
+                    'attrToBeCompared'      : 'l:Cupertino',
+                    'entryToBeCompared'     : 'uid=jreuter, ou=People, ou=aci branch, o=ACI Tests, dc=example,dc=com' }
+                </call>
+
+                <call function="'checktestRC'">
+                    { 'returncode' : RC ,
+                      'result'     : STAXResult ,
+                      'expected'   : 50 }
+                </call>
+                
+                <call function="'testCase_Postamble'"/>
+    
+              </sequence>
+            </testcase>
+
            <!---
                 Place test-specific test information here.
                 The tag, TestMarker, must be the same as the tag, TestSuiteName.

--
Gitblit v1.10.0