From d432388527d40c9bc075be7564a5259fa4cb41e4 Mon Sep 17 00:00:00 2001
From: el_kaboing <el_kaboing@localhost>
Date: Thu, 16 Nov 2006 17:17:15 +0000
Subject: [PATCH] Adding functional test cases for Issue 427.
---
opendj-sdk/opends/tests/functional-tests/testcases/security/security.xml | 4
opendj-sdk/opends/tests/functional-tests/testcases/security/bind_no_pwd/security_pwd_null.xml | 244 +++++++++++++++++
opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/bhall.pwd | 2
opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/bind_no_pwd_startup.ldif | 347 ++++++++++++++++++++++++
opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/enable_bind_no_pwd.ldif | 5
opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/null.pwd | 2
opendj-sdk/opends/tests/functional-tests/testcases/security/bind_no_pwd/security_setup_bind_no_pwd.xml | 65 ++++
opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/disable_bind_no_pwd.ldif | 5
opendj-sdk/opends/tests/functional-tests/testcases/security/bind_no_pwd/security_bind_no_pwd.xml | 113 ++++++++
9 files changed, 787 insertions(+), 0 deletions(-)
diff --git a/opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/bhall.pwd b/opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/bhall.pwd
new file mode 100644
index 0000000..1be7397
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/bhall.pwd
@@ -0,0 +1,2 @@
+oranges
+
diff --git a/opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/bind_no_pwd_startup.ldif b/opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/bind_no_pwd_startup.ldif
new file mode 100644
index 0000000..2c6db13
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/bind_no_pwd_startup.ldif
@@ -0,0 +1,347 @@
+# 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 2006 Sun Microsystems, Inc.
+#
+
+dn: o=Bind No Pwd Tests, dc=example,dc=com
+o: Bind No Pwd Tests
+objectclass: top
+objectclass: organization
+
+dn: ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+ou: password tests
+objectclass: top
+objectclass: organizationalunit
+
+dn: ou=Groups, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+objectclass: top
+objectclass: organizationalunit
+ou: Groups
+
+dn: cn=Directory Administrators, ou=Groups, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+cn: Directory Administrators
+objectclass: top
+objectclass: groupofuniquenames
+ou: Groups
+uniquemember: uid=kvaughan, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+uniquemember: uid=rdaugherty, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+uniquemember: uid=hmiller, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+
+dn: ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+objectclass: top
+objectclass: organizationalunit
+ou: People
+
+dn: ou=Special Users,ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+objectclass: top
+objectclass: organizationalUnit
+ou: Special Users
+description: Special Administrative Accounts
+
+dn: uid=scarter, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+cn: Sam Carter
+sn: Carter
+givenname: Sam
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Accounting
+ou: People
+l: Sunnyvale
+uid: scarter
+mail: scarter@example.com
+telephonenumber: +1 408 555 4798
+facsimiletelephonenumber: +1 408 555 9751
+roomnumber: 4612
+userpassword: sprain
+
+dn: uid=tmorris, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+cn: Ted Morris
+sn: Morris
+givenname: Ted
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Accounting
+ou: People
+l: Santa Clara
+uid: tmorris
+mail: tmorris@example.com
+telephonenumber: +1 408 555 9187
+facsimiletelephonenumber: +1 408 555 8473
+roomnumber: 4117
+userpassword: irrefutable
+
+dn: uid=kvaughan, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+cn: Kirsten Vaughan
+sn: Vaughan
+givenname: Kirsten
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Human Resources
+ou: People
+l: Sunnyvale
+uid: kvaughan
+mail: kvaughan@example.com
+telephonenumber: +1 408 555 5625
+facsimiletelephonenumber: +1 408 555 3372
+roomnumber: 2871
+userpassword: bribery
+
+dn: uid=abergin, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+cn: Andy Bergin
+sn: Bergin
+givenname: Andy
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Product Testing
+ou: People
+l: Cupertino
+uid: abergin
+mail: abergin@example.com
+telephonenumber: +1 408 555 8585
+facsimiletelephonenumber: +1 408 555 7472
+roomnumber: 3472
+userpassword: inflict
+
+dn: uid=dmiller, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+cn: David Miller
+sn: Miller
+givenname: David
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Accounting
+ou: People
+l: Sunnyvale
+uid: dmiller
+mail: dmiller@example.com
+telephonenumber: +1 408 555 9423
+facsimiletelephonenumber: +1 408 555 0111
+roomnumber: 4135
+userpassword: gosling
+
+dn: uid=gfarmer, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+cn: Gern Farmer
+sn: Farmer
+givenname: Gern
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Accounting
+ou: People
+l: Cupertino
+uid: gfarmer
+mail: gfarmer@example.com
+telephonenumber: +1 408 555 6201
+facsimiletelephonenumber: +1 408 555 8473
+roomnumber: 1269
+userpassword: ruling
+
+dn: uid=kwinters, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+cn: Kelly Winters
+sn: Winters
+givenname: Kelly
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Product Development
+ou: People
+l: Santa Clara
+uid: kwinters
+mail: kwinters@example.com
+telephonenumber: +1 408 555 9069
+facsimiletelephonenumber: +1 408 555 1992
+roomnumber: 4178
+userpassword: forsook
+
+dn: uid=trigden, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+cn: Torrey Rigden
+sn: Rigden
+givenname: Torrey
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Product Development
+ou: People
+l: Santa Clara
+uid: trigden
+mail: trigden@example.com
+telephonenumber: +1 408 555 9280
+facsimiletelephonenumber: +1 408 555 8473
+roomnumber: 3584
+userpassword: sensitive
+
+dn: uid=cschmith, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+cn: Chris Schmith
+sn: Schmith
+givenname: Chris
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Human Resources
+ou: People
+l: Santa Clara
+uid: cschmith
+mail: cschmith@example.com
+telephonenumber: +1 408 555 8011
+facsimiletelephonenumber: +1 408 555 4774
+roomnumber: 0416
+userpassword: hypotenuse
+
+dn: uid=jwallace, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+cn: Judy Wallace
+sn: Wallace
+givenname: Judy
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Accounting
+ou: People
+l: Sunnyvale
+uid: jwallace
+mail: jwallace@example.com
+telephonenumber: +1 408 555 0319
+facsimiletelephonenumber: +1 408 555 8473
+roomnumber: 1033
+userpassword: linear
+
+dn: uid=jwalker, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+cn: John Walker
+sn: Walker
+givenname: John
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Product Testing
+ou: People
+l: Cupertino
+uid: jwalker
+mail: jwalker@example.com
+telephonenumber: +1 408 555 1476
+facsimiletelephonenumber: +1 408 555 1992
+roomnumber: 3915
+userpassword: dogleg
+
+dn: uid=tclow, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+cn: Torrey Clow
+sn: Clow
+givenname: Torrey
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Human Resources
+ou: People
+l: Santa Clara
+uid: tclow
+mail: tclow@example.com
+telephonenumber: +1 408 555 8825
+facsimiletelephonenumber: +1 408 555 1992
+roomnumber: 4376
+userpassword: cardreader
+
+dn: uid=rdaugherty, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+cn: Robert Daugherty
+sn: Daugherty
+givenname: Robert
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Human Resources
+ou: People
+l: Sunnyvale
+uid: rdaugherty
+mail: rdaugherty@example.com
+telephonenumber: +1 408 555 1296
+facsimiletelephonenumber: +1 408 555 1992
+roomnumber: 0194
+userpassword: apples
+
+dn: uid=jreuter, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+cn: Jayne Reuter
+sn: Reuter
+givenname: Jayne
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Product Testing
+ou: People
+l: Cupertino
+uid: jreuter
+mail: jreuter@example.com
+telephonenumber: +1 408 555 1122
+facsimiletelephonenumber: +1 408 555 8721
+roomnumber: 2942
+userpassword: destroy
+
+dn: uid=tmason, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+cn: Torrey Mason
+sn: Mason
+givenname: Torrey
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Human Resources
+ou: People
+l: Sunnyvale
+uid: tmason
+mail: tmason@example.com
+telephonenumber: +1 408 555 1596
+facsimiletelephonenumber: +1 408 555 9751
+roomnumber: 1124
+
+dn: uid=bhall, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com
+cn: Benjamin Hall
+sn: Hall
+givenname: Benjamin
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Product Development
+ou: People
+l: Santa Clara
+uid: bhall
+mail: bhall@example.com
+telephonenumber: +1 408 555 6067
+facsimiletelephonenumber: +1 408 555 0111
+roomnumber: 2511
+userpassword: oranges
+
diff --git a/opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/disable_bind_no_pwd.ldif b/opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/disable_bind_no_pwd.ldif
new file mode 100644
index 0000000..d5ddc5d
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/disable_bind_no_pwd.ldif
@@ -0,0 +1,5 @@
+dn: cn=config
+changetype: modify
+replace: ds-cfg-bind-with-dn-requires-password
+ds-cfg-bind-with-dn-requires-password: true
+
diff --git a/opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/enable_bind_no_pwd.ldif b/opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/enable_bind_no_pwd.ldif
new file mode 100644
index 0000000..bf7f42a
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/enable_bind_no_pwd.ldif
@@ -0,0 +1,5 @@
+dn: cn=config
+changetype: modify
+replace: ds-cfg-bind-with-dn-requires-password
+ds-cfg-bind-with-dn-requires-password: false
+
diff --git a/opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/null.pwd b/opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/null.pwd
new file mode 100644
index 0000000..139597f
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/shared/data/security/bind_no_pwd/null.pwd
@@ -0,0 +1,2 @@
+
+
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/security/bind_no_pwd/security_bind_no_pwd.xml b/opendj-sdk/opends/tests/functional-tests/testcases/security/bind_no_pwd/security_bind_no_pwd.xml
new file mode 100755
index 0000000..cf1760d
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/security/bind_no_pwd/security_bind_no_pwd.xml
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE stax SYSTEM "stax.dtd">
+<!---
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License"). You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
+ * add the following below this CDDL HEADER, with the fields enclosed
+ * by brackets "[]" replaced with your own identifying * information:
+ * Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ *
+ *
+ * Portions Copyright 2006 Sun Microsystems, Inc.
+ -->
+<stax>
+
+ <defaultcall function="security_bind_no_pwd"/>
+
+ <function name="security_bind_no_pwd">
+
+ <sequence>
+
+<parallel>
+ <block name="'Block DS Process Active'">
+
+ <!--- Test Case : Start DS -->
+ <testcase name="'StartDS'">
+ <sequence>
+ <message>
+ 'Start DS to run on port %s' % (DIRECTORY_INSTANCE_PORT)
+ </message>
+
+ <!--- Start DS -->
+ <call function="'startDS'">
+ { 'dsbinpath' : '%s' % (OPENDS_BINPATH) }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- End Block DS Process Active -->
+ </block>
+
+ <block name="'Block Clients'">
+
+ <sequence>
+
+ <!--- Check that DS started -->
+ <call function="'isAlive'">
+ { 'noOfLoops' : 5 ,
+ 'noOfMilliSeconds' : 2000 }
+ </call>
+
+ <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
+ file="'%s/testcases/security/bind_no_pwd/security_setup_bind_no_pwd.xml' % (TESTS_DIR)"/>
+ <call function="'setup_bind_no_pwd'" />
+
+ <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
+ file="'%s/testcases/security/bind_no_pwd/security_pwd_null.xml' % (TESTS_DIR)"/>
+ <call function="'pwd_null'" />
+
+ <!--- Test Case : Stop DS -->
+ <testcase name="'StopDS'">
+ <sequence>
+ <message>
+ 'Stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
+ </message>
+
+ <call function="'stopDS'">
+ { 'dsInstancePort' : '%s' % (DIRECTORY_INSTANCE_PORT) }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+ </sequence>
+ </testcase>
+
+ <return>RC</return>
+
+ </sequence>
+
+ <!--- End Block Clients -->
+ </block>
+
+</parallel>
+
+ </sequence>
+
+ </function>
+
+</stax>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/security/bind_no_pwd/security_pwd_null.xml b/opendj-sdk/opends/tests/functional-tests/testcases/security/bind_no_pwd/security_pwd_null.xml
new file mode 100755
index 0000000..7b20eb8
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/security/bind_no_pwd/security_pwd_null.xml
@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE stax SYSTEM "stax.dtd">
+<!---
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License"). You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
+ * add the following below this CDDL HEADER, with the fields enclosed
+ * by brackets "[]" replaced with your own identifying * information:
+ * Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ *
+ *
+ * Portions Copyright 2006 Sun Microsystems, Inc.
+ -->
+<stax>
+
+ <defaultcall function="pwd_null"/>
+
+ <function name="pwd_null">
+
+ <sequence>
+
+ <!--- Test Case : Default - Search Entry With Pwd -->
+ <testcase name="'Security: Bind No Pwd: Default - Search Entry With Pwd'">
+ <sequence>
+ <message>
+ 'Security: Bind No Pwd: Default - Search Entry With Pwd'
+ </message>
+
+ <call function="'SearchObjectNoPwd'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=bhall, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com' ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'extraParams' : '-s base -j %s/security/bind_no_pwd/bhall.pwd' % STAGED_DATA_DIR }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case : Default - Search Entry With No Pwd -->
+ <testcase name="'Security: Bind No Pwd: Default - Search Entry With No Pwd'">
+ <sequence>
+ <message>
+ 'Security: Bind No Pwd: Default - Search Entry With No Pwd'
+ </message>
+
+ <call function="'SearchObjectNoPwd'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=bhall, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com' ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'extraParams' : '-s base -j %s/security/bind_no_pwd/null.pwd' % STAGED_DATA_DIR }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult ,
+ 'expected' : 1 }
+ </call>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case : Enable Binds With No Password -->
+ <testcase name="'Security: Bind No Pwd: Enable'">
+ <sequence>
+ <message>
+ 'Security: Bind No Pwd: Enable Binds With No Password'
+ </message>
+
+ <call function="'modifyEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'entryToBeModified' : '%s/security/bind_no_pwd/enable_bind_no_pwd.ldif' % STAGED_DATA_DIR }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case : Enabled - Search Entry With Pwd -->
+ <testcase name="'Security: Bind No Pwd: Enabled - Search Entry With Pwd'">
+ <sequence>
+ <message>
+ 'Security: Bind No Pwd: Enabled - Search Entry With Pwd'
+ </message>
+
+ <call function="'SearchObjectNoPwd'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=bhall, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com' ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'extraParams' : '-s base -j %s/security/bind_no_pwd/bhall.pwd' % STAGED_DATA_DIR }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case : Enabled - Search Entry With No Pwd -->
+ <testcase name="'Security: Bind No Pwd: Enabled - Search Entry With No Pwd'">
+ <sequence>
+ <message>
+ 'Security: Bind No Pwd: Enabled - Search Entry With No Pwd'
+ </message>
+
+ <call function="'SearchObjectNoPwd'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=bhall, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com' ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'extraParams' : '-s base -j %s/security/bind_no_pwd/null.pwd' % STAGED_DATA_DIR }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case : Enabled - Search As User With No Pwd -->
+ <testcase name="'Security: Bind No Pwd: Enabled - Search As User With No Pwd'">
+ <sequence>
+ <message>
+ 'Security: Bind No Pwd: Enabled - Search As User With No Pwd'
+ </message>
+
+ <call function="'SearchObjectNoPwd'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=tmason, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com' ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'extraParams' : '-s base -j %s/security/bind_no_pwd/null.pwd' % STAGED_DATA_DIR }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case : Enabled - Search As Non-exist User -->
+ <testcase name="'Security: Bind No Pwd: Enabled - Search As Non-exist User'">
+ <sequence>
+ <message>
+ 'Security: Bind No Pwd: Enabled - Search As Non-exist User'
+ </message>
+
+ <call function="'SearchObjectNoPwd'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=Anybody, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com' ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'extraParams' : '-s base -j %s/security/bind_no_pwd/null.pwd' % STAGED_DATA_DIR }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case : Reset Configuration -->
+ <testcase name="'Security: Bind No Pwd: Postamble Reset'">
+ <sequence>
+ <message>
+ 'Security: Bind No Pwd: Reset - Step 1. Reset Configuration'
+ </message>
+
+ <call function="'modifyEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'entryToBeModified' : '%s/security/bind_no_pwd/disable_bind_no_pwd.ldif' % STAGED_DATA_DIR }
+ </call>
+
+ <if expr="RC != 0">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <message>
+ 'Security: Bind No Pwd: Reset - Step 2. Check Reset'
+ </message>
+
+ <call function="'SearchObjectNoPwd'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=bhall, ou=People, ou=password tests, o=Bind No Pwd Tests, dc=example,dc=com' ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'extraParams' : '-s base -j %s/security/bind_no_pwd/null.pwd' % STAGED_DATA_DIR }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult ,
+ 'expected' : 1 }
+ </call>
+ </sequence>
+ </testcase>
+
+ <return>RC</return>
+
+ </sequence>
+
+ </function>
+
+</stax>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/security/bind_no_pwd/security_setup_bind_no_pwd.xml b/opendj-sdk/opends/tests/functional-tests/testcases/security/bind_no_pwd/security_setup_bind_no_pwd.xml
new file mode 100755
index 0000000..222c74d
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/security/bind_no_pwd/security_setup_bind_no_pwd.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE stax SYSTEM "stax.dtd">
+<!---
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License"). You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
+ * add the following below this CDDL HEADER, with the fields enclosed
+ * by brackets "[]" replaced with your own identifying * information:
+ * Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ *
+ *
+ * Portions Copyright 2006 Sun Microsystems, Inc.
+ -->
+<stax>
+
+ <defaultcall function="setup_bind_no_pwd"/>
+
+ <function name="setup_bind_no_pwd">
+
+ <sequence>
+
+ <!--- Test Case : Add Entries for Bind No Pwd Tests -->
+ <testcase name="'Security: Bind No Pwd: Add Initial Entries'">
+ <sequence>
+ <message>
+ 'Security: Bind No Pwd: Adding Initial Entries'
+ </message>
+
+ <call function="'addEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'entryToBeAdded' : '%s/security/bind_no_pwd/bind_no_pwd_startup.ldif' % STAGED_DATA_DIR }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+ </sequence>
+ </testcase>
+
+ <return>RC</return>
+
+ </sequence>
+
+ </function>
+
+</stax>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/security/security.xml b/opendj-sdk/opends/tests/functional-tests/testcases/security/security.xml
index 4ee820c..4a7fca6 100755
--- a/opendj-sdk/opends/tests/functional-tests/testcases/security/security.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/security/security.xml
@@ -54,6 +54,10 @@
file="'%s/testcases/security/pwd_validator/security_pwd_validator.xml' % (TESTS_DIR)"/>
<call function="'security_pwd_validator'" />
+ <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
+ file="'%s/testcases/security/bind_no_pwd/security_bind_no_pwd.xml' % (TESTS_DIR)"/>
+ <call function="'security_bind_no_pwd'" />
+
</sequence>
</function>
--
Gitblit v1.10.0