5789N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
5789N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
5789N/A<!--
5789N/A ! CDDL HEADER START
5789N/A !
5789N/A ! The contents of this file are subject to the terms of the
5789N/A ! Common Development and Distribution License, Version 1.0 only
5789N/A ! (the "License"). You may not use this file except in compliance
5789N/A ! with the License.
5789N/A !
5789N/A ! You can obtain a copy of the license at
5789N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
5789N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
5789N/A ! See the License for the specific language governing permissions
5789N/A ! and limitations under the License.
5789N/A !
5789N/A ! When distributing Covered Code, include this CDDL HEADER in each
5789N/A ! file and include the License file at
5789N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
5789N/A ! add the following below this CDDL HEADER, with the fields enclosed
5789N/A ! by brackets "[]" replaced with your own identifying information:
5789N/A ! Portions Copyright [yyyy] [name of copyright owner]
5789N/A !
5789N/A ! CDDL HEADER END
5789N/A !
5789N/A ! Copyright 2006-2008 Sun Microsystems, Inc.
5789N/A ! Portions Copyright 2012 ForgeRock AS
5789N/A ! -->
5789N/A<stax>
5789N/A
5789N/A <!--- Test Case information
5789N/A #@TestMarker Lockout Failure Count
5789N/A #@TestName Default Lockout Failure Count
5789N/A #@TestIssue None
5789N/A #@TestPurpose Verify that by default the lockout failure count is not active
5789N/A #@TestPreamble None
5789N/A #@TestStep Step 1. Get lockout-failure-count and value is 0
5789N/A #@TestStep Step 2. Default Bind With Bad Pwd 3x RC 49
5789N/A #@TestStep Step 3 User search with good password returns 0
5789N/A #@TestStep Step 4. Get manage-account get-remaining-authentication-failure-count
5789N/A #@TestPostamble None
5789N/A #@TestResult Success if the 3 steps are PASS
5789N/A -->
5789N/A <function name="pwp_lockout_failure_count_001" scope="local">
5789N/A <testcase name="getTestCaseName('PWP Default Lockout Failure Count')">
5789N/A <sequence>
5789N/A <try>
5789N/A <sequence>
5789N/A
5789N/A <call function="'testCase_Preamble'"/>
5789N/A
5789N/A <message>
5789N/A 'Test Name = %s' % STAXCurrentTestcase
5789N/A </message>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Get Lockout Failure Count.' % msg2 }
5789N/A </call>
5789N/A
5789N/A <script>
5789N/A options=[]
5789N/A options.append('--policy-name "Default Password Policy"')
5789N/A options.append('--property "lockout-failure-count"')
5789N/A dsconfigOptions=' '.join(options)
5789N/A </script>
5789N/A
5789N/A <call function="'dsconfig'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
5789N/A 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
5789N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
5789N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
5789N/A 'subcommand' : 'get-password-policy-prop',
5789N/A 'optionsString' : dsconfigOptions,
5789N/A 'expectedString' : 'lockout-failure-count : 0'
5789N/A
5789N/A }
5789N/A </call>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Compare Lockout Failure Count Attribute.' % msg2 }
5789N/A </call>
5789N/A
5789N/A <call function="'compareEntry'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5789N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5789N/A 'attrToBeCompared' : 'ds-cfg-lockout-failure-count:0',
5882N/A 'entryToBeCompared' : basepwp ,
5882N/A 'expectedRC' : 16 }
5789N/A </call>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Default Bind With Bad Pwd 3x.' % msg2 }
5789N/A </call>
5789N/A
5789N/A <script>
5789N/A search_pwds = ['bad', 'bad', 'bad']
5789N/A </script>
5789N/A
5789N/A <iterate var="pwds" in="search_pwds" indexvar="index">
5789N/A <call function="'SearchObject'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : 'uid=bhall,%s' % basedn ,
5789N/A 'dsInstancePswd' : '%s' % pwds,
5789N/A 'dsBaseDN' : 'dc=example,dc=com' ,
5789N/A 'dsFilter' : 'objectclass=*' ,
5789N/A 'extraParams' : '-s base' ,
5789N/A 'expectedRC' : 49 }
5789N/A </call>
5789N/A </iterate>
5789N/A
5789N/A <call function="'SearchObject'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : 'uid=bhall,%s' % basedn ,
5789N/A 'dsInstancePswd' : 'oranges',
5789N/A 'dsBaseDN' : 'dc=example,dc=com' ,
5789N/A 'dsFilter' : 'objectclass=*' ,
5789N/A 'extraParams' : '-s base' }
5789N/A </call>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Get manage-account get-remaining-authentication-failure-count.' % msg2 }
5789N/A </call>
5789N/A
5789N/A <call function="'manageAccountWithScript'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5789N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5789N/A 'subcommand' : 'get-remaining-authentication-failure-count' ,
5789N/A 'targetDn' : 'uid=bhall,%s' % basedn }
5789N/A </call>
5789N/A
5789N/A <script>
5789N/A returnString = STAXResult[0][1]
5789N/A </script>
5789N/A
5789N/A <call function="'searchString'">
5789N/A { 'returnString' : returnString ,
5789N/A 'expectedString' : 'Remaining Authentication Failure Count' }
5789N/A </call>
5789N/A
5789N/A </sequence>
5789N/A
5789N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5789N/A <message log="1" level="'fatal'">
5789N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5789N/A </message>
5789N/A </catch>
5789N/A <finally>
5789N/A <sequence>
5789N/A <call function="'testCase_Postamble'"/>
5789N/A </sequence>
5789N/A </finally>
5789N/A </try>
5789N/A </sequence>
5789N/A </testcase>
5789N/A </function>
5789N/A
5789N/A <!--- Test Case information
5789N/A #@TestMarker Lockout Failure Count
5789N/A #@TestName Set Lockout Failure Count
5789N/A #@TestIssue None
5789N/A #@TestPurpose Verify that lockout failure count can be activated
5789N/A #@TestPreamble None
5789N/A #@TestStep Setlockout-failure-count to 3
5789N/A #@TestStep get-remaining-authentication-failure-count
5789N/A #@TestPostamble None
5789N/A #@TestResult Success if all tests are PASS
5789N/A -->
5789N/A <function name="pwp_lockout_failure_count_002" scope="local">
5789N/A <testcase name="getTestCaseName('PWP Set Lockout Failure Count')">
5789N/A <sequence>
5789N/A <try>
5789N/A <sequence>
5789N/A
5789N/A <call function="'testCase_Preamble'"/>
5789N/A
5789N/A <message>
5789N/A 'Test Name = %s' % STAXCurrentTestcase
5789N/A </message>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Set Lockout Failure Count.' % msg2 }
5789N/A </call>
5789N/A
5789N/A <script>
5789N/A options=[]
5789N/A options.append('--policy-name "Default Password Policy"')
5789N/A options.append('--set "lockout-failure-count:3"')
5789N/A dsconfigOptions=' '.join(options)
5789N/A </script>
5789N/A
5789N/A <call function="'dsconfig'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
5789N/A 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
5789N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
5789N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
5789N/A 'subcommand' : 'set-password-policy-prop',
5789N/A 'optionsString' : dsconfigOptions
5789N/A }
5789N/A </call>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Get manage-account get-remaining-authentication-failure-count.' % msg2 }
5789N/A </call>
5789N/A
5789N/A <call function="'manageAccountWithScript'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5789N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5789N/A 'subcommand' : 'get-remaining-authentication-failure-count' ,
5789N/A 'targetDn' : 'uid=bhall,%s' % basedn }
5789N/A </call>
5789N/A
5789N/A <script>
5789N/A returnString = STAXResult[0][1]
5789N/A </script>
5789N/A
5789N/A <call function="'searchString'">
5789N/A { 'returnString' : returnString ,
5789N/A 'expectedString' : 'Remaining Authentication Failure Count: 3' }
5789N/A </call>
5789N/A
5789N/A </sequence>
5789N/A
5789N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5789N/A <message log="1" level="'fatal'">
5789N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5789N/A </message>
5789N/A </catch>
5789N/A <finally>
5789N/A <sequence>
5789N/A <call function="'testCase_Postamble'"/>
5789N/A </sequence>
5789N/A </finally>
5789N/A </try>
5789N/A </sequence>
5789N/A </testcase>
5789N/A </function>
5789N/A
5789N/A <!--- Test Case information
5789N/A #@TestMarker Lockout Failure Count
5789N/A #@TestName Lockout With Bad Pwd 3x
5789N/A #@TestIssue None
5789N/A #@TestPurpose Lockout With Bad Pwd 3x
5789N/A #@TestPreamble None
5789N/A #@TestStep Lockout With Bad Pwd 3x SearchObject RC 49 3x
5789N/A #@TestStep get-remaining-authentication-failure-count
5789N/A #@TestPostamble None
5789N/A #@TestResult Success if all tests are PASS
5789N/A -->
5789N/A <function name="pwp_lockout_failure_count_003" scope="local">
5789N/A <testcase name="getTestCaseName('PWP Lockout With Bad Pwd 3x')">
5789N/A <sequence>
5789N/A <try>
5789N/A <sequence>
5789N/A
5789N/A <call function="'testCase_Preamble'"/>
5789N/A
5789N/A <message>
5789N/A 'Test Name = %s' % STAXCurrentTestcase
5789N/A </message>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Lockout With Bad Pwd 3x.' % msg2 }
5789N/A </call>
5789N/A
5789N/A <script>
5789N/A search_pwds = ['bad', 'bad', 'bad', 'oranges']
5789N/A </script>
5789N/A
5789N/A <iterate var="pwds" in="search_pwds" indexvar="index">
5789N/A <call function="'SearchObject'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : 'uid=bhall,%s' % basedn ,
5789N/A 'dsInstancePswd' : '%s' % pwds,
5789N/A 'dsBaseDN' : 'dc=example,dc=com' ,
5789N/A 'dsFilter' : 'objectclass=*' ,
5789N/A 'extraParams' : '-s base' ,
5789N/A 'expectedRC' : 49 }
5789N/A </call>
5789N/A </iterate>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Get manage-account get-remaining-authentication-failure-count.' % msg2 }
5789N/A </call>
5789N/A
5789N/A <call function="'manageAccountWithScript'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5789N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5789N/A 'subcommand' : 'get-remaining-authentication-failure-count' ,
5789N/A 'targetDn' : 'uid=bhall,%s' % basedn }
5789N/A </call>
5789N/A
5789N/A <script>
5789N/A returnString = STAXResult[0][1]
5789N/A </script>
5789N/A
5789N/A <call function="'searchString'">
5789N/A { 'returnString' : returnString ,
5789N/A 'expectedString' : 'Remaining Authentication Failure Count: 0' }
5789N/A </call>
5789N/A
5789N/A </sequence>
5789N/A
5789N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5789N/A <message log="1" level="'fatal'">
5789N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5789N/A </message>
5789N/A </catch>
5789N/A <finally>
5789N/A <sequence>
5789N/A <call function="'testCase_Postamble'"/>
5789N/A </sequence>
5789N/A </finally>
5789N/A </try>
5789N/A </sequence>
5789N/A </testcase>
5789N/A </function>
5789N/A
5789N/A <!--- Test Case information
5789N/A #@TestMarker Lockout Failure Count
5789N/A #@TestName Reset Lockout Failure Count Properties
5789N/A #@TestIssue None
5789N/A #@TestPurpose Reseting the Password policy and verify it
5789N/A #@TestPreamble None
5789N/A #@TestStep Step 1. Set lockout-failure-count to 0
5789N/A #@TestStep Step 2. Check Bind With Previous User Lockout RC 0
5789N/A #@TestStep Step 3. Check Bind With Bad Pwd 3x RC 49 3x
5789N/A #@TestStep Step 4: User search with good password returns 0
5789N/A #@TestPostamble None
5789N/A #@TestResult Success if the 3 steps are PASS
5789N/A -->
5789N/A <function name="pwp_lockout_failure_count_004" scope="local">
5789N/A <testcase name="getTestCaseName('PWP Reset Lockout Failure Count Properties')">
5789N/A <sequence>
5789N/A <try>
5789N/A <sequence>
5789N/A
5789N/A <call function="'testCase_Preamble'"/>
5789N/A
5789N/A <message>
5789N/A 'Test Name = %s' % STAXCurrentTestcase
5789N/A </message>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Reset Lockout Failure Count.' % msg2 }
5789N/A </call>
5789N/A
5789N/A <script>
5789N/A options=[]
5789N/A options.append('--policy-name "Default Password Policy"')
5789N/A options.append('--reset "lockout-failure-count"')
5789N/A dsconfigOptions=' '.join(options)
5789N/A </script>
5789N/A
5789N/A <call function="'dsconfig'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
5789N/A 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
5789N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
5789N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
5789N/A 'subcommand' : 'set-password-policy-prop',
5789N/A 'optionsString' : dsconfigOptions
5789N/A }
5789N/A </call>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Check Bind With Previous User Lockout.' % msg2 }
5789N/A </call>
5789N/A
5789N/A <!--- Check Locked Out User -->
5789N/A <call function="'SearchObject'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : 'uid=bhall,%s' % basedn ,
5789N/A 'dsInstancePswd' : 'oranges' ,
5789N/A 'dsBaseDN' : 'dc=example,dc=com' ,
5789N/A 'dsFilter' : 'objectclass=*' ,
5789N/A 'extraParams' : '-s base' }
5789N/A </call>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Check Bind With Bad Pwd 3x.' % msg2 }
5789N/A </call>
5789N/A
5789N/A <script>
5789N/A search_pwds = ['bad', 'bad', 'bad']
5789N/A </script>
5789N/A
5789N/A <iterate var="pwds" in="search_pwds" indexvar="index">
5789N/A <call function="'SearchObject'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : 'uid=gfarmer,%s' % basedn ,
5789N/A 'dsInstancePswd' : '%s' % pwds,
5789N/A 'dsBaseDN' : 'dc=example,dc=com' ,
5789N/A 'dsFilter' : 'objectclass=*' ,
5789N/A 'extraParams' : '-s base',
5789N/A 'expectedRC' : 49 }
5789N/A </call>
5789N/A </iterate>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Check Bind With Valid Password.' % msg2 }
5789N/A </call>
5789N/A
5789N/A <call function="'SearchObject'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : 'uid=gfarmer,%s' % basedn ,
5789N/A 'dsInstancePswd' : 'ruling',
5789N/A 'dsBaseDN' : 'dc=example,dc=com' ,
5789N/A 'dsFilter' : 'objectclass=*' ,
5789N/A 'extraParams' : '-s base'}
5789N/A </call>
5789N/A
5789N/A </sequence>
5789N/A
5789N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5789N/A <message log="1" level="'fatal'">
5789N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5789N/A </message>
5789N/A </catch>
5789N/A <finally>
5789N/A <sequence>
5789N/A <call function="'testCase_Postamble'"/>
5789N/A </sequence>
5789N/A </finally>
5789N/A </try>
5789N/A </sequence>
5789N/A </testcase>
5789N/A </function>
5789N/A
5789N/A</stax>