From f3efeee96260f0d19e081cfced6c7e6efc540250 Mon Sep 17 00:00:00 2001
From: smaguin <smaguin@localhost>
Date: Mon, 20 Aug 2007 13:34:51 +0000
Subject: [PATCH] add function to list folder

---
 opends/tests/functional-tests/shared/functions/stafcmd.xml |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/opends/tests/functional-tests/shared/functions/stafcmd.xml b/opends/tests/functional-tests/shared/functions/stafcmd.xml
index 9a8099a..62bdcc4 100755
--- a/opends/tests/functional-tests/shared/functions/stafcmd.xml
+++ b/opends/tests/functional-tests/shared/functions/stafcmd.xml
@@ -617,4 +617,61 @@
 
   </function>
         
+
+<!-- List a folder -->
+  <function name="listFolder">
+    <function-prolog>
+        This function  lists a folder
+    </function-prolog>
+    
+    <function-map-args>
+      <function-arg-def name="location" type="optional" default="STAXServiceMachine">
+        <function-arg-description>
+          Location of target host
+        </function-arg-description>
+        <function-arg-property name="type" value="hostname"/>
+      </function-arg-def>
+      <function-arg-def name="foldername" type="required">
+        <function-arg-description>
+          Name of folder to be list
+        </function-arg-description>
+        <function-arg-property name="type" value="filepath"/>
+	  </function-arg-def>
+      <function-arg-def name="filename" type="required">
+        <function-arg-description>
+          Name of file to be list
+        </function-arg-description>
+        <function-arg-property name="type" value="filepath"/>		  
+      </function-arg-def>      
+    </function-map-args>
+
+    <sequence>
+      <stafcmd name="'STAF Command: list Folder Attributes'">
+        <location>'%s' % location</location>
+        <service>'fs'</service>
+        <request>' LIST DIRECTORY %s NAME %s LONG ' % (foldername,filename)</request>
+      </stafcmd>
+      <if expr="RC != 0">
+        <sequence>
+          <message log="1">
+            'Folder does not exist.'
+          </message>
+          <return>0</return>
+        </sequence>
+      </if>
+
+      <script>
+        cmdRC=RC
+        cmdResult=STAFResult
+      </script>
+
+      <call function="'checkRC'">
+          { 'returncode' : cmdRC ,
+            'result'     : cmdResult }
+      </call>
+
+      <return>cmdRC</return>
+      </sequence>
+    </function>	
+	
 </stax>

--
Gitblit v1.10.0