From 4d9ec51b7c325e3367501e44dedd16132f937785 Mon Sep 17 00:00:00 2001
From: andrug <andrug@localhost>
Date: Mon, 23 Jun 2008 16:04:30 +0000
Subject: [PATCH] QA: System Test: Split clients to have preamble,run,postamble

---
 opends/tests/system-tests/phases/parser/object_lib.xml |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/opends/tests/system-tests/phases/parser/object_lib.xml b/opends/tests/system-tests/phases/parser/object_lib.xml
index fe4f7aa..4b009ea 100644
--- a/opends/tests/system-tests/phases/parser/object_lib.xml
+++ b/opends/tests/system-tests/phases/parser/object_lib.xml
@@ -86,5 +86,60 @@
       <return>clients</return>
     </sequence>
   </function>
+  
+  
+  <!-- ************************************************************ -->
+  <function name="clientSetPath">
+    <function-map-args>
+      <function-required-arg name="client"/>
+    </function-map-args>
+    <sequence>
+      <script>
+        localWorkingDir = '%s/scenario/%s/clients/%s' % \
+                           (LOCAL_TESTS_DIR,DIR_NAME,client.getName())
+        sharedWorkingdir = '%s/clients/%s/' % \
+                           (LOCAL_TESTS_DIR,client.getName())
+      </script>
+      
+      <call function="'isFile'">
+      {
+        'location' : client.getHost(),
+        'fileName' : '%s/%s.xml' % (localWorkingDir,client.getName())
+      }
+      </call>
+      <script>
+        localClientExist = STAXResult
+      </script>
+      
+      <call function="'isFile'">
+      {
+        'location' : client.getHost(),
+        'fileName' : '%s/%s.xml' % (sharedWorkingdir,client.getName())
+      }
+      </call>
+      <script>
+        sharedClientExist = STAXResult
+      </script>
+      
+      <!-- use local client by default else the shared client -->
+      <if expr="localClientExist == TRUE">
+        <script> client.setPath(localWorkingDir) </script>
+      <elseif expr="sharedClientExist == TRUE">
+        <script> client.setPath(sharedWorkingdir) </script>
+      </elseif>
+      <else>
+        <sequence>
+          <message>
+            'ERROR : cant find files %s/%s.xml, %s/%s.xml'% \
+            (localWorkingDir,client.getName(),\
+             sharedWorkingdir,client.getName())
+          </message>
+          <script> ERR_NUM[0] += 1 </script>
+        </sequence>
+      </else>
+      </if>
+    </sequence>
+  </function>
+  
 </stax>
 

--
Gitblit v1.10.0