From 95a3ac6055fbdb4608d402fd0985fd04b5c51a20 Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Mon, 07 Jun 2010 09:38:55 +0000
Subject: [PATCH] Improve External Changelog tests and tools

---
 opends/tests/staf-tests/shared/functions/ldap.xml |   46 +++++++++++++++++++++++++++++++++++++---------
 1 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/opends/tests/staf-tests/shared/functions/ldap.xml b/opends/tests/staf-tests/shared/functions/ldap.xml
index fa397e5..6536cf0 100755
--- a/opends/tests/staf-tests/shared/functions/ldap.xml
+++ b/opends/tests/staf-tests/shared/functions/ldap.xml
@@ -3589,15 +3589,43 @@
         '%s %s' % (STAFCmd, STAFCmdParams)
       </message>
       
-      <call function="'runCommand'">
-        { 'command'   : STAFCmd,
-          'arguments' : STAFCmdParams,
-          'location'  : location,
-          'name'      : 'ldapsearch',
-          'expectedRC': expectedRC,
-          'knownIssue': knownIssue
-        }
-      </call>
+      <!-- Give the changes time to propagate in the ECL -->
+      <script>
+        myCounter = 1
+        taskRC    = 1
+        noOfLoops = 10
+      </script>
+      <loop from="1" to="noOfLoops" while="taskRC != 0">
+        <sequence>
+        
+          <message>
+            'LOOP number %s - %s %s' % (myCounter, STAFCmd, STAFCmdParams)
+          </message>
+    
+          <call function="'runCommand'">
+            { 'command'   : STAFCmd,
+              'arguments' : STAFCmdParams,
+              'location'  : location,
+              'name'      : 'ldapsearch',
+              'expectedRC': expectedRC,
+              'knownIssue': knownIssue
+            }
+          </call>
+          <script>
+            STAFCmdRC     = RC
+            STAFCmdResult = STAXResult
+            myCounter     = myCounter + 1
+          </script>
+          
+          <if expr='STAFCmdResult[0][1] != None and len(STAFCmdResult[0][1].strip()) > 0'>
+            <sequence>
+              <script>taskRC = 0</script>
+              <return>STAFCmdResult</return>
+            </sequence>
+          </if>
+        </sequence>
+      </loop>
+      
       <return>
         STAXResult
       </return>

--
Gitblit v1.10.0