clu_list-backends_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_list-backends_checkbehavior"/>
<function name="clu_list-backends_checkbehavior">
<sequence>
<block name="'clu_list-backends_checkbehavior'">
<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'"/>
<!--- 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' : 'userRoot : dc=com'
}
</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 \'userRoot\''
</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' : 'userRoot' ,
'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 2594
#@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>
<script>
knownIssue(2594)
</script>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<call function="'testSuite_Postamble'"/>
</sequence>
</block>
</sequence>
</function>
</stax>