From 6f474c09104626cf14959824ea1ff842d9c9bd4a Mon Sep 17 00:00:00 2001
From: el_kaboing <el_kaboing@localhost>
Date: Sat, 24 Mar 2007 00:02:34 +0000
Subject: [PATCH] The new global ACIs that were recently committed are now accounted for in the ACI functional tests.

---
 opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_reset_global_search.ldif |   31 ++++++++++
 opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_target.xml                 |   39 ++++++++++++
 opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_targetattr.xml             |   39 ++++++++++++
 opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_targetfilter.xml           |   39 ++++++++++++
 opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_rm_global_search.ldif    |   31 ++++++++++
 5 files changed, 176 insertions(+), 3 deletions(-)

diff --git a/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_reset_global_search.ldif b/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_reset_global_search.ldif
new file mode 100644
index 0000000..ae5986f
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_reset_global_search.ldif
@@ -0,0 +1,31 @@
+# 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: cn=Access Control Handler,cn=config
+changetype: modify
+add: ds-cfg-global-aci
+ds-cfg-global-aci: (targetattr!="userPassword||authPassword")(version 3.0; acl "Anonymous read access"; allow (read,search,compare) userdn="ldap:///anyone";)
+
+
diff --git a/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_rm_global_search.ldif b/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_rm_global_search.ldif
new file mode 100644
index 0000000..7b98cf4
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/shared/data/aci/aci_rm_global_search.ldif
@@ -0,0 +1,31 @@
+# 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: cn=Access Control Handler,cn=config
+changetype: modify
+delete: ds-cfg-global-aci
+ds-cfg-global-aci: (targetattr!="userPassword||authPassword")(version 3.0; acl "Anonymous read access"; allow (read,search,compare) userdn="ldap:///anyone";)
+
+
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_target.xml b/opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_target.xml
index bbdb45f..b4b00b1 100755
--- a/opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_target.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_target.xml
@@ -72,6 +72,22 @@
               <sequence>
                 <call function="'testCase_Preamble'"/>
                 <message>
+                   'ACI: Target: Preamble - Removing Search Global 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_rm_global_search.ldif' % STAGED_DATA_DIR }
+                </call>
+    
+                <if expr="RC != 0">
+                    <tcstatus result="'fail'"/>
+                </if>
+    
+                <message>
                    'ACI: Target: Preamble - existing branch, user searching entry that will be targeted in future tests'
                 </message>
     
@@ -1486,11 +1502,32 @@
                returnString = STAXResult[0][1]
               </script> 
   
-              <call function="'checktestStringNotPresent'">
+              <call function="'searchStringForSubstring'">
                   { 'returnString'       : returnString ,
                     'testString'         : 'dn: uid=scarter,ou=People,ou=non-aci branch,o=ACI Tests' }
               </call>
               
+              <if expr="returnCode != '0'">
+                  <tcstatus result="'fail'"/>
+              </if>
+  
+                <message>
+                   'ACI: Target: Resetting Search Global 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_reset_global_search.ldif' % STAGED_DATA_DIR }
+                </call>
+    
+                <call function="'checktestRC'">
+                    { 'returncode' : RC ,
+                      'result'     : STAXResult }
+                </call>
+                
               <call function="'testCase_Postamble'"/>
   
             </sequence>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_targetattr.xml b/opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_targetattr.xml
index a047801..06c0795 100755
--- a/opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_targetattr.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_targetattr.xml
@@ -69,6 +69,22 @@
           <testcase name="'ACI: Targetattr: Preamble'">
             <sequence>
               <call function="'testCase_Preamble'"/>
+                <message>
+                   'ACI: Targetattr: Preamble - Removing Search Global 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_rm_global_search.ldif' % STAGED_DATA_DIR }
+                </call>
+    
+                <if expr="RC != 0">
+                    <tcstatus result="'fail'"/>
+                </if>
+    
               <message>
                  'ACI: Targetattr: Preamble - existing branch, user searching entry that will be targeted in future tests'
               </message>
@@ -1373,11 +1389,32 @@
                returnString = STAXResult[0][1]
               </script> 
   
-              <call function="'checktestStringNotPresent'">
+              <call function="'searchStringForSubstring'">
                   { 'returnString'       : returnString ,
                     'testString'         : 'dn: uid=tmorris,ou=People,ou=non-aci branch,o=ACI Tests' }
               </call>
               
+              <if expr="returnCode != '0'">
+                  <tcstatus result="'fail'"/>
+              </if>
+  
+                <message>
+                   'ACI: Targetattr: Postamble - Resetting Search Global 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_reset_global_search.ldif' % STAGED_DATA_DIR }
+                </call>
+    
+                <call function="'checktestRC'">
+                    { 'returncode' : RC ,
+                      'result'     : STAXResult }
+                </call>
+                
               <call function="'testCase_Postamble'"/>
   
             </sequence>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_targetfilter.xml b/opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_targetfilter.xml
index cde7676..dfcadc7 100755
--- a/opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_targetfilter.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/aci/aci_targetfilter.xml
@@ -70,6 +70,22 @@
               <sequence>
                 <call function="'testCase_Preamble'"/>
                 <message>
+                   'ACI: Targetfilter: Preamble - Removing Search Global 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_rm_global_search.ldif' % STAGED_DATA_DIR }
+                </call>
+    
+                <if expr="RC != 0">
+                    <tcstatus result="'fail'"/>
+                </if>
+    
+                <message>
                    'ACI: Targetfilter: Preamble - user searching entry that will be targeted in future tests'
                 </message>
     
@@ -3070,11 +3086,32 @@
                returnString = STAXResult[0][1]
               </script> 
   
-              <call function="'checktestStringNotPresent'">
+              <call function="'searchStringForSubstring'">
                   { 'returnString'       : returnString ,
                     'testString'         : 'dn: uid=dmiller,ou=People,ou=non-aci branch,o=ACI Tests' }
               </call>
               
+              <if expr="returnCode != '0'">
+                  <tcstatus result="'fail'"/>
+              </if>
+  
+              <message>
+                   'ACI: Targetfilter: Postamble - Resetting Search Global 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_reset_global_search.ldif' % STAGED_DATA_DIR }
+              </call>
+    
+              <call function="'checktestRC'">
+                    { 'returncode' : RC ,
+                      'result'     : STAXResult }
+              </call>
+                
               <call function="'testCase_Postamble'"/>
   
             </sequence>

--
Gitblit v1.10.0