From d5738d603cc87744e5a5aeba6eb0a883f7139b51 Mon Sep 17 00:00:00 2001
From: andrug <andrug@localhost>
Date: Tue, 20 May 2008 12:00:59 +0000
Subject: [PATCH] ping staf on hosts to avoid staf exception

---
 opends/tests/system-tests/phases/scheduler/scheduler.xml |   42 ++++++++++++++++++++++++++++--------------
 1 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/opends/tests/system-tests/phases/scheduler/scheduler.xml b/opends/tests/system-tests/phases/scheduler/scheduler.xml
index 66b3aff..947c6a2 100755
--- a/opends/tests/system-tests/phases/scheduler/scheduler.xml
+++ b/opends/tests/system-tests/phases/scheduler/scheduler.xml
@@ -530,23 +530,37 @@
           
           <if expr="workingDir != NOT_DEFINED">
             <sequence>
-              <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
-                      file="'%s/%s.xml' % (workingDir,client.getName())"/>
-              <call function="'%s' % client.getName()">
-              { 
-                'workingDir' : workingDir,
-                'client'     : client,
-                'instances'  : instances,
-                'duration'   : duration,
-                'suffix'     : suffix,
-                'outFile'    : outFile,
-                'fileFd'     : fileFd
-              }
+              <!-- Check that staf is running on the client -->
+              <call function="'pingStaf'">
+                { 'targetHost' : client.getHost(),
+                  'fileFd'     : fileFd}
               </call>
               <script>
-                errNum = STAXResult
-                timerKilled = FALSE
+                pingRC = STAXResult[0]
               </script>
+              <if expr="pingRC == 0">
+                <sequence>
+                  <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
+                          file="'%s/%s.xml' % (workingDir,client.getName())"/>
+                  <call function="'%s' % client.getName()">
+                  { 
+                    'workingDir' : workingDir,
+                    'client'     : client,
+                    'instances'  : instances,
+                    'duration'   : duration,
+                    'suffix'     : suffix,
+                    'outFile'    : outFile,
+                    'fileFd'     : fileFd
+                  }
+                  </call>
+                  <script>errNum = STAXResult</script>
+                </sequence>
+              <else>
+                <!-- staf does not answer ping on client host -->
+                <script> errNum = 1 </script>
+              </else>
+              </if>
+              <script>timerKilled = FALSE</script>
             </sequence>
           </if>
           

--
Gitblit v1.10.0