<?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 2007-2009 Sun Microsystems, Inc.
! Portions Copyright 2011 ForgeRock AS.
! -->
<stax>
<function name="dsconfig_list_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>
dsconfig_subcommand = componentList[componentNumber][0].strip()
dsconfig_component1 = componentList[componentNumber][1].strip()
dsconfig_component2 = componentList[componentNumber][2].strip()
</script>
<testcase name="getTestCaseName(componentList[componentNumber][0])" >
<try>
<sequence>
<call function="'testCase_Preamble'" />
<message>
'Listing component %s, %s, %s' \
% (dsconfig_subcommand, dsconfig_component1, dsconfig_component2)
</message>
<if expr="componentList[componentNumber][0] == 'list-local-db-indexes'">
<call function="'dsconfig'">
{
'dsInstanceHost' : server.host ,
'dsInstanceDn' : server.dn ,
'dsInstancePswd' : server.password ,
'subcommand' : '%s' % dsconfig_subcommand ,
'objectType' : 'backend-name' ,
'objectName' : server.backend ,
'expectedRC' : 0
}
</call>
<else>
<call function="'dsconfig'">
{
'dsInstanceHost' : server.host ,
'dsInstanceDn' : server.dn ,
'dsInstancePswd' : server.password ,
'subcommand' : '%s' % dsconfig_subcommand ,
'expectedRC' : 0
}
</call>
</else>
</if>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : dsconfig_component1 ,
'expectedResult' : '1' }
</call>
<call function="'checktestString'">
{ 'returnString' : returnString ,
'expectedString' : dsconfig_component2 }
</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>