security_character_set.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="character_set"/>
<function name="character_set">
<sequence>
<!--- Test Suite information
#@TestSuiteName Character Set
#@TestSuitePurpose Reject Passwords Matching Character set
#@TestSuiteGroup Character Set
#@TestScript security_character_set.xml
-->
<!--- Define default value for basedn -->
<script>
basedn1 = 'ou=people,ou=password tests,'
basedn = '%s o=Pwd Validator Tests,dc=example,dc=com' % basedn1
val = 'cn=Character Set,cn=Password Validators,cn=config'
msg = 'Security: Pwd Validator: Character Set:'
</script>
<!--- Test Case information
#@TestMarker Character Set
#@TestName Character Set Preamble
#@TestIssue none
#@TestPurpose Character Set Preamble
#@TestPreamble none
#@TestStep Check ds-cfg-enabled exists
#@TestStep Admin Enabling Validator Character Set
#@TestPostamble none
#@TestResult Success if the 2 tests are PASS
-->
<testcase name="getTestCaseName('Character Set: Preamble')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'%s Preamble Step 1. Check ds-cfg-enabled exists' % msg
</message>
<call function="'compareEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'attrToBeCompared' : 'ds-cfg-enabled:true',
'entryToBeCompared' : val }
</call>
<message>
'%s Preamble Step 2. Admin Enabling 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' : 'Character Set' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Character Set
#@TestName Character Set : Pwd with all letters
#@TestIssue none
#@TestPurpose Pwd with all letters
#@TestPreamble none
#@TestStep user modifying password to string with all letters
RC 53
#@TestStep user binding with invalid password RC 49
#@TestPostamble none
#@TestResult Success if the 2 tests are PASS
-->
<testcase name="getTestCaseName
('Character Set: user modifying password to string with all letters')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'%s user modifying password to string with all letters' % msg
</message>
<call function="'ldapPasswordModifyWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=gfarmer,%s' % basedn,
'dsInstancePswd' : 'ruling' ,
'dsAuthzID' : 'dn:uid=gfarmer, %s' % basedn,
'dsNewPassword' : 'newruling' ,
'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=gfarmer,%s' % basedn,
'dsInstancePswd' : 'newruling' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base',
'expectedRC' : 49 }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Character Set
#@TestName Character Set : Pwd with all numbers
#@TestIssue none
#@TestPurpose Pwd with all numbers
#@TestPreamble none
#@TestStep user modifying password to string with all numbers
RC 53
#@TestStep user binding with invalid password RC 49
#@TestPostamble none
#@TestResult Success if the 2 tests are PASS
-->
<testcase name="getTestCaseName
('Character Set: user modifying password to string with all numbers')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'%s user modifying password to string with all numbers' % msg
</message>
<call function="'ldapPasswordModifyWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=gfarmer,%s' % basedn,
'dsInstancePswd' : 'ruling' ,
'dsAuthzID' : 'dn:uid=gfarmer, %s' % basedn,
'dsNewPassword' : '123456789' ,
'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=gfarmer,%s' % basedn,
'dsInstancePswd' : '123456789' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base',
'expectedRC' : 49 }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Character Set
#@TestName Character Set : Pwd with all letters
#@TestIssue none
#@TestPurpose Pwd with all letters
#@TestPreamble none
#@TestStep modifyPwdValidator character-set to 3:0123456789
#@TestStep modifyPwdValidator character-set to
1:ABCDEFGHIJKLMNOPQRSTUVWXYZ
#@TestStep modifyPwdValidator character-set to
3:abcdefghijklmnopqrstuvwxyz
#@TestPostamble none
#@TestResult Success if the 3 tests are PASS
-->
<testcase name="getTestCaseName('Character Set: change letter characters')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Security: Pwd Validator: Character Set: change letter characters'
</message>
<call function="'modifyPwdValidator'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'propertyName' : 'Character Set' ,
'attributeName' : 'character-set' ,
'attributeValue' : '3:0123456789' ,
'modifyType' : 'set' }
</call>
<call function="'modifyPwdValidator'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'propertyName' : 'Character Set' ,
'attributeName' : 'character-set' ,
'attributeValue' : '1:ABCDEFGHIJKLMNOPQRSTUVWXYZ' ,
'modifyType' : 'add' }
</call>
<call function="'modifyPwdValidator'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'propertyName' : 'Character Set' ,
'attributeName' : 'character-set' ,
'attributeValue' : '3:abcdefghijklmnopqrstuvwxyz' ,
'modifyType' : 'add' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Character Set
#@TestName Character Set : Pwd with just letters
#@TestIssue none
#@TestPurpose Pwd with just letters
#@TestPreamble none
#@TestStep user modifying password to string with just letters
RC 53
#@TestStep user binding with invalid password RC 49
#@TestPostamble none
#@TestResult Success if the 2 tests are PASS
-->
<testcase name="getTestCaseName
('Character Set: user modifying password to string with just letters 2')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'%s user modifying password to string with just letters 2' % msg
</message>
<call function="'ldapPasswordModifyWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=gfarmer,%s' % basedn,
'dsInstancePswd' : 'ruling' ,
'dsAuthzID' : 'dn:uid=gfarmer, %s' % basedn,
'dsNewPassword' : 'newruling' ,
'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=gfarmer,%s' % basedn,
'dsInstancePswd' : 'newruling' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base',
'expectedRC' : 49 }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Character Set
#@TestName Character Set : Pwd with just numbers
#@TestIssue none
#@TestPurpose Pwd with just numbers
#@TestPreamble none
#@TestStep user modifying password to string with just numbers
RC 53
#@TestStep user binding with invalid password RC 49
#@TestPostamble none
#@TestResult Success if the 2 tests are PASS
-->
<testcase name="getTestCaseName
('Character Set: user modifying password to string with just numbers 2')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'%s user modifying password to string with just numbers 2' % msg
</message>
<call function="'ldapPasswordModifyWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=gfarmer,%s' % basedn,
'dsInstancePswd' : 'ruling' ,
'dsAuthzID' : 'dn:uid=gfarmer, %s' % basedn,
'dsNewPassword' : '123456789' ,
'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=gfarmer,%s' % basedn ,
'dsInstancePswd' : '123456789' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base',
'expectedRC' : 49 }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Character Set
#@TestName Character Set : Pwd with a valid string
#@TestIssue none
#@TestPurpose Pwd with a valid string
#@TestPreamble none
#@TestStep user modifying password to a valid string RC 0
#@TestStep user binding with valid password RC 0
#@TestPostamble none
#@TestResult Success if the 2 tests are PASS
-->
<testcase name="getTestCaseName
('Character Set: user modifying password to valid string')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'%s user modifying password to valid string' % msg
</message>
<call function="'ldapPasswordModifyWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=gfarmer,%s' % basedn ,
'dsInstancePswd' : 'ruling' ,
'dsAuthzID' : 'dn:uid=gfarmer, %s' % basedn ,
'dsNewPassword' : 'Newruling123' , }
</call>
<message>
'%s user binding with valid password' % msg
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=gfarmer,%s' % basedn ,
'dsInstancePswd' : 'Newruling123' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Character Set
#@TestName Character Set : Disable Validator
#@TestIssue none
#@TestPurpose Disbale Validator
#@TestPreamble none
#@TestStep reset password-validator RC 0
#@TestStep set propertyName Character-Set to false
#@TestPostamble none
#@TestResult Success if the 2 tests are PASS
-->
<testcase name="getTestCaseName('Character Set: disable validator')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Security: Pwd Validator: Character Set: disable validator'
</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>
<call function="'modifyPwdValidator'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'propertyName' : 'Character Set' ,
'attributeName' : 'enabled' ,
'attributeValue' : 'false' ,
'modifyType' : 'set' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Character Set
#@TestName Character Set : Pwd with a valid string 2
#@TestIssue none
#@TestPurpose Pwd with a valid string 2
#@TestPreamble none
#@TestStep user modifying password to a valid string RC 0
#@TestStep user binding with valid password RC 0
#@TestPostamble none
#@TestResult Success if the 2 tests are PASS
-->
<testcase name="getTestCaseName
('Character Set: user modifying password to valid string 2')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'%s user modifying password to valid string 2' % msg
</message>
<call function="'ldapPasswordModifyWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=gfarmer,%s' % basedn,
'dsInstancePswd' : 'Newruling123' ,
'dsAuthzID' : 'dn:uid=gfarmer, %s' % basedn,
'dsNewPassword' : 'newruling' }
</call>
<message>
'%s user binding with valid password' % msg
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=gfarmer,%s' % basedn,
'dsInstancePswd' : 'newruling' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Character Set
#@TestName Character Set : Postamble
#@TestIssue none
#@TestPurpose Postamble
#@TestPreamble none
#@TestStep remove password-validator:Character Set
#@TestStep User Changing Password with just letters
#@TestStep User Searching Password with just letters
#@TestPostamble none
#@TestResult Success if the 2 tests are PASS
-->
<testcase name="getTestCaseName('Character Set: 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' ,
'attributeValue' : 'Character Set' ,
'modifyType' : 'remove' }
</call>
<!--- User Change Password -->
<message>
'%s Postamble Step 2. User Changing Password' % msg
</message>
<call function="'ldapPasswordModifyWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=gfarmer,%s' % basedn,
'dsInstancePswd' : 'newruling' ,
'dsAuthzID' : 'dn:uid=gfarmer, %s' % basedn,
'dsNewPassword' : 'newnewruling' }
</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=gfarmer,%s' % basedn,
'dsInstancePswd' : 'newnewruling' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
</sequence>
</function>
</stax>