security_mult_validators.xml revision d25372dc8e65a9ed019a88fdf659ca61313f1b31
<?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 2007-2008 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="mult_validators"/>
<function name="mult_validators">
<sequence>
<!--- Test Suite information
#@TestSuiteName Multiple Validators
#@TestSuitePurpose Check Multiple Validators
#@TestSuiteGroup Multiple Validators
#@TestScript security_mult_validators.xml
-->
<!--- Define default value for basedn -->
<script>
basedn1 = 'ou=people,ou=password tests,'
basedn = '%s o=Pwd Validator Tests,dc=example,dc=com' % basedn1
msg = 'Security: Pwd Validator: Multiple Validators:'
msg1 = '--set enabled:true --set test-reversed-password:true '
</script>
<!--- Test Case information
#@TestMarker Multiple Validators
#@TestName Multiple Validators: Preamble
#@TestIssue none
#@TestPurpose Preamble Enabling Multiple Validators
#@TestPreamble none
#@TestStep Admin Enabling one validator set password-validator
to Attribute Value
#@TestStep Admin creating a custom validator
Custom Attribute Value
#@TestStep Admin enabling custom validator
#@TestStep Admin enabling third validator set
password-validator to Repeated Characters
#@TestPostamble none
#@TestResult Success if the 4 tests are PASS
-->
<testcase name="getTestCaseName('Multiple Validators: Preamble')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'%s Preamble Step 1. Admin enabling one validator' % msg
</message>
<call function="'modifyPwdPolicy'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'propertyName' : 'Default Password Policy' ,
'attributeName' : 'password-validator' ,
'attributeValue' : 'Attribute Value' }
</call>
<message>
'%s Preamble Step 2. Admin creating a custom validator' % msg
</message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'create-password-validator' ,
'objectType' : 'validator-name' ,
'objectName' : 'Custom Attribute Value',
'optionsString' : '--type attribute-value %s ' % msg1,
'expectedRC' : 0 }
</call>
<message>
'%s Preamble Step 3. Admin enabling custom validator' % msg
</message>
<call function="'dsconfigSet'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'objectName' : 'password-policy' ,
'propertyType' : 'policy' ,
'propertyName' : 'Default Password Policy' ,
'attributeName' : 'password-validator' ,
'attributeValue' : 'Custom Attribute Value' ,
'modifyType' : 'add' }
</call>
<message>
'%s Preamble Step 4. Admin enabling third validator' % msg
</message>
<call function="'dsconfigSet'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'objectName' : 'password-policy' ,
'propertyType' : 'policy' ,
'propertyName' : 'Default Password Policy' ,
'attributeName' : 'password-validator' ,
'attributeValue' : 'Repeated Characters' ,
'modifyType' : 'add' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Multiple Validators
#@TestName Multiple Validators: add attribute sn to one
validator
#@TestIssue none
#@TestPurpose add attribute sn to one validator
#@TestPreamble none
#@TestStep add attribute sn to one validator
#@TestPostamble none
#@TestResult Success if the test is PASS
-->
<testcase name="getTestCaseName
('Multiple Validators: add attribute sn to one validator')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'%s add attribute sn to one validator' % msg
</message>
<call function="'modifyPwdValidator'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'propertyName' : 'Attribute Value' ,
'attributeName' : 'match-attribute' ,
'attributeValue' : 'sn' ,
'modifyType' : 'add' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Multiple Validators
#@TestName Multiple Validators: user modifying password to sn
#@TestIssue none
#@TestPurpose user modifying password to sn
#@TestPreamble none
#@TestStep user modifying password to sn RC 53
#@TestStep user binding with invalid password RC 49
#@TestPostamble none
#@TestResult Success if the 2 tests are PASS
-->
<testcase name="getTestCaseName
('Multiple Validators: user modifying password to sn')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'%s user modifying password to sn' % msg
</message>
<call function="'ldapPasswordModifyWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=cschmith,%s' % basedn,
'dsInstancePswd' : 'hypotenuse' ,
'dsAuthzID' : 'dn:uid=cschmith, %s' % basedn ,
'dsNewPassword' : 'Schmith' ,
'expectedRC' : 53 }
</call>
<message>
'%s user binding with invalid password' % msg
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=cschmith,%s' % basedn,
'dsInstancePswd' : 'Schmith' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base',
'expectedRC' : 49 }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Multiple Validators
#@TestName Multiple Validators: add attribute givenName
to custom validator
#@TestIssue none
#@TestPurpose add attribute givenName to custom validator
#@TestPreamble none
#@TestStep for the custom validator Custom Attribute Value
set match-attribute to givenName
#@TestPostamble none
#@TestResult Success if the test is PASS
-->
<testcase name="getTestCaseName
('Multiple Validators: add attribute givenName to custom validator')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'%s add attribute sn to one validator' % msg
</message>
<call function="'modifyPwdValidator'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'propertyName' : 'Custom Attribute Value' ,
'attributeName' : 'match-attribute' ,
'attributeValue' : 'givenName' ,
'modifyType' : 'add' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Multiple Validators
#@TestName Multiple Validators: user modifying password to
givenName
#@TestIssue none
#@TestPurpose user modifying password to givenName
#@TestPreamble none
#@TestStep user modifying password to givenName RC 53
#@TestStep user binding with invalid password RC 49
#@TestPostamble none
#@TestResult Success if the 2 tests are PASS
-->
<testcase name="getTestCaseName
('Multiple Validators: user modifying password to givenName')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'%s user modifying password to givenName' % msg
</message>
<call function="'modifyAnAttribute'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=cschmith,%s' % basedn,
'dsInstancePswd' : 'hypotenuse' ,
'DNToModify' : 'uid=cschmith, %s' % basedn,
'attributeName' : 'userpassword' ,
'newAttributeValue' : 'Chris' ,
'changetype' : 'replace' ,
'expectedRC' : 53 }
</call>
<message>
'%s user binding with invalid password' % msg
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=dmiller,%s' % basedn,
'dsInstancePswd' : 'Chris' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base',
'expectedRC' : 49 }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Multiple Validators
#@TestName Multiple Validators: user modifying password to
aaaaaa
#@TestIssue none
#@TestPurpose user modifying password to aaaaaa
#@TestPreamble none
#@TestStep user modifying password to aaaaaa RC 53
#@TestStep user binding with invalid password RC 49
#@TestPostamble none
#@TestResult Success if the 2 tests are PASS
-->
<testcase name="getTestCaseName
('Multiple Validators: user modifying password to aaaaaa')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'%s user modifying password to aaaaaa' % msg
</message>
<call function="'modifyAnAttribute'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=cschmith,%s' % basedn,
'dsInstancePswd' : 'hypotenuse' ,
'DNToModify' : 'uid=cschmith, %s' % basedn ,
'attributeName' : 'userpassword' ,
'newAttributeValue' : 'aaaaaa' ,
'changetype' : 'replace' ,
'expectedRC' : 53 }
</call>
<message>
'%s user binding with invalid password' % msg
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=dmiller,%s' % basedn ,
'dsInstancePswd' : 'aaaaaa' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base',
'expectedRC' : 49 }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Multiple Validators
#@TestName Multiple Validators: Postamble
#@TestIssue none
#@TestPurpose Postamble: Admin resetting pwd validator
#@TestPreamble none
#@TestStep Admin Resetting password-validator
#@TestStep User Changing Password to sn RC 0
#@TestStep User binding with valid password RC 0
#@TestStep User Changing Password to givenName RC 0
#@TestStep User binding with valid password RC 0
#@TestStep User Changing Password to aaaaaa RC 0
#@TestStep User binding with valid password RC 0
#@TestPostamble none
#@TestResult Success if the 2 tests are PASS
-->
<testcase name="getTestCaseName('Multiple Validators: Postamble')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'%s Postamble Step 1. Admin Resetting password-validator' % msg
</message>
<call function="'modifyPwdPolicy'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'propertyName' : 'Default Password Policy' ,
'attributeName' : 'password-validator' ,
'modifyType' : 'reset' }
</call>
<!--- User Change Password -->
<message>
'%s Postamble Step 2. User Changing Password to sn' % msg
</message>
<call function="'modifyAnAttribute'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=cschmith,%s' % basedn,
'dsInstancePswd' : 'hypotenuse' ,
'DNToModify' : 'uid=cschmith, %s' % basedn,
'attributeName' : 'userpassword' ,
'newAttributeValue' : 'Schmith' ,
'changetype' : 'replace' }
</call>
<message>
'%s Postamble Step 3. User Searching With Password' % msg
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=cschmith,%s' % basedn,
'dsInstancePswd' : 'Schmith' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' }
</call>
<message>
'%s Postamble Step 4. User Changing Password to givenName' % msg
</message>
<call function="'modifyAnAttribute'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=cschmith,%s' % basedn,
'dsInstancePswd' : 'Schmith' ,
'DNToModify' : 'uid=cschmith, %s' % basedn,
'attributeName' : 'userpassword' ,
'newAttributeValue' : 'Chris' ,
'changetype' : 'replace' }
</call>
<message>
'%s Postamble Step 5. User Searching With Password' % msg
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=cschmith,%s' % basedn,
'dsInstancePswd' : 'Chris' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' }
</call>
<message>
'%s Postamble Step 6. User Changing Password to aaaaaa' % msg
</message>
<call function="'modifyAnAttribute'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=cschmith,%s' % basedn,
'dsInstancePswd' : 'Chris' ,
'DNToModify' : 'uid=cschmith, %s' % basedn,
'attributeName' : 'userpassword' ,
'newAttributeValue' : 'aaaaaa' ,
'changetype' : 'replace' }
</call>
<message>
'%s Postamble Step 7. User Searching With Password' % msg
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=cschmith,%s' % basedn,
'dsInstancePswd' : 'aaaaaa' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
</sequence>
</function>
</stax>