<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "/shared/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
!
! Copyright 2006-2008 Sun Microsystems, Inc.
! Portions copyright 2012 ForgeRock AS.
! -->
<stax>
<!--- Test Case information
#@TestMarker User Password Policy
#@TestName Get Allow User Password Changes
#@TestIssue None
#@TestPurpose Get ds-cfg-allow-user-password-changes
#@TestPreamble None
#@TestStep Check ds-cfg-allow-user-password-changes
#@TestStep Check the output of the command.
#@TestPostamble None
#@TestResult Success if compareEntry returns 0 and the
output is correct.
-->
<function name="pwp_allow_user_pswd_changes_001" scope="local">
<testcase name="getTestCaseName('PWP Get Allow User Password Changes')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Get Allow User Password Changes Property.' % msg1 }
</call>
<script>
options=[]
options.append('--policy-name "Default Password Policy"')
options.append('--property "allow-user-password-changes"')
dsconfigOptions=' '.join(options)
</script>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'subcommand' : 'get-password-policy-prop',
'optionsString' : dsconfigOptions,
'expectedString' : 'allow-user-password-changes : true'
}
</call>
<call function="'testStep'">
{ 'stepMessage' : '%s Get Allow User Password Changes Attribute.' % msg1 }
</call>
<call function="'compareEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'attrToBeCompared' : 'ds-cfg-allow-user-password-changes:true',
'entryToBeCompared' : basepwp }
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker User Password Policy
#@TestName Check User Search With Password
#@TestIssue None
#@TestPurpose Check User Search With Password
#@TestPreamble None
#@TestStep Check User Search With Password
#@TestStep Check the output of the command.
#@TestPostamble None
#@TestResult Success if SearchObject returns 0
-->
<function name="pwp_allow_user_pswd_changes_002" scope="local">
<testcase name="getTestCaseName('PWP User Search')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s User Searching With Password.' % msg1 }
</call>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=scarter,%s' % basedn ,
'dsInstancePswd' : 'sprain' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' }
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker User Password Policy
#@TestName Check User Search With Bad Password
#@TestIssue None
#@TestPurpose Check User Search With Bad Password
#@TestPreamble None
#@TestStep Check User Search With Bad Password
#@TestPostamble None
#@TestResult Success if SearchObject returns 49
-->
<function name="pwp_allow_user_pswd_changes_003" scope="local">
<testcase name="getTestCaseName('PWP User Search With Bad Password')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s User Searching With Bad Password.' % msg1 }
</call>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=scarter,%s' % basedn ,
'dsInstancePswd' : 'newsprain' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' ,
'expectedRC' : 49 }
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker User Password Policy
#@TestName User With Bad Credentials Change Password
#@TestIssue None
#@TestPurpose Check User Search With Bad Credentials
#@TestPreamble None
#@TestStep Check User Search With Bad Credentials
#@TestPostamble None
#@TestResult Success if ldapPasswordModifyWithScript returns 49
-->
<function name="pwp_allow_user_pswd_changes_004" scope="local">
<testcase name="getTestCaseName('PWP User With Bad Credentials Change Password')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s User with Bad Credentials Changing Password.' % msg1 }
</call>
<call function="'ldapPasswordModifyWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=scarter,%s' % basedn ,
'dsInstancePswd' : 'BadPwd' ,
'dsAuthzID' : 'dn:uid=scarter,%s' % basedn ,
'dsNewPassword' : 'newsprain' ,
'expectedRC' : 49 }
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker User Password Policy
#@TestName User Change Password
#@TestIssue None
#@TestPurpose User Change Password
#@TestPreamble None
#@TestStep Step 1 User Change Password
#@TestStep Step 2 User Searching With Old Password
#@TestStep Step 3 User Searching With New Password
#@TestPostamble None
#@TestResult Success if SearchObject returns 0
-->
<function name="pwp_allow_user_pswd_changes_005" scope="local">
<testcase name="getTestCaseName('PWP User Changing Own Password')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s User Changing Password.' % msg1 }
</call>
<call function="'ldapPasswordModifyWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=scarter,%s' % basedn ,
'dsInstancePswd' : 'sprain' ,
'dsAuthzID' : 'dn:uid=scarter,%s' % basedn ,
'dsNewPassword' : 'newsprain' ,
}
</call>
<call function="'testStep'">
{ 'stepMessage' : '%s User Searching With Old Password.' % msg1 }
</call>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=scarter,%s' % basedn ,
'dsInstancePswd' : 'sprain' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' ,
'expectedRC' : 49 }
</call>
<call function="'testStep'">
{ 'stepMessage' : '%s User Searching With New Password.' % msg1 }
</call>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=scarter,%s' % basedn ,
'dsInstancePswd' : 'newsprain' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' }
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker User Password Policy
#@TestName Admin Change Password Policy
#@TestIssue None
#@TestPurpose Admin Change Password Policy
#@TestPreamble None
#@TestStep Step 1 Modify the Password Policy by setting
allow-user-password-changes to false
#@TestStep Step 2 User resetting password should fail (49)
#@TestStep Step 3 Check manage-account get-password-is-reset
#@TestPostamble None
#@TestResult Success if ldapPasswordModifyWithScript returns 49
-->
<function name="pwp_allow_user_pswd_changes_006" scope="local">
<testcase name="getTestCaseName('PWP Allow User Password Changes False')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Set Allow User Password Changes to false.' % msg1 }
</call>
<script>
options=[]
options.append('--policy-name "Default Password Policy"')
options.append('--set "allow-user-password-changes:false"')
dsconfigOptions=' '.join(options)
</script>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'subcommand' : 'set-password-policy-prop',
'optionsString' : dsconfigOptions
}
</call>
<call function="'testStep'">
{ 'stepMessage' : '%s User Resetting Password.' % msg1 }
</call>
<call function="'ldapPasswordModifyWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=scarter,%s' % basedn ,
'dsInstancePswd' : 'sprain' ,
'dsAuthzID' : 'dn:uid=scarter,%s' % basedn ,
'dsNewPassword' : 'sprain' ,
'expectedRC' : 49 }
</call>
<call function="'testStep'">
{ 'stepMessage' : '%s Check manage-account get-password-is-reset.' % msg1 }
</call>
<call function="'manageAccountWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'get-password-is-reset' ,
'targetDn' : 'uid=scarter,%s' % basedn }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchString'">
{ 'returnString' : returnString ,
'expectedString' : 'Password Is Reset: false' }
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker User Password Policy
#@TestName Allow User Password Changes
#@TestIssue None
#@TestPurpose Allow User Password Changes
#@TestPreamble None
#@TestStep Step 1 - Admin Resetting Password Policy
set allow-user-password-changes to true
#@TestStep Step 2 - User Resetting Password
#@TestStep Step 3 - Check manage-account
get-password-is-reset
#@TestStep Step 4 - check manage-account
get-password-changed-time
#@TestStep Step 5 - User Searching With Old Password
#@TestStep Step 6 - User Searching With New Password
#@TestPostamble None
#@TestResult Success if SearchObject returns 0.
-->
<function name="pwp_allow_user_pswd_changes_007" scope="local">
<testcase name="getTestCaseName('PWP Reset Allow User Password Changes')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Reset Allow User Password Changes.' % msg1 }
</call>
<script>
options=[]
options.append('--policy-name "Default Password Policy"')
options.append('--reset allow-user-password-changes')
dsconfigOptions=' '.join(options)
</script>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'subcommand' : 'set-password-policy-prop',
'optionsString' : dsconfigOptions
}
</call>
<call function="'testStep'">
{ 'stepMessage' : '%s User Resetting Password.' % msg1 }
</call>
<call function="'ldapPasswordModifyWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=scarter,%s' % basedn ,
'dsInstancePswd' : 'newsprain' ,
'dsAuthzID' : 'dn:uid=scarter,%s' % basedn ,
'dsNewPassword' : 'sprain' ,
}
</call>
<call function="'testStep'">
{ 'stepMessage' : '%s Check manage-account get-password-is-reset.' % msg1 }
</call>
<call function="'manageAccountWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'get-password-is-reset' ,
'targetDn' : 'uid=scarter,%s' % basedn }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchString'">
{ 'returnString' : returnString ,
'expectedString' : 'Password Is Reset: false' }
</call>
<call function="'testStep'">
{ 'stepMessage' : '%s Check manage-account get-password-changed-time.' % msg1 }
</call>
<call function="'manageAccountWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'get-password-changed-time' ,
'targetDn' : 'uid=scarter,%s' % basedn }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchString'">
{ 'returnString' : returnString ,
'expectedString' : 'Password Changed Time: 2' }
</call>
<call function="'testStep'">
{ 'stepMessage' : '%s User Searching With Old Password.' % msg1 }
</call>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=scarter,%s' % basedn ,
'dsInstancePswd' : 'newsprain' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' ,
'expectedRC' : 49 }
</call>
<call function="'testStep'">
{ 'stepMessage' : '%s User Searching With New Password.' % msg1 }
</call>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=scarter,%s' % basedn ,
'dsInstancePswd' : 'sprain' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' }
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
</stax>