<?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/CDDLv1_0.txt
! or http://forgerock.org/license/CDDLv1.0.html.
! 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/CDDLv1_0.txt. 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 2012 ForgeRock AS.
! -->
<stax>
<!--- Test Case information
#@TestMarker Force PasswordChange All Users
#@TestName User Search With Password
#@TestIssue none
#@TestPurpose Set the Pwd Expiration Time to a past date
#@TestPreamble none
#@TestStep Step 1 - User Searching With Password
#@TestStep Step 2 - Admin Enabling Exp Pwd No Warning
set expire-passwords-without-warning to true
#@TestStep Step 3 - Admin Setting Pwd Time Exp
set require-change-by-time to 20061030183752.848Z
#@TestPostamble none
#@TestResult Success if the 3 steps are PASS
-->
<function name="pwp_force_pwd_change_020" scope="local">
<testcase name="getTestCaseName('PWP Enable Force PasswordChange All Users')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : 'PWP: User Searching With Password.' }
</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>
<call function="'testStep'">
{ 'stepMessage' : 'PWP: Admin Enabling Expire Passwords Without Warning.' }
</call>
<script>
options=[]
options.append('--policy-name "Default Password Policy"')
options.append('--set expire-passwords-without-warning:true')
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' : 'PWP: Admin Setting Require Change by Time.' }
</call>
<script>
options=[]
options.append('--policy-name "Default Password Policy"')
options.append('--set require-change-by-time:20061030183752.848Z')
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>
</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 Force PasswordChange All Users
#@TestName User Search With Expired Password
#@TestIssue none
#@TestPurpose User Search With Expired Password
#@TestPreamble none
#@TestStep User Search With Expired Password RC 49
#@TestPostamble none
#@TestResult Success if the step is PASS
-->
<function name="pwp_force_pwd_change_021" scope="local">
<testcase name="getTestCaseName('PWP User Search With Expired Password')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : 'PWP: User Searching With Expired Password.' }
</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>
</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 Force PasswordChange All Users
#@TestName Admin Disable Exp Pwd No Warning
#@TestIssue none
#@TestPurpose Admin Disable Exp Pwd No Warning
#@TestPreamble none
#@TestStep Admin Disabling Exp Pwd No Warning
set expire-passwords-without-warning to false
#@TestPostamble none
#@TestResult Success if the step is PASS
-->
<function name="pwp_force_pwd_change_022" scope="local">
<testcase name="getTestCaseName('PWP Admin Disable Expire Passwords Without Warning')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : 'PWP: Admin Disabling Expire Passwords Without Warning.' }
</call>
<script>
options=[]
options.append('--policy-name "Default Password Policy"')
options.append('--set expire-passwords-without-warning: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>
</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 Force PasswordChange All Users
#@TestName User Search With Expired Password 2
#@TestIssue none
#@TestPurpose User Search With Expired Password 2
#@TestPreamble none
#@TestStep User Searching With Expired Password 2
SearchObject grep will expire
#@TestPostamble none
#@TestResult Success if the steps is PASS
-->
<function name="pwp_force_pwd_change_023" scope="local">
<testcase name="getTestCaseName('PWP User Search With Expired Password 2')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : 'PWP: User Searching With Expired Password 2.' }
</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>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchString'">
{ 'returnString' : returnString ,
'expectedString' : 'will expire' }
</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 Force PasswordChange All Users
#@TestName Admin Reset Pwd Time Exp
#@TestIssue none
#@TestPurpose Admin Reset Pwd Time Exp
#@TestPreamble none
#@TestStep Admin Resetting Pwd Time Exp
remove require-change-by-time 20061030183752.848Z
#@TestStep User Searching With Password SearchObject returns 0
#@TestStep check manage-account
get-password-changed-by-required-time
#@TestStep Check manage-account
get-seconds-until-required-change-time
#@TestPostamble none
#@TestResult Success if the 4 steps are PASS
-->
<function name="pwp_force_pwd_change_024" scope="local">
<testcase name="getTestCaseName('PWP Require Change by Time')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : 'PWP: Admin Resetting Require Change by Time.' }
</call>
<script>
options=[]
options.append('--policy-name "Default Password Policy"')
options.append('--set require-change-by-time:20061030183752.848Z')
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' : 'PWP: Get Require Change by Time.' }
</call>
<script>
options=[]
options.append('--policy-name "Default Password Policy"')
options.append('--property "require-change-by-time"')
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' : 'require-change-by-time : 20061030183752.848Z'
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'PWP: User Searching With Password.' }
</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>
<call function="'testStep'">
{ 'stepMessage' : 'Check manage-account %s' % msg1 }
</call>
<call function="'manageAccountWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'get-password-changed-by-required-time' ,
'targetDn' : 'uid=scarter,%s' % basedn }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchString'">
{ 'returnString' : returnString ,
'expectedString' : 'Password Changed by Required Time:' }
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Check manage-account %s' % msg2 }
</call>
<call function="'manageAccountWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'get-seconds-until-required-change-time' ,
'targetDn' : 'uid=scarter,%s' % basedn }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchString'">
{ 'returnString' : returnString ,
'expectedString' : 'Seconds Until Required Change Time:' }
</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>