security_pwd_SSHA.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 2006-2008 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="pwd_SSHA"/>
<function name="pwd_SSHA">
<!---
Place suite-specific test information here.
#@TestSuiteName SSHA Tests
#@TestSuitePurpose Test the SSHA storage scheme.
#@TestSuiteGroup SSHA Storage Scheme Tests
#@TestScript security_pwd_SSHA.xml
-->
<sequence>
<!--- Admin Check Existence of ds-cfg-default-password-storage-scheme Attr -->
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker SSHA Tests
#@TestName SSHA Preamble
#@TestIssue 313
#@TestPurpose Check for the default storage scheme. SSHA.
#@TestPreamble none
#@TestStep Client calls ldapcompare
with the attribute, ds-cfg-default-password-storage-scheme,
and value, SSHA.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0
-->
<testcase name="getTestCaseName('SSHA - Preamble')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Security: Pwd Storage SSHA: Preamble - Checking existence of ds-cfg-default-password-storage-scheme'
</message>
<call function="'compareEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'attrToBeCompared' : 'ds-cfg-default-password-storage-scheme:cn=Salted SHA-1,cn=Password Storage Schemes,cn=config',
'entryToBeCompared' : 'cn=Default Password Policy,cn=Password Policies,cn=config' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case : Default SSHA Scheme-->
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker SSHA Tests
#@TestName SSHA Default Test
#@TestIssue 313
#@TestPurpose Test the default, SSHA, password storage scheme.
#@TestPreamble none
#@TestStep Admin retrieves a user's password and
checks for the required {SSHA} prefix.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0 for the ldap
operations and the password has the {SSHA} prefix.
-->
<testcase name="getTestCaseName('SSHA - Default SSHA Scheme')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Security: Pwd Storage SSHA: Default SSHA Scheme'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsBaseDN' : 'uid=scarter,ou=people,ou=password tests,o=Pwd Storage Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'userpassword' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{ 'returnString' : returnString ,
'expectedString' : '{SSHA}' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case : User Change Password SSHA Scheme-->
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker SSHA Tests
#@TestName SSHA Test 1
#@TestIssue 313
#@TestPurpose Test SSHA password storage scheme.
#@TestPreamble none
#@TestStep Admin changes a user's password to convert
so it is stored as SSHA scheme.
#@TestStep The user binds with the new password.
#@TestStep Admin retrieves the user's password and
checks for the required {SSHA} prefix.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0 for the ldap
operations and the password has the {SSHA} prefix.
-->
<testcase name="getTestCaseName('SSHA - Pwd Change')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Security: Pwd Storage SSHA: User Changing Password'
</message>
<call function="'modifyAnAttribute'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=scarter,ou=people,ou=password tests,o=Pwd Storage Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'sprain' ,
'DNToModify' : 'uid=scarter,ou=people,ou=password tests,o=Pwd Storage Tests,dc=example,dc=com' ,
'attributeName' : 'userpassword' ,
'newAttributeValue' : 'SSHAsprain' ,
'changetype' : 'replace' }
</call>
<message>
'Security: Pwd Storage SSHA: User Binding With New Password'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=scarter,ou=people,ou=password tests,o=Pwd Storage Tests,dc=example,dc=com' ,
'dsInstancePswd' : 'SSHAsprain' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' }
</call>
<message>
'Security: Pwd Storage SSHA: Checking for SSHA Scheme On New Password'
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsBaseDN' : 'uid=scarter,ou=people,ou=password tests,o=Pwd Storage Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'userpassword' }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{ 'returnString' : returnString ,
'expectedString' : '{SSHA}' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case : User Change Password SSHA Scheme-->
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker SSHA Tests
#@TestName SSHA Unsupported Scheme Test
#@TestIssue 313
#@TestPurpose Test an unsupported storage scheme.
#@TestPreamble none
#@TestStep Admin changes to an unsupported storage scheme.
#@TestPostamble none
#@TestResult Success if OpenDS returns 53.
-->
<testcase name="getTestCaseName('SSHA - Unsupported Scheme')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Security: Pwd Storage SSHA: Admin Changing to Unsupported Scheme'
</message>
<call function="'modifyPwdPolicy'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'propertyName' : 'Default Password Policy' ,
'attributeName' : 'default-password-storage-scheme' ,
'attributeValue' : 'BAD' ,
'expectedRC' : 1 }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
</sequence>
</function>
</stax>