<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<!DOCTYPE stax SYSTEM "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
|
!
|
! Portions Copyright 2006-2007 Sun Microsystems, Inc.
|
! -->
|
<stax>
|
<function name="addEntry">
|
<function-prolog>
|
This function adds an entry to the Directory Server from an ldif file
|
</function-prolog>
|
<function-map-args>
|
<function-arg-def name="location" type="optional" default="'%s' % STAF_REMOTE_HOSTNAME">
|
<function-arg-description>
|
Location of target host
|
</function-arg-description>
|
<function-arg-property name="type" value="hostname"/>
|
</function-arg-def>
|
<function-arg-def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
|
<function-arg-description>
|
Pathname to installation root
|
</function-arg-description>
|
<function-arg-property name="type" value="filepath"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstanceHost" type="optional">
|
<function-arg-description>
|
Directory server hostname or IP address
|
</function-arg-description>
|
<function-arg-property name="type" value="hostname"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstancePort" type="optional">
|
<function-arg-description>
|
Directory server port number
|
</function-arg-description>
|
<function-arg-property name="type" value="Port number"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstanceDn" type="optional">
|
<function-arg-description>
|
Bind DN
|
</function-arg-description>
|
<function-arg-property name="type" value="DN"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstancePswd" type="optional">
|
<function-arg-description>
|
Bind password
|
</function-arg-description>
|
<function-arg-property name="type" value="string"/>
|
</function-arg-def>
|
<function-arg-def name="entryToBeAdded" type="required">
|
<function-arg-description>
|
Entry to be added to Directory Server in ldif format
|
</function-arg-description>
|
<function-arg-property name="type" value="DN"/>
|
</function-arg-def>
|
<function-arg-def name="extraParams" type="optional">
|
<function-arg-description>
|
Optional extra parameters for specific test cases
|
</function-arg-description>
|
<function-arg-property name="type" value="string"/>
|
</function-arg-def>
|
</function-map-args>
|
<sequence>
|
|
<!-- Local variables -->
|
<script>
|
mylocation=location
|
</script>
|
|
<!-- Build the Command -->
|
<script>
|
STAFCmdParamsList=[]
|
STAFCmdParams=''
|
|
if dsPath:
|
dsBinPath='%s/%s' % (dsPath,fileFolder)
|
STAFCmd='%s/ldapmodify%s' % (dsBinPath,fileExt)
|
|
STAFCmdParamsList.append('-a')
|
</script>
|
|
<!-- Set common ldap arguments -->
|
<call function="'_ldapCommonArgs'"/>
|
|
<script>
|
if extraParams:
|
STAFCmdParamsList.append('%s' % extraParams)
|
|
if entryToBeAdded:
|
STAFCmdParamsList.append('-f "%s"' % entryToBeAdded)
|
|
STAFCmdParams=' '.join(STAFCmdParamsList)
|
</script>
|
|
<message>
|
'%s %s' % (STAFCmd, STAFCmdParams)
|
</message>
|
|
<process name="'Add Entry from ldif file'">
|
<location>'%s' % mylocation</location>
|
<command>'%s' % STAFCmd</command>
|
<parms>'%s' % STAFCmdParams</parms>
|
<workdir>'%s' % dsBinPath</workdir>
|
<envs>
|
['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
|
</envs>
|
<console use="'same'"/>
|
<stderr mode="'stdout'"/>
|
<returnstdout/>
|
</process>
|
|
<call function="'checkRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
|
</sequence>
|
|
</function>
|
|
<function name="modifyEntry">
|
<function-prolog>
|
This function modifies an entry in the Directory Server
|
</function-prolog>
|
<function-map-args>
|
<function-arg-def name="location" type="optional" default="'%s' % STAF_REMOTE_HOSTNAME">
|
<function-arg-description>
|
Location of target host
|
</function-arg-description>
|
<function-arg-property name="type" value="hostname"/>
|
</function-arg-def>
|
<function-arg-def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
|
<function-arg-description>
|
Pathname to installation root
|
</function-arg-description>
|
<function-arg-property name="type" value="filepath"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstanceHost" type="optional">
|
<function-arg-description>
|
Directory server hostname or IP address
|
</function-arg-description>
|
<function-arg-property name="type" value="hostname"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstancePort" type="optional">
|
<function-arg-description>
|
Directory server port number
|
</function-arg-description>
|
<function-arg-property name="type" value="Port number"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstanceDn" type="optional">
|
<function-arg-description>
|
Bind DN
|
</function-arg-description>
|
<function-arg-property name="type" value="DN"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstancePswd" type="optional">
|
<function-arg-description>
|
Bind password
|
</function-arg-description>
|
<function-arg-property name="type" value="string"/>
|
</function-arg-def>
|
<function-arg-def name="entryToBeModified" type="required">
|
<function-arg-description>
|
Entry to be modified in the Directory Server in ldif format
|
</function-arg-description>
|
<function-arg-property name="type" value="DN"/>
|
</function-arg-def>
|
<function-arg-def name="extraParams" type="optional">
|
<function-arg-description>
|
Optional extra parameters for specific test cases
|
</function-arg-description>
|
<function-arg-property name="type" value="string"/>
|
</function-arg-def>
|
</function-map-args>
|
<sequence>
|
|
<!-- Local variables -->
|
<script>
|
mylocation=location
|
</script>
|
|
<!-- Build the Command -->
|
<script>
|
STAFCmdParamsList=[]
|
STAFCmdParams=''
|
|
if dsPath:
|
dsBinPath='%s/%s' % (dsPath,fileFolder)
|
STAFCmd='%s/ldapmodify%s' % (dsBinPath,fileExt)
|
|
</script>
|
|
<!-- Set common ldap arguments -->
|
<call function="'_ldapCommonArgs'"/>
|
|
<script>
|
if extraParams:
|
STAFCmdParamsList.append('%s' % extraParams)
|
|
if entryToBeModified:
|
STAFCmdParamsList.append('-f "%s"' % entryToBeModified)
|
|
STAFCmdParams=' '.join(STAFCmdParamsList)
|
</script>
|
|
<message>
|
'%s %s' % (STAFCmd, STAFCmdParams)
|
</message>
|
|
<process name="'Modify Entry from ldif file'">
|
<location>'%s' % location</location>
|
<command>'%s' % STAFCmd</command>
|
<parms>'%s' % STAFCmdParams</parms>
|
<workdir>'%s' % dsBinPath</workdir>
|
<envs>
|
['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
|
</envs>
|
<console use="'same'"/>
|
<stderr mode="'stdout'"/>
|
<returnstdout/>
|
</process>
|
|
<call function="'checkRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
|
</sequence>
|
|
</function>
|
|
<function name="SearchObject">
|
<function-prolog>
|
This function searches the Directory Server with optional arguments possible
|
</function-prolog>
|
<function-map-args>
|
<function-arg-def name="location" type="optional" default="'%s' % STAF_REMOTE_HOSTNAME">
|
<function-arg-description>
|
Location of target host
|
</function-arg-description>
|
<function-arg-property name="type" value="hostname"/>
|
</function-arg-def>
|
<function-arg-def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
|
<function-arg-description>
|
Pathname to installation root
|
</function-arg-description>
|
<function-arg-property name="type" value="pathname"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstanceHost" type="optional">
|
<function-arg-description>
|
Directory Server Host Name
|
</function-arg-description>
|
<function-arg-property name="type" value="hostname"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstancePort" type="optional">
|
<function-arg-description>
|
Directory Server Port Number
|
</function-arg-description>
|
<function-arg-property name="type" value="integer"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstanceDn" type="optional">
|
<function-arg-description>
|
Directory Server Manager DN
|
</function-arg-description>
|
<function-arg-property name="type" value="dn"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstancePswd" type="optional">
|
<function-arg-description>
|
Directory Server Manager Password
|
</function-arg-description>
|
<function-arg-property name="type" value="string"/>
|
</function-arg-def>
|
<function-arg-def name="dsProxyDN" type="optional">
|
<function-arg-description>
|
Directory Server Proxy DN
|
</function-arg-description>
|
<function-arg-property name="type" value="dn"/>
|
</function-arg-def>
|
<function-arg-def name="dsScope" type="optional">
|
<function-arg-description>
|
The scope of the search operation
|
</function-arg-description>
|
<function-arg-property name="type" value="dn"/>
|
</function-arg-def>
|
<function-arg-def name="dsBaseDN" type="optional">
|
<function-arg-description>
|
The baseDN for the search operation
|
</function-arg-description>
|
<function-arg-property name="type" value="dn"/>
|
</function-arg-def>
|
<function-arg-def name="dsFilter" type="optional">
|
<function-arg-description>
|
The filter for the search operation
|
</function-arg-description>
|
<function-arg-property name="type" value="filter"/>
|
</function-arg-def>
|
<function-arg-def name="extraParams" type="optional">
|
<function-arg-description>
|
Optional extra parameters for specific test cases
|
</function-arg-description>
|
<function-arg-property name="type" value="filter"/>
|
</function-arg-def>
|
<function-arg-def name="attributes" type="optional">
|
<function-arg-description>
|
Optional Attributes to return
|
</function-arg-description>
|
<function-arg-property name="type" value="attributes"/>
|
</function-arg-def>
|
</function-map-args>
|
<sequence>
|
|
<!-- Local variables -->
|
<script>
|
mylocation=location
|
</script>
|
|
<!-- Build the Command -->
|
<script>
|
STAFCmdParamsList=[]
|
STAFCmdParams=''
|
|
if dsPath:
|
dsBinPath='%s/%s' % (dsPath,fileFolder)
|
STAFCmd='%s/ldapsearch%s' % (dsBinPath,fileExt)
|
|
</script>
|
|
<!-- Set common ldap arguments -->
|
<call function="'_ldapCommonArgs'"/>
|
|
<script>
|
if dsProxyDN:
|
STAFCmdParamsList.append('-Y "%s"' % dsProxyDN)
|
|
if dsScope:
|
STAFCmdParamsList.append('-s %s' % dsScope)
|
|
if extraParams:
|
STAFCmdParamsList.append('%s' % extraParams)
|
|
if dsBaseDN:
|
STAFCmdParamsList.append('-b "%s"' % dsBaseDN)
|
|
if dsFilter:
|
STAFCmdParamsList.append('"%s"' % dsFilter)
|
|
if attributes:
|
STAFCmdParamsList.append('%s' % attributes)
|
|
STAFCmdParams=' '.join(STAFCmdParamsList)
|
</script>
|
|
<message>
|
'%s %s' % (STAFCmd, STAFCmdParams)
|
</message>
|
|
<process name="'Search Base Object'">
|
<location>'%s' % location</location>
|
<command>'%s' % STAFCmd</command>
|
<parms>'%s' % STAFCmdParams</parms>
|
<workdir>'%s' % dsBinPath</workdir>
|
<envs>
|
['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
|
</envs>
|
<console use="'same'"/>
|
<stderr mode="'stdout'"/>
|
<returnstdout/>
|
</process>
|
|
<script>
|
SearchRC=RC
|
SearchResult=STAXResult
|
</script>
|
|
<call function="'checkRC'">
|
{ 'returncode' : SearchRC ,
|
'result' : SearchResult }
|
</call>
|
|
<return>SearchResult</return>
|
|
</sequence>
|
|
</function>
|
|
<function name="SearchObjectNoPwd">
|
<function-prolog>
|
This function searches the Directory Server with optional arguments possible
|
</function-prolog>
|
<function-map-args>
|
<function-arg-def name="location" type="optional" default="'%s' % STAF_REMOTE_HOSTNAME">
|
<function-arg-description>
|
Location of target host
|
</function-arg-description>
|
<function-arg-property name="type" value="hostname"/>
|
</function-arg-def>
|
<function-arg-def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
|
<function-arg-description>
|
Pathname to installation root
|
</function-arg-description>
|
<function-arg-property name="type" value="pathname"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstanceHost" type="optional">
|
<function-arg-description>
|
Directory Server Host Name
|
</function-arg-description>
|
<function-arg-property name="type" value="hostname"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstancePort" type="optional">
|
<function-arg-description>
|
Directory Server Port Number
|
</function-arg-description>
|
<function-arg-property name="type" value="integer"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstanceDn" type="optional">
|
<function-arg-description>
|
Directory Server Manager DN
|
</function-arg-description>
|
<function-arg-property name="type" value="dn"/>
|
</function-arg-def>
|
<function-arg-def name="dsBaseDN" type="optional">
|
<function-arg-description>
|
The baseDN for the search operation
|
</function-arg-description>
|
<function-arg-property name="type" value="dn"/>
|
</function-arg-def>
|
<function-arg-def name="dsFilter" type="optional">
|
<function-arg-description>
|
The filter for the search operation
|
</function-arg-description>
|
<function-arg-property name="type" value="filter"/>
|
</function-arg-def>
|
<function-arg-def name="extraParams" type="optional">
|
<function-arg-description>
|
Optional extra parameters for specific test cases
|
</function-arg-description>
|
<function-arg-property name="type" value="filter"/>
|
</function-arg-def>
|
</function-map-args>
|
<sequence>
|
<message>
|
'ldapsearch%s -h %s -p %s -D "%s" %s -b "%s" "%s"' % (fileExt,dsInstanceHost,dsInstancePort,dsInstanceDn,extraParams,dsBaseDN,dsFilter)
|
</message>
|
<process name="'Search Base Object No Password'">
|
<location>'%s' % location </location>
|
<command>'%s/ldapsearch%s' % (dsBinPath,fileExt)</command>
|
<parms>'-h %s -p %s -D "%s" %s -b "%s" "%s"' % (dsInstanceHost,dsInstancePort,dsInstanceDn,extraParams,dsBaseDN,dsFilter)</parms>
|
<workdir>'%s' % dsBinPath</workdir>
|
<envs>
|
['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
|
</envs>
|
<stderr mode="'stdout'"/>
|
<returnstdout/>
|
</process>
|
</sequence>
|
</function>
|
|
<function name="AnonSearchObject">
|
<function-prolog>
|
This function searches the Directory Server anonymously with optional arguments possible
|
</function-prolog>
|
<function-map-args>
|
<function-arg-def name="location" type="optional" default="'%s' % STAF_REMOTE_HOSTNAME">
|
<function-arg-description>
|
Location of target host
|
</function-arg-description>
|
<function-arg-property name="type" value="hostname"/>
|
</function-arg-def>
|
<function-arg-def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
|
<function-arg-description>
|
Pathname to installation root
|
</function-arg-description>
|
<function-arg-property name="type" value="pathname"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstanceHost" type="optional">
|
<function-arg-description>
|
Directory Server Host Name
|
</function-arg-description>
|
<function-arg-property name="type" value="hostname"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstancePort" type="optional">
|
<function-arg-description>
|
Directory Server Port Number
|
</function-arg-description>
|
<function-arg-property name="type" value="integer"/>
|
</function-arg-def>
|
<function-arg-def name="dsBaseDN" type="optional">
|
<function-arg-description>
|
The baseDN for the search operation
|
</function-arg-description>
|
<function-arg-property name="type" value="dn"/>
|
</function-arg-def>
|
<function-arg-def name="dsFilter" type="optional">
|
<function-arg-description>
|
The filter for the search operation
|
</function-arg-description>
|
<function-arg-property name="type" value="filter"/>
|
</function-arg-def>
|
<function-arg-def name="extraParams" type="optional">
|
<function-arg-description>
|
Optional extra parameters for specific test cases
|
</function-arg-description>
|
<function-arg-property name="type" value="filter"/>
|
</function-arg-def>
|
</function-map-args>
|
<sequence>
|
<message>
|
'ldapsearch%s -h %s -p %s %s -b "%s" "%s"' % (fileExt,dsInstanceHost,dsInstancePort,extraParams,dsBaseDN,dsFilter)
|
</message>
|
<process name="'Anonymous Search Base Object'">
|
<location>'%s' % location </location>
|
<command>'%s/ldapsearch%s' % (dsBinPath,fileExt)</command>
|
<parms>'-h %s -p %s %s -b "%s" "%s"' % (dsInstanceHost,dsInstancePort,extraParams,dsBaseDN,dsFilter)</parms>
|
<workdir>'%s' % dsBinPath</workdir>
|
<envs>
|
['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
|
</envs>
|
<stderr mode="'stdout'"/>
|
<returnstdout/>
|
</process>
|
<script>
|
SearchRC=RC
|
SearchResult=STAXResult
|
</script>
|
|
<call function="'checkRC'">
|
{ 'returncode' : SearchRC ,
|
'result' : SearchResult }
|
</call>
|
|
<return>SearchResult</return>
|
|
</sequence>
|
</function>
|
|
<function name="DeleteEntry">
|
<function-prolog>
|
This function an entry in the Directory Server
|
</function-prolog>
|
<function-map-args>
|
<function-arg-def name="location" type="optional" default="'%s' % STAF_REMOTE_HOSTNAME">
|
<function-arg-description>
|
Location of target host
|
</function-arg-description>
|
<function-arg-property name="type" value="hostname"/>
|
</function-arg-def>
|
<function-arg-def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
|
<function-arg-description>
|
Pathname to installation root
|
</function-arg-description>
|
<function-arg-property name="type" value="filepath"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstanceHost" type="optional">
|
<function-arg-description>
|
Directory server hostname or IP address
|
</function-arg-description>
|
<function-arg-property name="type" value="hostname"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstancePort" type="optional">
|
<function-arg-description>
|
Directory server port number
|
</function-arg-description>
|
<function-arg-property name="type" value="Port number"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstanceDn" type="optional">
|
<function-arg-description>
|
Bind DN
|
</function-arg-description>
|
<function-arg-property name="type" value="DN"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstancePswd" type="optional">
|
<function-arg-description>
|
Bind password
|
</function-arg-description>
|
<function-arg-property name="type" value="string"/>
|
</function-arg-def>
|
<function-arg-def name="dsBaseDN" type="required">
|
<function-arg-description>
|
Entry to be deleted in the Directory Server
|
</function-arg-description>
|
<function-arg-property name="type" value="DN"/>
|
</function-arg-def>
|
<function-arg-def name="extraParams" type="optional">
|
<function-arg-description>
|
Optional extra parameters for specific test cases
|
</function-arg-description>
|
<function-arg-property name="type" value="string"/>
|
</function-arg-def>
|
</function-map-args>
|
|
<sequence>
|
|
<!-- Local variables -->
|
<script>
|
mylocation=location
|
</script>
|
|
<!-- Build the Command -->
|
<script>
|
STAFCmdParamsList=[]
|
STAFCmdParams=''
|
|
if dsPath:
|
dsBinPath='%s/%s' % (dsPath,fileFolder)
|
STAFCmd='%s/ldapdelete%s' % (dsBinPath,fileExt)
|
|
</script>
|
|
<!-- Set common ldap arguments -->
|
<call function="'_ldapCommonArgs'"/>
|
|
<script>
|
if extraParams:
|
STAFCmdParamsList.append('%s' % extraParams)
|
|
if dsBaseDN:
|
STAFCmdParamsList.append('"%s"' % dsBaseDN)
|
|
STAFCmdParams=' '.join(STAFCmdParamsList)
|
</script>
|
|
<message>
|
'%s %s' % (STAFCmd, STAFCmdParams)
|
</message>
|
|
<process name="'Delete Object'">
|
<location>'%s' % location</location>
|
<command>'%s' % STAFCmd</command>
|
<parms>'%s' % STAFCmdParams</parms>
|
<workdir>'%s' % dsBinPath</workdir>
|
<envs>
|
['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
|
</envs>
|
<console use="'same'"/>
|
<stderr mode="'stdout'"/>
|
<returnstdout/>
|
</process>
|
|
<call function="'checkRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
|
</sequence>
|
|
</function>
|
|
<function name="compareEntry">
|
<function-prolog>
|
This function compares the attribute and value an entry to the Directory Server
|
</function-prolog>
|
<function-map-args>
|
<function-arg-def name="location" type="optional" default="'%s' % STAF_REMOTE_HOSTNAME">
|
<function-arg-description>
|
Location of target host
|
</function-arg-description>
|
<function-arg-property name="type" value="hostname"/>
|
</function-arg-def>
|
<function-arg-def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
|
<function-arg-description>
|
Pathname to installation root
|
</function-arg-description>
|
<function-arg-property name="type" value="filepath"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstanceHost" type="optional">
|
<function-arg-description>
|
Directory server hostname or IP address
|
</function-arg-description>
|
<function-arg-property name="type" value="hostname"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstancePort" type="optional">
|
<function-arg-description>
|
Directory server port number
|
</function-arg-description>
|
<function-arg-property name="type" value="Port number"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstanceDn" type="optional">
|
<function-arg-description>
|
Bind DN
|
</function-arg-description>
|
<function-arg-property name="type" value="DN"/>
|
</function-arg-def>
|
<function-arg-def name="dsInstancePswd" type="optional">
|
<function-arg-description>
|
Bind password
|
</function-arg-description>
|
<function-arg-property name="type" value="string"/>
|
</function-arg-def>
|
<function-arg-def name="attrToBeCompared" type="required">
|
<function-arg-description>
|
Attribute to be compared in Directory Server
|
</function-arg-description>
|
<function-arg-property name="type" value="attribute"/>
|
</function-arg-def>
|
<function-arg-def name="entryToBeCompared" type="required">
|
<function-arg-description>
|
Entry to be compared in Directory Server
|
</function-arg-description>
|
<function-arg-property name="type" value="DN"/>
|
</function-arg-def>
|
<function-arg-def name="extraParams" type="optional">
|
<function-arg-description>
|
Optional extra parameters for specific test cases
|
</function-arg-description>
|
<function-arg-property name="type" value="string"/>
|
</function-arg-def>
|
</function-map-args>
|
<sequence>
|
|
<!-- Local variables -->
|
<script>
|
mylocation=location
|
</script>
|
|
<!-- Build the Command -->
|
<script>
|
STAFCmdParamsList=[]
|
STAFCmdParams=''
|
|
if dsPath:
|
dsBinPath='%s/%s' % (dsPath,fileFolder)
|
STAFCmd='%s/ldapcompare%s' % (dsBinPath,fileExt)
|
|
</script>
|
|
<!-- Set common ldap arguments -->
|
<call function="'_ldapCommonArgs'"/>
|
<script>
|
if extraParams:
|
STAFCmdParamsList.append('%s' % extraParams)
|
|
if attrToBeCompared:
|
STAFCmdParamsList.append('"%s"' % attrToBeCompared)
|
|
if entryToBeCompared:
|
STAFCmdParamsList.append('"%s"' % entryToBeCompared)
|
|
STAFCmdParams=' '.join(STAFCmdParamsList)
|
</script>
|
|
<message>
|
'%s %s' % (STAFCmd, STAFCmdParams)
|
</message>
|
|
<process name="'Compare Object'">
|
<location>'%s' % location</location>
|
<command>'%s' % STAFCmd</command>
|
<parms>'%s' % STAFCmdParams</parms>
|
<workdir>'%s' % dsBinPath</workdir>
|
<envs>
|
['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
|
</envs>
|
<console use="'same'"/>
|
<stderr mode="'stdout'"/>
|
<returnstdout/>
|
</process>
|
|
<script>
|
SearchRC=RC
|
SearchResult=STAXResult
|
</script>
|
|
<call function="'checkRC'">
|
{ 'returncode' : SearchRC ,
|
'result' : SearchResult }
|
</call>
|
|
<return>SearchResult</return>
|
|
</sequence>
|
|
</function>
|
|
<function name="_ldapCommonArgs">
|
<function-prolog>
|
This function resolves common ldap arguments
|
</function-prolog>
|
<function-no-args/>
|
|
<script>
|
if dsInstanceHost:
|
STAFCmdParamsList.append('-h %s' % dsInstanceHost)
|
|
if dsInstancePort:
|
STAFCmdParamsList.append('-p %s' % dsInstancePort)
|
|
if dsInstanceDn:
|
STAFCmdParamsList.append('-D "%s"' % dsInstanceDn)
|
|
if dsInstancePswd:
|
STAFCmdParamsList.append('-w "%s"' % dsInstancePswd)
|
</script>
|
|
</function>
|
|
</stax>
|