<?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 Preencoded Passwords
#@TestName Get Preencoded Password
#@TestIssue none
#@TestPurpose Get Preencoded Password
#@TestPreamble none
#@TestStep Check for existence of
ds-cfg-allow-pre-encoded-passwords
and value is set to false
#@TestPostamble none
#@TestResult Success if the test is PASS
-->
<function name="pwp_preemcoded_pwds_001" scope="local">
<testcase name="getTestCaseName('PWP Get Preencoded Password')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Get Allow Pre-encoded Password Property.' % msg1 }
</call>
<script>
options=[]
options.append('--policy-name "Default Password Policy"')
options.append('--property "allow-pre-encoded-passwords"')
options.append('--advanced')
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-pre-encoded-passwords : false'
}
</call>
<call function="'testStep'">
{ 'stepMessage' : '%s Get Allow Pre-encoded Password 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-pre-encoded-passwords:false',
'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 Preencoded Passwords
#@TestName Add Entry With Pre-encoded Password
#@TestIssue none
#@TestPurpose Adding New Entry With a Pre-encoded Password
#@TestPreamble none
#@TestStep addEntry add_entry_preencoded_pwd.ldif RC 19
SearchObject returns 49
#@TestPostamble none
#@TestResult Success if the test is PASS
-->
<function name="pwp_preemcoded_pwds_002" scope="local">
<testcase name="getTestCaseName('PWP Default - Add New Entry')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Adding New Entry With a Pre-encoded Password.' % msg1 }
</call>
<call function="'addEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'entryToBeAdded' : '%s/password_policy/add_entry_preencoded_pwd.ldif' \
% remote.data ,
'expectedRC' : 19 }
</call>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=pguy,%s' % basedn ,
'dsInstancePswd' : 'superguy' ,
'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 Preencoded Passwords
#@TestName Enable Pre-encoded Passwords in pwd policy
#@TestIssue none
#@TestPurpose Admin Enabling Preencoded Passwords
#@TestPreamble none
#@TestStep set allow-pre-encoded-passwords to true
#@TestPostamble none
#@TestResult Success if the test is PASS
-->
<function name="pwp_preemcoded_pwds_003" scope="local">
<testcase name="getTestCaseName('PWP Enable Preencoded Passwords')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Set Allow Pre-encoded Password to true.' % msg1 }
</call>
<script>
options=[]
options.append('--policy-name "Default Password Policy"')
options.append('--set "allow-pre-encoded-passwords: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>
</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 Preencoded Passwords
#@TestName Test Enabled Pre-encoded Passwords
#@TestIssue none
#@TestPurpose Test Enabled Pre-encoded Passwords
#@TestPreamble none
#@TestStep addEntry add_entry_preencoded_pwd.ldif RC 0
SearchObject returns 0
#@TestPostamble none
#@TestResult Success if the test is PASS
-->
<function name="pwp_preemcoded_pwds_004" scope="local">
<testcase name="getTestCaseName('PWP Enabled - Add New Entry')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Add New Entry With Pre-encoded Password.' % msg1 }
</call>
<call function="'addEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'entryToBeAdded' : '%s/password_policy/add_entry_preencoded_pwd.ldif' \
% remote.data }
</call>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=pguy,%s' % basedn ,
'dsInstancePswd' : 'superguy' ,
'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 Preencoded Passwords
#@TestName Reset Pre-encoded Passwords
#@TestIssue none
#@TestPurpose Admin Reset Pre-encoded Passwords
#@TestPreamble none
#@TestStep Disable Pre-encoded Passwords 0
SearchObject returns 49
#@TestPostamble none
#@TestResult Success if the test is PASS
-->
<function name="pwp_preemcoded_pwds_005" scope="local">
<testcase name="getTestCaseName('PWP Disable Preencoded Passwords')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Reset Allow Pre-encoded Password.' % msg1 }
</call>
<script>
options=[]
options.append('--policy-name "Default Password Policy"')
options.append('--reset "allow-pre-encoded-passwords"')
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="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=pgal,%s' % basedn ,
'dsInstancePswd' : 'supergal' ,
'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>
</stax>