From 564b96103aeae6a3b4a7e1fadea99163c02037c8 Mon Sep 17 00:00:00 2001
From: elocatel <elocatel@localhost>
Date: Fri, 16 May 2008 12:48:20 +0000
Subject: [PATCH] 2 new functions: checkFileNotExists and checkFileExists

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

diff --git a/opends/tests/shared/functions/utils.xml b/opends/tests/shared/functions/utils.xml
index 157e090..b149e2a 100755
--- a/opends/tests/shared/functions/utils.xml
+++ b/opends/tests/shared/functions/utils.xml
@@ -2130,4 +2130,53 @@
     </sequence>
   </function>
 
+  <function name="checkFileExists" scope="local">
+    <function-description>
+      Set testcase result to FAIL if file (as param) does not exist
+    </function-description>
+    <function-map-args>
+      <function-arg-def name="file" type="required">
+        <function-arg-description>
+          The file to check existence
+        </function-arg-description>
+      </function-arg-def>
+    </function-map-args>
+    <sequence>
+      <script>
+        if os.path.exists('%s' % file):
+          exist=1
+        else:
+          exist=0
+      </script>
+      <if expr="exist == 0">
+        <tcstatus result="'fail'"/>
+      </if>
+    </sequence>
+  </function>
+
+  <function name="checkFileNotExists" scope="local">
+    <function-description>
+      Set testcase result to FAIL if file (as param) exists
+    </function-description>
+    <function-map-args>
+      <function-arg-def name="file" type="required">
+        <function-arg-description>
+          The file to check absence
+        </function-arg-description>
+      </function-arg-def>
+    </function-map-args>
+    <sequence>
+      <script>
+        if os.path.exists('%s' % file):
+          exist=1
+        else:
+          exist=0
+      </script>
+      <if expr="exist == 1">
+        <tcstatus result="'fail'"/>
+      </if>
+    </sequence>
+  </function>
+  
+  
 </stax>

--
Gitblit v1.10.0