From 4b9586249c8fb3e6a792ea0e75d750ed4985543f Mon Sep 17 00:00:00 2001
From: Christophe Sovant <christophe.sovant@forgerock.com>
Date: Mon, 03 Mar 2008 18:58:35 +0000
Subject: [PATCH] Add CompareFile function
---
opends/tests/shared/functions/ldap.xml | 54 +++++++++++++++++++++++-------------------------------
1 files changed, 23 insertions(+), 31 deletions(-)
diff --git a/opends/tests/shared/functions/ldap.xml b/opends/tests/shared/functions/ldap.xml
index 2d5a99e..4417dc0 100755
--- a/opends/tests/shared/functions/ldap.xml
+++ b/opends/tests/shared/functions/ldap.xml
@@ -900,13 +900,19 @@
Only return these attributes
</function-arg-description>
<function-arg-property name="type" value="string"/>
- </function-arg-def>
- <function-arg-def name="outputFile" type="optional">
+ </function-arg-def>
+ <function-arg-def name="outputFile" type="optional" default="'None'">
<function-arg-description>
- Output file containing the search result in ldif format.
+ Output file containing the search result in ldif format
+ </function-arg-description>
+ <function-arg-property name="type" value="file"/>
+ </function-arg-def>
+ <function-arg-def name="ouputPath" type="optional">
+ <function-arg-description>
+ Path containing the outputFile
</function-arg-description>
<function-arg-property name="type" value="filepath"/>
- </function-arg-def>
+ </function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0
@@ -1069,38 +1075,24 @@
if dsAttributes:
STAFCmdParamsList.append('%s' % dsAttributes)
-
+ if not outputPath:
+ outputPath = '%s/..' % (dsPath)
+
STAFCmdParams=' '.join(STAFCmdParamsList)
</script>
- <message>
- '%s %s' % (STAFCmd, STAFCmdParams)
- </message>
-
- <process name="'LDAP Search Script to 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>
- <stdout if="outputFile != None" mode="'replace'">'%s/../%s' % (dsPath,outputFile)</stdout>
- <stderr mode="'stdout'"/>
- <returnstdout/>
- </process>
-
- <script>
- STAXCode=RC
- STAXReason=STAXResult
- </script>
- <call function="'checktestRC'">
- { 'returncode' : STAXCode ,
- 'result' : STAXReason,
- 'expected' : expectedRC }
+ <call function="'runCommand'" >
+ { 'name' : 'LDAP Search Script',
+ 'command' : STAFCmd,
+ 'arguments' : STAFCmdParams,
+ 'location' : location,
+ 'outputFile': outputFile,
+ 'outputPath': outputPath,
+ 'expectedRC': expectedRC
+ }
</call>
<return>
- STAXReason
+ STAXResult
</return>
</sequence>
</function>
--
Gitblit v1.10.0