From eb4e14f0106f05aec8df5e4eb360cf50147eca92 Mon Sep 17 00:00:00 2001
From: el_kaboing <el_kaboing@localhost>
Date: Thu, 02 Nov 2006 16:14:25 +0000
Subject: [PATCH] Add functional tests for Issues 327.

---
 opends/tests/functional-tests/shared/data/security/pwd_policy/admin_reset_force_pwd_reset.ldif  |   29 ++
 opends/tests/functional-tests/shared/data/security/pwd_policy/admin_reset_force_pwd_add.ldif    |   29 ++
 opends/tests/functional-tests/testcases/security/pwd_policy/security_pwd_policy.xml             |    4 
 opends/tests/functional-tests/shared/data/security/pwd_policy/add_entry1.ldif                   |   43 +++
 opends/tests/functional-tests/shared/data/security/pwd_policy/admin_change_force_pwd_reset.ldif |   29 ++
 opends/tests/functional-tests/testcases/security/pwd_policy/security_force_pwd_change.xml       |  459 +++++++++++++++++++++++++++++++++++
 opends/tests/functional-tests/shared/data/security/pwd_policy/add_entry2.ldif                   |   43 +++
 opends/tests/functional-tests/shared/data/security/pwd_policy/user_change_pwd3.ldif             |   29 ++
 opends/tests/functional-tests/shared/data/security/pwd_policy/admin_change_user_pwd.ldif        |   29 ++
 opends/tests/functional-tests/shared/data/security/pwd_policy/user_change_force_pwd.ldif        |   29 ++
 10 files changed, 723 insertions(+), 0 deletions(-)

