<?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_ldapdelete_checkbehavior"/>
<function name="clu_ldapdelete_checkbehavior">
<sequence>
<block name="'clu_ldapdelete_checkbehavior'">
<try>
<sequence>
<!--- Test Suite information
#@TestSuiteName ldapdelete check behavior tests
#@TestSuitePurpose Test the results of the ldapdelete command.
#@TestSuiteGroup ldapdelete check behavior tests
#@TestScript clu_ldapdelete_checkresults.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, dsfilter and dsdn -->
<script>
basedn = 'ou=ldapdelete,o=clu tests,dc=example,dc=com'
dsfilter = 'uid=user.0'
dsdn = '%s,%s' % (dsfilter , basedn)
</script>
<!--- Test Case information
#@TestMarker ldapdelete check behavior tests
#@TestName ldapdelete: delete an entry
#@TestIssue none
#@TestPurpose Test ldapdelete with correct options.
#@TestPreamble none
#@TestStep Check using ldapsearch that "uid=user.0"
entry is present.
#@TestStep Delete this entry using ldapdelete.
#@TestStep Check using ldapsearch that this entry is no
more present.
#@TestPostamble none
#@TestResult Success if the "uid=user.0" entry is deleted.
-->
<!-- Active RC check once the TDB issue will be fixed -->
<testcase name="getTestCaseName('ldapdelete: delete an entry')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'ldapdelete: delete an entry'
</message>
<call function="'ldapSearchWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsCountEntries' : 'True' ,
'dsBaseDN' : basedn ,
'dsFilter' : dsfilter ,
'expectedRC' : 'noCheck'
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : 'Total number of matching entries: 1'
}
</call>
<call function="'ldapDeleteWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsDn' : ['%s' % dsdn]
}
</call>
<call function="'ldapSearchWithScript'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsCountEntries' : 'True' ,
'dsBaseDN' : basedn ,
'dsFilter' : dsfilter ,
'expectedRC' : 'noCheck'
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : 'Total number of matching entries: 0'
}
</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>