<?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 legal-notices/CDDLv1_0.txt
! or http://forgerock.org/license/CDDLv1.0.html.
! 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 legal-notices/CDDLv1_0.txt.
! 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 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="clu_ldappasswordmodify_checkbehavior"/>
<function name="clu_ldappasswordmodify_checkbehavior">
<sequence>
<block name="'clu_ldappasswordmodify_checkbehavior'">
<try>
<sequence>
<!--- Test Suite information
#@TestSuiteName ldappasswordmodify check behavior tests
#@TestSuitePurpose Test the results of ldappasswordmodify
command.
#@TestSuiteGroup ldappasswordmodify check behavior tests
#@TestScript clu_ldappasswordmodify_checkbehavior.xml
-->
<script>
if not CurrentTestPath.has_key('group'):
CurrentTestPath['group'] = 'clu'
CurrentTestPath['suite'] = STAXCurrentBlock
</script>
<call function="'testSuite_Preamble'"/>
<call function="'common_setup'">
{
'quickStart' : False ,
'loadData' : True ,
'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
'startServer' : True ,
'stopServer' : False ,
'allowPreEncodePassword' : True
}
</call>
<!--- Define default value for basedn -->
<script>
basedn = 'ou=ldappasswordmodify,o=clu tests,dc=example,dc=com'
</script>
<!--- Test Case information
#@TestMarker ldappasswordmodify check behavior tests
#@TestName ldappasswordmodify: user can change his
own pwd
#@TestIssue none
#@TestPurpose Verify that a user can change his own
password.
#@TestPreamble none
#@TestStep Check that user.0 can do an ldapsearch.
#@TestStep Do an ldappasswordmodify to change user
password.
#@TestStep Check that user.0 can't do an ldapsearch with
his old password.
#@TestStep Check that user.0 can do an ldapsearch with
his new password.
#@TestPostamble none
#@TestResult Success if ldappasswordmodify returns 0.
-->
<testcase name="getTestCaseName
('ldappasswordmodify: user can change his own pwd')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'ldappasswordmodify: user can change his own pwd'
</message>
<call function="'ldapSearchWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=user.0,%s' % basedn ,
'dsInstancePswd' : 'password' ,
'dsTypesOnly' : 'True' ,
'dsBaseDN' : basedn ,
'dsFilter' : 'uid=user.*'
}
</call>
<call function="'ldapPasswordModifyWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsAuthzID' : 'dn:uid=user.0,%s' % basedn ,
'dsCurrentPassword' : 'password' ,
'dsNewPassword' : 'newpassword'
}
</call>
<call function="'ldapSearchWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=user.0,%s' % basedn ,
'dsInstancePswd' : 'password' ,
'dsTypesOnly' : 'True' ,
'dsBaseDN' : basedn ,
'dsFilter' : 'uid=user.*' ,
'expectedRC' : 49
}
</call>
<call function="'ldapSearchWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=user.0,%s' % basedn ,
'dsInstancePswd' : 'newpassword' ,
'dsTypesOnly' : 'True' ,
'dsBaseDN' : basedn ,
'dsFilter' : 'uid=user.*'
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker ldappasswordmodify check behavior tests
#@TestName ldappasswordmodify: user cannot modify pwd for
another user
#@TestIssue none
#@TestPurpose Verify that a user cannot modify the password
for another user.
#@TestPreamble none
#@TestStep Do an ldappasswordmodify to change user
password.
#@TestPostamble none
#@TestResult Success if ldappasswordmodify returns 50.
-->
<testcase name="getTestCaseName
('ldappasswordmodify: user cannot modify pwd for another user')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'ldappasswordmodify: user cannot modify pwd for another user'
</message>
<call function="'ldapPasswordModifyWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=user.0,%s' % basedn ,
'dsInstancePswd' : 'newpassword' ,
'dsAuthzID' : 'dn:uid=user.1,%s' % basedn ,
'dsNewPassword' : 'newpassword' ,
'expectedRC' : 50
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker ldappasswordmodify check behavior tests
#@TestName ldappasswordmodify: DM can modify pwd for
another user
#@TestIssue none
#@TestPurpose Verify that Directory Manager can change the
password of a user.
#@TestPreamble none
#@TestStep Check that user.0 can do an ldapsearch.
#@TestStep Do an ldappasswordmodify to change user
password.
#@TestStep Check that user.0 can't do an ldapsearch with
his old password.
#@TestStep Check that user.0 can do an ldapsearch with
his new password.
#@TestPostamble none
#@TestResult Success if ldappasswordmodify returns 0.
-->
<testcase name="getTestCaseName
('ldappasswordmodify: DM can modify pwd for another user')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'ldappasswordmodify: DM can modify pwd for another user'
</message>
<call function="'ldapSearchWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=user.1,%s' % basedn ,
'dsInstancePswd' : 'password' ,
'dsTypesOnly' : 'True' ,
'dsBaseDN' : basedn ,
'dsFilter' : 'uid=user.*'
}
</call>
<call function="'ldapPasswordModifyWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsAuthzID' : 'dn:uid=user.1,%s' % basedn ,
'dsNewPassword' : 'newpassword'
}
</call>
<call function="'ldapSearchWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=user.,%s' % basedn ,
'dsInstancePswd' : 'password' ,
'dsTypesOnly' : 'True' ,
'dsBaseDN' : basedn ,
'dsFilter' : 'uid=user.*' ,
'expectedRC' : 49
}
</call>
<call function="'ldapSearchWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=user.1,%s' % basedn ,
'dsInstancePswd' : 'newpassword' ,
'dsTypesOnly' : 'True' ,
'dsBaseDN' : basedn ,
'dsFilter' : 'uid=user.*'
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
</sequence>
<finally>
<sequence>
<!-- Test Suite Cleanup -->
<message>'Finally: Global CLU Cleanup.'</message>
<try>
<call function="'common_cleanup'" />
<catch exception="'STAFException'">
<sequence>
<message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
</sequence>
</catch>
<finally>
<call function="'testSuite_Postamble'"/>
</finally>
</try>
</sequence>
</finally>
</try>
</block>
</sequence>
</function>
</stax>