From 9bca46a0eeb8a50cc3ae4bcda3a23c464b1c3c5b Mon Sep 17 00:00:00 2001
From: el_kaboing <el_kaboing@localhost>
Date: Tue, 27 Feb 2007 17:06:17 +0000
Subject: [PATCH] Added a function that will be used for many of the aci test cases.

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

diff --git a/opends/tests/functional-tests/shared/functions/utils.xml b/opends/tests/functional-tests/shared/functions/utils.xml
index 0ad8392..aed78b2 100755
--- a/opends/tests/functional-tests/shared/functions/utils.xml
+++ b/opends/tests/functional-tests/shared/functions/utils.xml
@@ -177,6 +177,44 @@
     </sequence>
   </function>
 
+    <function name="searchStringForSubstring">
+    <function-prolog>
+      This function simply searches a string for a substring
+    </function-prolog>
+    <function-map-args>
+      <function-required-arg name="testString">
+        the substring being tested from the command
+      </function-required-arg>
+      <function-required-arg name="returnString">
+        the return string received from command
+      </function-required-arg>
+    </function-map-args>
+
+    <sequence>
+      <script>
+        import re
+        searchre = re.compile(testString)
+      </script>
+      <if expr='re.search(searchre, returnString) == None'>
+        <sequence>
+          <script>returnCode='0'</script>
+          <message log="1">
+            'Result: Did Not Find substring, %s, in the return string' % (testString)
+          </message>
+        </sequence>
+        <else>
+          <sequence>
+            <script>returnCode='1'</script>
+            <message log="1">
+              'Result: Found substring, %s, in the return string' % (testString)
+            </message>
+          </sequence>
+        </else>
+      </if>
+      <return>returnCode</return>
+    </sequence>
+  </function>
+
   <function name="isAlive">
     <function-prolog>
       Checks that the ldap server is running

--
Gitblit v1.10.0