mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

el_kaboing
27.14.2006 4f004c4ac496c2580d397989b9558f4b183475b6
Adding functional tests for Issues 304 and 305.
8 files added
1 files modified
652 ■■■■■ changed files
opends/tests/functional-tests/shared/data/security/pwd_policy/admin_change_lockout_dur_long.ldif 29 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/data/security/pwd_policy/admin_change_lockout_dur_short.ldif 29 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/data/security/pwd_policy/admin_change_user_pwd2.ldif 29 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/data/security/pwd_policy/admin_change_user_pwd3.ldif 29 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/data/security/pwd_policy/admin_reset_lockout_dur.ldif 29 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/data/security/pwd_policy/user_change_pwd5.ldif 29 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/data/security/pwd_policy/user_change_pwd6.ldif 29 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/testcases/security/pwd_policy/security_lockout_duration.xml 445 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/testcases/security/pwd_policy/security_pwd_policy.xml 4 ●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/data/security/pwd_policy/admin_change_lockout_dur_long.ldif
New file
@@ -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-lockout-duration
ds-cfg-lockout-duration: 5 days
opends/tests/functional-tests/shared/data/security/pwd_policy/admin_change_lockout_dur_short.ldif
New file
@@ -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-lockout-duration
ds-cfg-lockout-duration: 5 seconds
opends/tests/functional-tests/shared/data/security/pwd_policy/admin_change_user_pwd2.ldif
New file
@@ -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=mward,ou=People,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com
changetype: modify
replace: userpassword
userpassword: adminnormal
opends/tests/functional-tests/shared/data/security/pwd_policy/admin_change_user_pwd3.ldif
New file
@@ -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=mward,ou=People,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com
changetype: modify
replace: userpassword
userpassword: normal
opends/tests/functional-tests/shared/data/security/pwd_policy/admin_reset_lockout_dur.ldif
New file
@@ -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-lockout-duration
ds-cfg-lockout-duration: 0 seconds
opends/tests/functional-tests/shared/data/security/pwd_policy/user_change_pwd5.ldif
New file
@@ -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=mward,ou=People,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com
changetype: modify
replace: userpassword
userpassword: newnormal
opends/tests/functional-tests/shared/data/security/pwd_policy/user_change_pwd6.ldif
New file
@@ -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=bjablons,ou=People,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com
changetype: modify
replace: userpassword
userpassword: newberry
opends/tests/functional-tests/testcases/security/pwd_policy/security_lockout_duration.xml
New file
@@ -0,0 +1,445 @@
<?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="lockout_duration"/>
  <function name="lockout_duration">
      <sequence>
        <testcase name="'Security: Lockout Duration: Preamble'">
          <sequence>
            <message>
               'Security: Lockout Duration: Preamble Step 1. Checking existence of ds-cfg-lockout-duration'
            </message>
            <call function="'compareEntry'">
              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
                'attrToBeCompared'   : 'ds-cfg-lockout-duration:0 seconds',
                'entryToBeCompared'   : 'cn=Default Password Policy,cn=Password Policies,cn=config' }
            </call>
            <if expr="RC != 0">
                <tcstatus result="'fail'"/>
            </if>
            <message>
               'Security: Lockout Duration: Preamble Step 2. Admin Changing Lockout Count'
            </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_lockout_cnt.ldif' % STAGED_DATA_DIR }
            </call>
            <if expr="RC != 0">
                <tcstatus result="'fail'"/>
            </if>
            <message>
               'Security: Lockout Duration: Preamble Step 3. User Lockout With Bad Pwd 3x'
            </message>
            <script>
                search_pwds = ['bad', 'bad', 'bad', 'normal']
            </script>
            <iterate var="pwds" in="search_pwds" indexvar="index">
              <call function="'SearchObject'">
                { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                  'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                  'dsInstanceDn'     : 'uid=mward,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
                  'dsInstancePswd'   : '%s' % pwds,
                  'dsBaseDN'   : 'dc=example,dc=com' ,
                  'dsFilter'         : 'objectclass=*'  ,
                  'extraParams'      : '-s base' }
              </call>
            </iterate>
            <if expr="RC != 1">
                <tcstatus result="'fail'"/>
            </if>
            <message>
               'Security: Lockout Duration: Preamble Step 4. Admin Resetting 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_pwd2.ldif' % STAGED_DATA_DIR }
            </call>
            <if expr="RC != 0">
                <tcstatus result="'fail'"/>
            </if>
            <message>
               'Security: Lockout Duration: Preamble Step 5. User Bind With New Password'
            </message>
            <call function="'SearchObject'">
                { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                  'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                  'dsInstanceDn'     : 'uid=mward,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
                  'dsInstancePswd'   : 'adminnormal' ,
                  'dsBaseDN'   : 'dc=example,dc=com' ,
                  'dsFilter'         : 'objectclass=*'  ,
                  'extraParams'      : '-s base' }
            </call>
            <call function="'checktestRC'">
                { 'returncode' : RC ,
                  'result'     : STAXResult }
            </call>
          </sequence>
        </testcase>
        <!--- Test Case : Amin Change Lockout Cnt -->
        <testcase name="'Security: Lockout Duration: Make Lockout Duration Short'">
          <sequence>
            <message>
               'Security: Lockout Duration: Admin Making Lockout Duration Short'
            </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_lockout_dur_short.ldif' % STAGED_DATA_DIR }
            </call>
            <call function="'checktestRC'">
                { 'returncode' : RC ,
                  'result'     : STAXResult }
            </call>
          </sequence>
        </testcase>
        <!--- Test Case : Amin Change Lockout Duration -->
        <testcase name="'Security: Lockout Duration: Short Lockout Duration'">
          <sequence>
            <message>
               'Security: Lockout Duration: Short Lockout Duration Step 1. User Lockout With Bad Pwd 3x'
            </message>
            <script>
                search_pwds = ['bad', 'bad', 'bad', 'adminnormal']
            </script>
            <iterate var="pwds" in="search_pwds" indexvar="index">
              <call function="'SearchObject'">
                { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                  'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                  'dsInstanceDn'     : 'uid=mward,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
                  'dsInstancePswd'   : '%s' % pwds,
                  'dsBaseDN'   : 'dc=example,dc=com' ,
                  'dsFilter'         : 'objectclass=*'  ,
                  'extraParams'      : '-s base' }
              </call>
            </iterate>
            <if expr="RC != 1">
                <tcstatus result="'fail'"/>
            </if>
            <message>
               'Security: Lockout Duration: Short Lockout Duration - Sleeping'
            </message>
            <call function="'Sleep'">
              { 'sleepForMilliSeconds' : '8000' }
            </call>
            <message>
               'Security: lockout Duration: Short Lockout Duration Step 2. User Changing Password'
            </message>
            <call function="'modifyEntry'">
              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                'dsInstanceDn'     : 'uid=mward,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
                'dsInstancePswd'   : 'adminnormal' ,
                'entryToBeModified'   : '%s/security/pwd_policy/user_change_pwd5.ldif' % STAGED_DATA_DIR }
            </call>
            <if expr="RC != 0">
                <tcstatus result="'fail'"/>
            </if>
            <message>
               'Security: Lockout Duration: Short Lockout Duration Step 3. User Bind With New Password'
            </message>
            <call function="'SearchObject'">
                { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                  'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                  'dsInstanceDn'     : 'uid=mward,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
                  'dsInstancePswd'   : 'newnormal' ,
                  'dsBaseDN'   : 'dc=example,dc=com' ,
                  'dsFilter'         : 'objectclass=*'  ,
                  'extraParams'      : '-s base' }
            </call>
            <call function="'checktestRC'">
                { 'returncode' : RC ,
                  'result'     : STAXResult }
            </call>
          </sequence>
        </testcase>
        <!--- Test Case : Amin Change Lockout Cnt -->
        <testcase name="'Security: Lockout Duration: Make Lockout Duration Long'">
          <sequence>
            <message>
               'Security: Lockout Duration: Admin Making Lockout Duration Long'
            </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_lockout_dur_long.ldif' % STAGED_DATA_DIR }
            </call>
            <call function="'checktestRC'">
                { 'returncode' : RC ,
                  'result'     : STAXResult }
            </call>
          </sequence>
        </testcase>
        <!--- Test Case : Amin Change Lockout Duration -->
        <testcase name="'Security: Lockout Duration: Long Lockout Duration'">
          <sequence>
            <message>
               'Security: Lockout Duration: Long Lockout Duration Step 1. User Initial Bind'
            </message>
            <call function="'SearchObject'">
                { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                  'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                  'dsInstanceDn'     : 'uid=bjablons,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
                  'dsInstancePswd'   : 'strawberry' ,
                  'dsBaseDN'   : 'dc=example,dc=com' ,
                  'dsFilter'         : 'objectclass=*'  ,
                  'extraParams'      : '-s base' }
            </call>
            <if expr="RC != 0">
                <tcstatus result="'fail'"/>
            </if>
            <message>
               'Security: Lockout Duration: Long Lockout Duration Step 2. User Lockout With Bad Pwd 3x'
            </message>
            <script>
                search_pwds = ['bad', 'bad', 'bad', 'strawberry']
            </script>
            <iterate var="pwds" in="search_pwds" indexvar="index">
              <call function="'SearchObject'">
                { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                  'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                  'dsInstanceDn'     : 'uid=bjablons,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
                  'dsInstancePswd'   : '%s' % pwds,
                  'dsBaseDN'   : 'dc=example,dc=com' ,
                  'dsFilter'         : 'objectclass=*'  ,
                  'extraParams'      : '-s base' }
              </call>
            </iterate>
            <if expr="RC != 1">
                <tcstatus result="'fail'"/>
            </if>
            <message>
               'Security: Lockout Duration: Long Lockout Duration - Sleeping'
            </message>
            <call function="'Sleep'">
              { 'sleepForMilliSeconds' : '8000' }
            </call>
            <message>
               'Security: lockout Duration: Long Lockout Duration Step 3. User Changing Password'
            </message>
            <call function="'modifyEntry'">
              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                'dsInstanceDn'     : 'uid=bjablons,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
                'dsInstancePswd'   : 'strawberry' ,
                'entryToBeModified'   : '%s/security/pwd_policy/user_change_pwd6.ldif' % STAGED_DATA_DIR }
            </call>
            <if expr="RC != 1">
                <tcstatus result="'fail'"/>
            </if>
            <message>
               'Security: Lockout Duration: Long Lockout Duration Step 4. User Bind With New Password'
            </message>
            <call function="'SearchObject'">
                { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                  'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                  'dsInstanceDn'     : 'uid=bjablons,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
                  'dsInstancePswd'   : 'newberry' ,
                  'dsBaseDN'   : 'dc=example,dc=com' ,
                  'dsFilter'         : 'objectclass=*'  ,
                  'extraParams'      : '-s base' }
            </call>
            <call function="'checktestRC'">
                { 'returncode' : RC ,
                  'result'     : STAXResult ,
                  'expected'   : 1}
            </call>
          </sequence>
        </testcase>
        <testcase name="'Security: Lockout Duration: Postamble'">
          <sequence>
            <message>
               'Security: Lockout Duration: Postamble Step 1. Admin Resetting Lockout Duration'
            </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_lockout_dur.ldif' % STAGED_DATA_DIR }
            </call>
            <if expr="RC != 0">
                <tcstatus result="'fail'"/>
            </if>
            <message>
               'Security: Lockout Duration: Postamble Step 2. User Lockout With Bad Pwd 3x'
            </message>
            <script>
                search_pwds = ['bad', 'bad', 'bad', 'newnormal']
            </script>
            <iterate var="pwds" in="search_pwds" indexvar="index">
              <call function="'SearchObject'">
                { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                  'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                  'dsInstanceDn'     : 'uid=mward,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
                  'dsInstancePswd'   : '%s' % pwds,
                  'dsBaseDN'   : 'dc=example,dc=com' ,
                  'dsFilter'         : 'objectclass=*'  ,
                  'extraParams'      : '-s base' }
              </call>
            </iterate>
            <if expr="RC != 1">
                <tcstatus result="'fail'"/>
            </if>
            <message>
               'Security: Lockout Duration: Postamble Step 3. Admin Resetting 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_pwd3.ldif' % STAGED_DATA_DIR }
            </call>
            <if expr="RC != 0">
                <tcstatus result="'fail'"/>
            </if>
            <message>
               'Security: Lockout Duration: Postamble Step 4. User Bind With New Password'
            </message>
            <call function="'SearchObject'">
                { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                  'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                  'dsInstanceDn'     : 'uid=mward,ou=people,ou=password tests,o=Pwd Policy Tests,dc=example,dc=com' ,
                  'dsInstancePswd'   : 'normal' ,
                  'dsBaseDN'   : 'dc=example,dc=com' ,
                  'dsFilter'         : 'objectclass=*'  ,
                  'extraParams'      : '-s base' }
            </call>
            <if expr="RC != 0">
                <tcstatus result="'fail'"/>
            </if>
            <message>
               'Security: Lockout Duration: Postamble Step 5. Admin Resetting Lockout Count'
            </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_lockout_cnt.ldif' % STAGED_DATA_DIR }
            </call>
            <call function="'checktestRC'">
                { 'returncode' : RC ,
                  'result'     : STAXResult }
            </call>
          </sequence>
        </testcase>
        <return>RC</return>
     </sequence>
  </function>
</stax>
opends/tests/functional-tests/testcases/security/pwd_policy/security_pwd_policy.xml
@@ -115,6 +115,10 @@
          file="'%s/testcases/security/pwd_policy/security_preencoded_pwds.xml' % (TESTS_DIR)"/>
        <call function="'preencoded_pwds'" />
        <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
          file="'%s/testcases/security/pwd_policy/security_lockout_duration.xml' % (TESTS_DIR)"/>
        <call function="'lockout_duration'" />
        <!--- Test Case : Stop DS -->
        <testcase name="'StopDS'">
          <sequence>