diff --git a/opends/tests/functional-tests/shared/data/security/pwd_policy/add_entry1.ldif b/opends/tests/functional-tests/shared/data/security/pwd_policy/add_entry1.ldif
new file mode 100644
index 0000000..c0c4e35
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/security/pwd_policy/add_entry1.ldif
@@ -0,0 +1,43 @@
+# 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: uid=mcat, ou=People, ou=password tests,  o=Pwd Policy Tests, dc=example,dc=com
+cn: Mortimer Cat
+sn: Cat
+givenname: Mortimer
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Accounting
+ou: People
+l: Sunnyvale
+uid: mcat
+mail: mcat@example.com
+telephonenumber: +1 408 555 4798
+facsimiletelephonenumber: +1 408 555 9751
+roomnumber: 4612
+userpassword: pizza
+
diff --git a/opends/tests/functional-tests/shared/data/security/pwd_policy/add_entry2.ldif b/opends/tests/functional-tests/shared/data/security/pwd_policy/add_entry2.ldif
new file mode 100644
index 0000000..d24b0c9
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/security/pwd_policy/add_entry2.ldif
@@ -0,0 +1,43 @@
+# 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: uid=mdog, ou=People, ou=password tests,  o=Pwd Policy Tests, dc=example,dc=com
+cn: Mortimer Dog
+sn: Dog
+givenname: Mortimer
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+ou: Accounting
+ou: People
+l: Sunnyvale
+uid: mdog
+mail: mdog@example.com
+telephonenumber: +1 408 555 4798
+facsimiletelephonenumber: +1 408 555 9751
+roomnumber: 4612
+userpassword: pizza
+
diff --git a/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_change_force_pwd_reset.ldif b/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_change_force_pwd_reset.ldif
new file mode 100644
index 0000000..0e8266d
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_change_force_pwd_reset.ldif
@@ -0,0 +1,29 @@
+# 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: cn=Default Password Policy,cn=Password Policies,cn=config
+changetype: modify
+replace: ds-cfg-force-change-on-reset
+ds-cfg-force-change-on-reset: true
diff --git a/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_change_user_pwd.ldif b/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_change_user_pwd.ldif
new file mode 100644
index 0000000..36ea298
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_change_user_pwd.ldif
@@ -0,0 +1,29 @@
+# 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: uid=mdog,ou=People,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com
+changetype: modify
+replace: userpassword
+userpassword: adminpizza
diff --git a/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_reset_force_pwd_add.ldif b/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_reset_force_pwd_add.ldif
new file mode 100644
index 0000000..348b547
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_reset_force_pwd_add.ldif
@@ -0,0 +1,29 @@
+# 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: cn=Default Password Policy,cn=Password Policies,cn=config
+changetype: modify
+replace: ds-cfg-force-change-on-add
+ds-cfg-force-change-on-add: false
diff --git a/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_reset_force_pwd_reset.ldif b/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_reset_force_pwd_reset.ldif
new file mode 100644
index 0000000..8516764
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_reset_force_pwd_reset.ldif
@@ -0,0 +1,29 @@
+# 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: cn=Default Password Policy,cn=Password Policies,cn=config
+changetype: modify
+replace: ds-cfg-force-change-on-reset
+ds-cfg-force-change-on-reset: false
diff --git a/opends/tests/functional-tests/shared/data/security/pwd_policy/user_change_force_pwd.ldif b/opends/tests/functional-tests/shared/data/security/pwd_policy/user_change_force_pwd.ldif
new file mode 100644
index 0000000..208ef0b
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/security/pwd_policy/user_change_force_pwd.ldif
@@ -0,0 +1,29 @@
+# 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: uid=mcat,ou=People,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com
+changetype: modify
+replace: userpassword
+userpassword: newpizza
diff --git a/opends/tests/functional-tests/shared/data/security/pwd_policy/user_change_pwd3.ldif b/opends/tests/functional-tests/shared/data/security/pwd_policy/user_change_pwd3.ldif
new file mode 100644
index 0000000..40552ce
--- /dev/null
+++ b/opends/tests/functional-tests/shared/data/security/pwd_policy/user_change_pwd3.ldif
@@ -0,0 +1,29 @@
+# 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: uid=mdog,ou=People,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com
+changetype: modify
+replace: userpassword
+userpassword: newpizza
diff --git a/opends/tests/functional-tests/testcases/security/pwd_policy/security_force_pwd_change.xml b/opends/tests/functional-tests/testcases/security/pwd_policy/security_force_pwd_change.xml
new file mode 100755
index 0000000..6bf7915
--- /dev/null
+++ b/opends/tests/functional-tests/testcases/security/pwd_policy/security_force_pwd_change.xml
@@ -0,0 +1,459 @@
+<?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="force_pwd_change"/>
+
+  <function name="force_pwd_change">
+
+      <sequence>
+
+        <testcase name="'Security:Pwd Change: Check Existence of ds-cfg-force-change-on-add'">
+          <sequence>
+            <message>
+               'Security: Pwd Change: Checking existence of ds-cfg-force-change-on-add'
+            </message>
+
+            <call function="'compareEntry'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
+                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
+                'attrToBeCompared'   : 'ds-cfg-force-change-on-add:false',
+                'entryToBeCompared'   : 'cn=Default Password Policy,cn=Password Policies,cn=config' }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult }
+            </call>
+
+          </sequence>
+        </testcase>
+
+        <!--- Test Case : Admin Enable Force Password On Add -->
+        <testcase name="'Security:Pwd Change: Admin Enable Force Password On Add'">
+          <sequence>
+            <message>
+               'Security: Pwd Change: Admin Enabling Force Password On Add'
+            </message>
+
+            <call function="'modifyEntry'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
+                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
+                'entryToBeModified'   : '%s/security/pwd_policy/admin_change_force_pwd_add.ldif' % STAGED_DATA_DIR }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult }
+            </call>
+          </sequence>
+        </testcase>
+
+        <!--- Test Case : Add Single New User -->
+        <testcase name="'Security: Pwd Change: Add Single New User'">
+          <sequence>
+            <message>
+               'Security: Pwd Change: Adding Single New User'
+            </message>
+
+            <call function="'addEntry'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
+                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
+                'entryToBeAdded'   : '%s/security/pwd_policy/add_entry1.ldif' % STAGED_DATA_DIR }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult }
+            </call>
+          </sequence>
+        </testcase>
+
+        <!--- Test Case : User Search With Password -->
+        <testcase name="'Security:Pwd Policy: User Search With Password'">
+          <sequence>
+            <message>
+               'Security: Pwd Policy: User Searching With Password'
+            </message>
+
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : 'uid=mcat,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
+                'dsInstancePswd'   : 'pizza' ,
+                'dsBaseDN'   : 'dc=example,dc=com' ,
+                'dsFilter'         : 'objectclass=*'  ,
+                'extraParams'      : '-s base' }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult ,
+                  'expected'   : 19  }
+            </call>
+          </sequence>
+        </testcase>
+
+        <!--- Test Case : User Change Password -->
+        <testcase name="'Security:Pwd Policy: User Change Password'">
+          <sequence>
+            <message>
+               'Security: Pwd Policy: User Changing Password'
+            </message>
+
+            <call function="'modifyEntry'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : 'uid=mcat,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
+                'dsInstancePswd'   : 'pizza' ,
+                'entryToBeModified'   : '%s/security/pwd_policy/user_change_force_pwd.ldif' % STAGED_DATA_DIR }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult }
+            </call>
+          </sequence>
+        </testcase>
+
+        <!--- Test Case : User Search With Password -->
+        <testcase name="'Security:Pwd Policy: User Search With Password'">
+          <sequence>
+            <message>
+               'Security: Pwd Policy: User Searching With Password'
+            </message>
+
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : 'uid=mcat,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
+                'dsInstancePswd'   : 'newpizza' ,
+                'dsBaseDN'   : 'dc=example,dc=com' ,
+                'dsFilter'         : 'objectclass=*'  ,
+                'extraParams'      : '-s base' }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult }
+            </call>
+          </sequence>
+        </testcase>
+
+        <!--- Test Case : Admin Disable Force Password On Add -->
+        <testcase name="'Security:Pwd Change: Admin Disable Force Password On Add'">
+          <sequence>
+            <message>
+               'Security: Pwd Change: Admin Disabling Force Password On Add'
+            </message>
+
+            <call function="'modifyEntry'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
+                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
+                'entryToBeModified'   : '%s/security/pwd_policy/admin_reset_force_pwd_add.ldif' % STAGED_DATA_DIR }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult }
+            </call>
+          </sequence>
+        </testcase>
+
+        <!--- Test Case : Add Single New User -->
+        <testcase name="'Security: Pwd Change: Add Single New User'">
+          <sequence>
+            <message>
+               'Security: Pwd Change: Adding Single New User'
+            </message>
+
+            <call function="'addEntry'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
+                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
+                'entryToBeAdded'   : '%s/security/pwd_policy/add_entry2.ldif' % STAGED_DATA_DIR }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult }
+            </call>
+          </sequence>
+        </testcase>
+
+        <!--- Test Case : User Search With Password -->
+        <testcase name="'Security:Pwd Policy: User Search With Password'">
+          <sequence>
+            <message>
+               'Security: Pwd Policy: User Searching With Password'
+            </message>
+
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : 'uid=mdog,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
+                'dsInstancePswd'   : 'pizza' ,
+                'dsBaseDN'   : 'dc=example,dc=com' ,
+                'dsFilter'         : 'objectclass=*'  ,
+                'extraParams'      : '-s base' }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult }
+            </call>
+          </sequence>
+        </testcase>
+
+        <testcase name="'Security:Pwd Change: Check Existence of ds-cfg-force-change-on-reset'">
+          <sequence>
+            <message>
+               'Security: Pwd Change: Checking existence of ds-cfg-force-change-on-reset'
+            </message>
+
+            <call function="'compareEntry'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
+                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
+                'attrToBeCompared'   : 'ds-cfg-force-change-on-reset:false',
+                'entryToBeCompared'   : 'cn=Default Password Policy,cn=Password Policies,cn=config' }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult }
+            </call>
+
+          </sequence>
+        </testcase>
+
+        <!--- Test Case : Admin Enable Force Password On Reset -->
+        <testcase name="'Security:Pwd Change: Admin Enable Force Password On Reset'">
+          <sequence>
+            <message>
+               'Security: Pwd Change: Admin Enabling Force Password On Reset'
+            </message>
+
+            <call function="'modifyEntry'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
+                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
+                'entryToBeModified'   : '%s/security/pwd_policy/admin_change_force_pwd_reset.ldif' % STAGED_DATA_DIR }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult }
+            </call>
+          </sequence>
+        </testcase>
+
+        <!--- Test Case : Admin Change User Pwd -->
+        <testcase name="'Security:Pwd Change: Admin Change User Pwd'">
+          <sequence>
+            <message>
+               'Security: Pwd Change: Admin Changing User Pwd'
+            </message>
+
+            <call function="'modifyEntry'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
+                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
+                'entryToBeModified'   : '%s/security/pwd_policy/admin_change_user_pwd.ldif' % STAGED_DATA_DIR }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult }
+            </call>
+          </sequence>
+        </testcase>
+
+        <!--- Test Case : User Search With Password -->
+        <testcase name="'Security:Pwd Policy: User Search With Password'">
+          <sequence>
+            <message>
+               'Security: Pwd Policy: User Searching With Password'
+            </message>
+
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : 'uid=mdog,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
+                'dsInstancePswd'   : 'pizza' ,
+                'dsBaseDN'   : 'dc=example,dc=com' ,
+                'dsFilter'         : 'objectclass=*'  ,
+                'extraParams'      : '-s base' }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult ,
+                  'expected'   : 1  }
+            </call>
+          </sequence>
+        </testcase>
+
+        <!--- Test Case : User Search With Password -->
+        <testcase name="'Security:Pwd Policy: User Search With Password'">
+          <sequence>
+            <message>
+               'Security: Pwd Policy: User Searching With Password'
+            </message>
+
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : 'uid=mdog,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
+                'dsInstancePswd'   : 'adminpizza' ,
+                'dsBaseDN'   : 'dc=example,dc=com' ,
+                'dsFilter'         : 'objectclass=*'  ,
+                'extraParams'      : '-s base' }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult ,
+                  'expected'   : 19  }
+            </call>
+          </sequence>
+        </testcase>
+
+        <!--- Test Case : User Change Password -->
+        <testcase name="'Security:Pwd Policy: User Change Password'">
+          <sequence>
+            <message>
+               'Security: Pwd Policy: User Changing Password'
+            </message>
+
+            <call function="'modifyEntry'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : 'uid=mdog,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
+                'dsInstancePswd'   : 'adminpizza' ,
+                'entryToBeModified'   : '%s/security/pwd_policy/user_change_pwd3.ldif' % STAGED_DATA_DIR }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult }
+            </call>
+          </sequence>
+        </testcase>
+
+        <!--- Test Case : User Search With Password -->
+        <testcase name="'Security:Pwd Policy: User Search With Password'">
+          <sequence>
+            <message>
+               'Security: Pwd Policy: User Searching With Password'
+            </message>
+
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : 'uid=mdog,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
+                'dsInstancePswd'   : 'adminpizza' ,
+                'dsBaseDN'   : 'dc=example,dc=com' ,
+                'dsFilter'         : 'objectclass=*'  ,
+                'extraParams'      : '-s base' }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult ,
+                  'expected'   : 1  }
+            </call>
+          </sequence>
+        </testcase>
+
+        <!--- Test Case : User Search With Password -->
+        <testcase name="'Security:Pwd Policy: User Search With Password'">
+          <sequence>
+            <message>
+               'Security: Pwd Policy: User Searching With Password'
+            </message>
+
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : 'uid=mdog,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
+                'dsInstancePswd'   : 'newpizza' ,
+                'dsBaseDN'   : 'dc=example,dc=com' ,
+                'dsFilter'         : 'objectclass=*'  ,
+                'extraParams'      : '-s base' }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult }
+            </call>
+          </sequence>
+        </testcase>
+
+        <!--- Test Case : Admin Disable Force Password On Reset -->
+        <testcase name="'Security:Pwd Change: Admin Disable Force Password On Reset'">
+          <sequence>
+            <message>
+               'Security: Pwd Change: Admin Disabling Force Password On Reset'
+            </message>
+
+            <call function="'modifyEntry'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
+                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
+                'entryToBeModified'   : '%s/security/pwd_policy/admin_reset_force_pwd_reset.ldif' % STAGED_DATA_DIR }
+            </call>
+
+            <call function="'checktestRC'">
+                { 'returncode' : RC ,
+                  'result'     : STAXResult }
+            </call>
+          </sequence>
+        </testcase>
+
+        <return>RC</return>
+
+     </sequence>
+
+  </function>
+
+</stax>
diff --git a/opends/tests/functional-tests/testcases/security/pwd_policy/security_pwd_policy.xml b/opends/tests/functional-tests/testcases/security/pwd_policy/security_pwd_policy.xml
index 795dcbb..e964a06 100755
--- a/opends/tests/functional-tests/testcases/security/pwd_policy/security_pwd_policy.xml
+++ b/opends/tests/functional-tests/testcases/security/pwd_policy/security_pwd_policy.xml
@@ -80,6 +80,10 @@
         <call function="'user_pwd_policy'" />
 
         <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
+          file="'%s/testcases/security/pwd_policy/security_force_pwd_change.xml' % (TESTS_DIR)"/>
+        <call function="'force_pwd_change'" />
+
+        <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
           file="'%s/testcases/security/pwd_policy/security_force_pwd_change_all_users.xml' % (TESTS_DIR)"/>
         <call function="'force_pwd_change_all_users'" />
 

--
Gitblit v1.10.0