b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky<?xml version="1.0" encoding="UTF-8" standalone="no"?>
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky<!--
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! CDDL HEADER START
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky !
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! The contents of this file are subject to the terms of the
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! Common Development and Distribution License, Version 1.0 only
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! (the "License"). You may not use this file except in compliance
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! with the License.
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky !
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! You can obtain a copy of the license at
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! See the License for the specific language governing permissions
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! and limitations under the License.
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky !
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! When distributing Covered Code, include this CDDL HEADER in each
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! file and include the License file at
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! add the following below this CDDL HEADER, with the fields enclosed
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! by brackets "[]" replaced with your own identifying information:
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! Portions Copyright [yyyy] [name of copyright owner]
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky !
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! CDDL HEADER END
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky !
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! Copyright 2006-2008 Sun Microsystems, Inc.
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! Portions copyright 2012 ForgeRock AS.
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky ! -->
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky<stax>
940d71d237794874e18a0eb72f6564821a823517eschrock
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky <!--- Test Case information
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky #@TestMarker Preencoded Passwords
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky #@TestName Get Preencoded Password
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky #@TestIssue none
b88e3eef9e58fa5cfbf3ff1075b84a2b87683634ky #@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>