| New file |
| | |
| | | <?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> |