clu_ldappasswordmodify_checkbehavior.xml revision d81978a0815d5b8a75633c35e3e1f8708d36f017
<?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, exclude this CDDL HEADER in each
! file and exclude 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 2008 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="clu_ldappasswordmodify_checkbehavior"/>
<function name="clu_ldappasswordmodify_checkbehavior">
<sequence>
<block name="'clu_ldappasswordmodify_checkbehavior'">
<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'"/>
<!--- 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 0.
-->
<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' : 'dn:uid=user.0,%s' % basedn ,
'dsInstancePswd' : 'newpassword' ,
'dsAuthzID' : 'dn:uid=user.1,%s' % basedn ,
'dsNewPassword' : 'newpassword' ,
'expectedRC' : 49
}
</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>
<call function="'testSuite_Postamble'"/>
</sequence>
</block>
</sequence>
</function>
</stax>