From a32642866813f592618e506c895e07dc25faddbf Mon Sep 17 00:00:00 2001
From: mkeyes <mkeyes@localhost>
Date: Fri, 11 May 2007 21:18:31 +0000
Subject: [PATCH] Some syntax test cases for the functional tests for ACI bind types.
---
opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci2.ldif | 30 +++++
opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci3.ldif | 30 +++++
opends/tests/functional-tests/testcases/aci/aci_bindtypes.xml | 223 ++++++++++++++++++++++++++++++++++++
opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci4.ldif | 30 +++++
opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci1.ldif | 2
opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci5.ldif | 30 +++++
6 files changed, 342 insertions(+), 3 deletions(-)
diff --git a/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci1.ldif b/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci1.ldif
index dec7072..f7fe52b 100644
--- a/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci1.ldif
+++ b/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci1.ldif
@@ -26,5 +26,5 @@
dn: ou=aci branch, o=Bind Type Tests, o=ACI Tests, dc=example,dc=com
changetype: modify
add: aci
-aci: (targetattr="*")(version 3.0; acl "add_userattr_aci1"; allow (search,read) userattr="l#Austin || l#Grenoble";)
+aci: (targetattr="*")(version 3.0; acl "add_syntax_aci1"; allow (search,read) groupdn="ldap://cn=Marketing,ou=Groups, o=ACI Tests, dc=example,dc=com";)
diff --git a/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci2.ldif b/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci2.ldif
new file mode 100644
index 0000000..2a2f3c4
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci2.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="*")(version 3.0; acl "add_syntax_aci2"; allow (search,read) groupdn='ldap:///cn=Marketing,ou=Groups, o=ACI Tests, dc=example,dc=com';)
+
diff --git a/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci3.ldif b/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci3.ldif
new file mode 100644
index 0000000..e5ea4e7
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci3.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="*")(version 3.0; acl "add_syntax_aci3"; allow (search,read) groupdn="";)
+
diff --git a/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci4.ldif b/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci4.ldif
new file mode 100644
index 0000000..787953f
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci4.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="*")(version 3.0; acl "add_syntax_aci4"; allow (search,read) userdn="";)
+
diff --git a/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci5.ldif b/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci5.ldif
new file mode 100644
index 0000000..2e8159f
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/aci/aci_bindtypes/add_syntax_aci5.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="*")(version 3.0; acl "add_syntax_aci5"; allow (search,read) userattr="";)
+
diff --git a/opends/tests/functional-tests/testcases/aci/aci_bindtypes.xml b/opends/tests/functional-tests/testcases/aci/aci_bindtypes.xml
index b00d60c..1010dc7 100755
--- a/opends/tests/functional-tests/testcases/aci/aci_bindtypes.xml
+++ b/opends/tests/functional-tests/testcases/aci/aci_bindtypes.xml
@@ -4118,8 +4118,227 @@
</sequence>
</testcase>
-
-
+<!-- syntax tests -->
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Bind Type Tests
+ #@TestName syntax - groupdn with missing slash
+ #@TestIssue 455
+ #@TestPurpose Test behavior with groupdn with missing slash in the url
+ #@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.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 21.
+ -->
+ <testcase name="'ACI: Bind Types: groupdn with missing slash'">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <script>
+ curr_aci_ldif_file = 'add_syntax_aci1.ldif'
+ curr_aci=retrieve_aci('%s/aci/aci_bindtypes/%s' % (LOCAL_DATA_DIR,curr_aci_ldif_file));
+ </script>
+
+ <message>
+ 'ACI: Bind Types: groupdn with missing slash, 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>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult ,
+ 'expected' : 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 syntax - groupdn with single quotes
+ #@TestIssue 455
+ #@TestPurpose Test behavior with groupdn with single quotes
+ #@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.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 21.
+ -->
+ <testcase name="'ACI: Bind Types: groupdn with single quote'">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <script>
+ curr_aci_ldif_file = 'add_syntax_aci2.ldif'
+ curr_aci=retrieve_aci('%s/aci/aci_bindtypes/%s' % (LOCAL_DATA_DIR,curr_aci_ldif_file));
+ </script>
+
+ <message>
+ 'ACI: Bind Types: groupdn with single quote, 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>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult ,
+ 'expected' : 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 syntax - groupdn is null
+ #@TestIssue 454
+ #@TestPurpose Test behavior with groupdn equals null
+ #@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.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 21.
+ -->
+ <testcase name="'ACI: Bind Types: groupdn with null value'">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <script>
+ curr_aci_ldif_file = 'add_syntax_aci3.ldif'
+ curr_aci=retrieve_aci('%s/aci/aci_bindtypes/%s' % (LOCAL_DATA_DIR,curr_aci_ldif_file));
+ </script>
+
+ <message>
+ 'ACI: Bind Types: groupdn with null value, 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>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult ,
+ 'expected' : 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 syntax - userdn is null
+ #@TestIssue 453
+ #@TestPurpose Test behavior with userdn equals null
+ #@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.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 21.
+ -->
+ <testcase name="'ACI: Bind Types: userdn with null value'">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <script>
+ curr_aci_ldif_file = 'add_syntax_aci4.ldif'
+ curr_aci=retrieve_aci('%s/aci/aci_bindtypes/%s' % (LOCAL_DATA_DIR,curr_aci_ldif_file));
+ </script>
+
+ <message>
+ 'ACI: Bind Types: userdn with null value, 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>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult ,
+ 'expected' : 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 syntax - userattr is null
+ #@TestIssue 455
+ #@TestPurpose Test behavior with userattr equals null
+ #@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.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 21.
+ -->
+ <testcase name="'ACI: Bind Types: userattr with null value'">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <script>
+ curr_aci_ldif_file = 'add_syntax_aci5.ldif'
+ curr_aci=retrieve_aci('%s/aci/aci_bindtypes/%s' % (LOCAL_DATA_DIR,curr_aci_ldif_file));
+ </script>
+
+ <message>
+ 'ACI: Bind Types: userattr with null value, 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>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult ,
+ 'expected' : 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.
--
Gitblit v1.10.0