security_test_account.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, 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="test_account"/>
<function name="test_account">
<sequence>
<!--- Test Suite information
#@TestSuiteName Test Account
#@TestSuitePurpose Test Account Status
#@TestSuiteGroup Test Account
#@TestScript security_test_account.xml
-->
<!--- Define default value for basedn -->
<script>
basedn1 = 'ou=people,ou=activation tests,o=Account Activation Tests'
basedn = '%s, dc=example,dc=com' % basedn1
msg = 'Security: Account Activation:'
</script>
<!--- Test Case information
#@TestMarker Test Account
#@TestName Test Account: Preamble
#@TestIssue none
#@TestPurpose Preamble : User Bind Before Deactivation
#@TestPreamble none
#@TestStep Check account is Enabled with manage-account
#@TestStep User scarter binds RC 0
#@TestPostamble none
#@TestResult Success if the 2 tests are PASS
-->
<testcase name="getTestCaseName('Preamble')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'%s Preamble - Step 1. Check account is Enabled ' % msg
</message>
<call function="'manageAccountWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'get-account-is-disabled' ,
'targetDn' : 'uid=scarter,%s' % basedn }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{ 'returnString' : returnString ,
'expectedString' : 'Account Is Disabled: false' }
</call>
<message>
'%s Preamble - Step 2. Checking User Bind Before Deactivation' % msg
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=scarter,%s' % basedn ,
'dsInstancePswd' : 'sprain' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Test Account
#@TestName Test Account: Admin Deactivating User
#@TestIssue none
#@TestPurpose Admin Deactivating User
#@TestPreamble none
#@TestStep Disabling account with manage-account
#@TestPostamble none
#@TestResult Success if the test is PASS
-->
<testcase name="getTestCaseName('Admin Deactivate User')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Security: Account Activation: Admin Deactivating User'
</message>
<call function="'manageAccountWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-account-is-disabled' ,
'dsOperationValue' : 'true' ,
'targetDn' : 'uid=scarter,%s' % basedn }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{ 'returnString' : returnString ,
'expectedString' : 'Account Is Disabled: true' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Test Account
#@TestName Test Account: User Binding After Deactivation
#@TestIssue none
#@TestPurpose User Binding After Deactivation
#@TestPreamble none
#@TestStep User scarter binds RC 49
#@TestPostamble none
#@TestResult Success if the test is PASS
-->
<testcase name="getTestCaseName('User Bind After Deactivation')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'%s User Binding After Deactivation' % msg
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=scarter,%s' % basedn,
'dsInstancePswd' : 'sprain' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base',
'expectedRC' : 49 }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Test Account
#@TestName Test Account: Admin Reactivating User
#@TestIssue none
#@TestPurpose Admin Reactivating User
#@TestPreamble none
#@TestStep Reenabling account with manage-account
#@TestStep User scarter binds RC 0
#@TestPostamble none
#@TestResult Success if the 2 tests are PASS
-->
<testcase name="getTestCaseName('Postamble')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'%s Postamble Step 1. Admin Reactivating User' % msg
</message>
<call function="'manageAccountWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'clear-account-is-disabled' ,
'targetDn' : 'uid=scarter,%s' % basedn }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{ 'returnString' : returnString ,
'expectedString' : 'Account Is Disabled: false' }
</call>
<message>
'%s Postamble Step 2. Checking User Bind After Reactivation' % msg
</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=scarter,%s' % basedn ,
'dsInstancePswd' : 'sprain' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
</sequence>
</function>
</stax>