<?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_list-backends_checkbehavior"/>
<function name="clu_list-backends_checkbehavior">
<sequence>
<block name="'clu_list-backends_checkbehavior'">
<try>
<sequence>
<!--- Test Suite information
#@TestSuiteName list-backends check behavior tests
#@TestSuitePurpose Test the results of the list-backends command.
#@TestSuiteGroup list-backends check behavior tests
#@TestScript clu_list-backends_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>
<!--- Test Case information
#@TestMarker list-backends check behavior tests
#@TestName list-backends: without option
#@TestIssue none
#@TestPurpose Test list-backends without option.
#@TestPreamble none
#@TestStep Do an list-backends without option.
#@TestPostamble none
#@TestResult Success if list-backends returns 0 and the
ouput is correct.
-->
<testcase name="getTestCaseName
('list-backends: without option')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'list-backends: without option'
</message>
<call function="'listBackendsWithScript'">
{}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : 'config : cn=config'
}
</call>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : '%s : dc=com' % DIRECTORY_INSTANCE_BE
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker list-backends check behavior tests
#@TestName list-backends: backendID option
#@TestIssue none
#@TestPurpose Test list-backends with backendID option.
#@TestPreamble none
#@TestStep Do an list-backends with backendID option.
#@TestPostamble none
#@TestResult Success if list-backends returns 0 and the
ouput is correct.
-->
<testcase name="getTestCaseName
('list-backends: backendID option')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'list-backends: backendID option'
</message>
<call function="'listBackendsWithScript'">
{
'dsBackendID' : 'schema'
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : 'schema : cn=schema'
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker list-backends check behavior tests
#@TestName list-backends: baseDN option
#@TestIssue none
#@TestPurpose Test list-backends with baseDN option.
#@TestPreamble none
#@TestStep Do an list-backends with basedDN option.
#@TestPostamble none
#@TestResult Success if list-backends returns 0 and the
ouput is correct.
-->
<testcase name="getTestCaseName
('list-backends: baseDN option')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'list-backends: baseDN option'
</message>
<call function="'listBackendsWithScript'">
{
'dsBaseDN' : 'dc=com'
}
</call>
<script>
returnString = STAXResult[0][1]
msg1 = 'The provided DN \'dc=com\' is a base DN'
msg2 = 'for backend \'%s\'' % DIRECTORY_INSTANCE_BE
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : '%s %s' % (msg1, msg2)
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker list-backends check behavior tests
#@TestName list-backends: backendID and baseDN options
#@TestIssue none
#@TestPurpose Test list-backends with backendID and
baseDN options
#@TestPreamble none
#@TestStep Do an list-backends with backendID and
baseDN options.
#@TestPostamble none
#@TestResult Success if list-backends returns 1 and the
ouput is correct.
-->
<testcase name="getTestCaseName
('list-backends: backendID and baseDN options')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'list-backends: backendID and baseDN options'
</message>
<call function="'listBackendsWithScript'">
{
'dsBackendID' : DIRECTORY_INSTANCE_BE ,
'dsBaseDN' : 'dc=com' ,
'expectedRC' : 1
}
</call>
<script>
returnString = STAXResult[0][1]
msg1 = 'You may not provide both the --backendID'
msg2 = 'and the --baseDN arguments'
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : '%s %s' % (msg1, msg2)
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker list-backends check behavior tests
#@TestName list-backends: invalid backendID
#@TestIssue none
#@TestPurpose Test list-backends with an invalid backendID
#@TestPreamble none
#@TestStep Do an list-backends with an invalid backendID
#@TestPostamble none
#@TestResult Success if list-backends returns 1 and the
ouput is correct.
-->
<testcase name="getTestCaseName
('list-backends: invalid backendID')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'list-backends: invalid backendID'
</message>
<call function="'listBackendsWithScript'">
{
'dsBackendID' : 'mybackend' ,
'expectedRC' : 1
}
</call>
<script>
returnString = STAXResult[0][1]
msg1 = 'There is no backend with ID \'mybackend\' in the'
msg2 = 'server configuration'
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : '%s %s' % (msg1, msg2)
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker list-backends check behavior tests
#@TestName list-backends: invalid baseDN
#@TestIssue none
#@TestPurpose Test list-backends with an invalid baseDN
#@TestPreamble none
#@TestStep Do an list-backends with an invalid baseDN.
#@TestPostamble none
#@TestResult Success if list-backends returns 1 and the
ouput is correct.
-->
<testcase name="getTestCaseName
('list-backends: invalid baseDN')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'list-backends: invalid baseDN'
</message>
<call function="'listBackendsWithScript'">
{
'dsBaseDN' : 'dc=mybasedn' ,
'expectedRC' : 1
}
</call>
<script>
returnString = STAXResult[0][1]
msg1 = 'The provided DN \'dc=mybasedn\' is not a base DN'
msg2 = 'for any backend configured in the Directory Server'
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : '%s %s' % (msg1, msg2)
}
</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>