dsconfig_get_tests.xml revision da97433d5cd26e422a370d186f98659383c06721
<?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 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<function name="dsconfig_get_001" scope="local">
<function-prolog>
This function modifies a property value using dsconfig
</function-prolog>
<function-map-args>
<function-arg-def name="componentList"
type="required">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
</function-map-args>
<sequence>
<iterate var="dummyIndex" in="componentList">
<sequence>
<script>
# avoid same testName by incrementing the number
thisTestname = "%s.%s, %s" % (i,componentList[componentNumber][0],componentList[componentNumber][2])
i+=1
</script>
<message>'TRACE %s' % thisTestname</message>
<testcase name="getTestCaseName(thisTestname)" >
<try>
<sequence>
<call function="'testCase_Preamble'" />
<message>
'Getting component %s, %s, %s, %s, %s' % (componentList[componentNumber][0], componentList[componentNumber][1], componentList[componentNumber][2], componentList[componentNumber][3], componentList[componentNumber][4])
</message>
<if expr="componentList[componentNumber][0] == 'get-local-db-index-prop'">
<call function="'dsconfig'">
{
'dsInstanceHost' : server.host ,
'dsInstanceDn' : server.dn ,
'dsInstancePswd' : server.password ,
'subcommand' : '%s' % componentList[componentNumber][0] ,
'objectType' : '%s' % componentList[componentNumber][1] ,
'objectName' : '%s' % componentList[componentNumber][2] ,
'optionsString' : '--backend-name %s' % DIRECTORY_INSTANCE_BE ,
'expectedRC' : 0
}
</call>
<else>
<call function="'dsconfig'">
{
'dsInstanceHost' : server.host ,
'dsInstanceDn' : server.dn ,
'dsInstancePswd' : server.password ,
'subcommand' : '%s' % componentList[componentNumber][0] ,
'objectType' : '%s' % componentList[componentNumber][1] ,
'objectName' : '%s' % componentList[componentNumber][2] ,
'expectedRC' : 0
}
</call>
</else>
</if>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : componentList[componentNumber][3] ,
'expectedResult' : '1' }
</call>
<call function="'checktestString'">
{ 'returnString' : returnString ,
'expectedString' : componentList[componentNumber][4] }
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
<script>
componentNumber=componentNumber+1
</script>
</sequence>
</iterate>
</sequence>
</function>
<function name="dsconfig_get_002" scope="local">
<function-prolog>
This function modifies a property value using dsconfig
</function-prolog>
<function-map-args>
<function-arg-def name="componentList"
type="required">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
</function-map-args>
<sequence>
<iterate var="dummyIndex" in="componentList">
<sequence>
<script>
thisTestname = componentList[componentNumber][0]
</script>
<testcase name="getTestCaseName(thisTestname)" >
<try>
<sequence>
<call function="'testCase_Preamble'" />
<message>
'Getting component %s, %s, %s' % (componentList[componentNumber][0], componentList[componentNumber][1], componentList[componentNumber][2])
</message>
<call function="'dsconfig'">
{
'dsInstanceHost' : server.host ,
'dsInstanceDn' : server.dn ,
'dsInstancePswd' : server.password ,
'subcommand' : '%s' % componentList[componentNumber][0] ,
'expectedRC' : 0
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : componentList[componentNumber][1] ,
'expectedResult' : '1' }
</call>
<call function="'checktestString'">
{ 'returnString' : returnString ,
'expectedString' : componentList[componentNumber][2] }
</call>
</sequence>
<catch exception="'STAXException.*'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<call function="'testCase_Postamble'"/>
</finally>
</try>
</testcase>
<script>
componentNumber=componentNumber+1
</script>
</sequence>
</iterate>
</sequence>
</function>
</stax>