From b66a349023fb751e2ccb3c94d15e748087c79d5d Mon Sep 17 00:00:00 2001
From: andrug <andrug@localhost>
Date: Thu, 28 Feb 2008 18:18:56 +0000
Subject: [PATCH] check configuration files before running the test
---
opends/tests/system-tests/phases/main_run_lib.xml | 39 ++++++++++++++++++++++++++++++++++++++-
opends/tests/system-tests/phases/main_run.xml | 18 ++++++++++++++++--
2 files changed, 54 insertions(+), 3 deletions(-)
diff --git a/opends/tests/system-tests/phases/main_run.xml b/opends/tests/system-tests/phases/main_run.xml
index 6c93533..f48eac1 100644
--- a/opends/tests/system-tests/phases/main_run.xml
+++ b/opends/tests/system-tests/phases/main_run.xml
@@ -88,6 +88,7 @@
ERR_NUM_TOTAL = 0
</script>
+
<!-- ============ LOAD LIB ===================================== -->
<!-- Load in any standard python libraries -->
<script>
@@ -112,10 +113,23 @@
file="'%s/../functional-run/staf/services/stax/libraries/STAXUtil.xml'
% (TESTS_DIR)"/>
-
- <!-- ============ CREATE LOG STUFF ============================= -->
<import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
file="'%s/phases/log/log.xml' % (TESTS_DIR)"/>
+
+
+ <!-- ============ CONF FILES CHECK ============================= -->
+ <!-- Check that configuration files have no NEED_VALUE strin -->
+ <script>ERR_NUM[0] = 0</script>
+ <call function="'checkConfigurationFiles'"/>
+ <if expr="ERR_NUM[0] != 0">
+ <return/>
+ <else>
+ <script>ERR_NUM[0] = 0</script>
+ </else>
+ </if>
+
+
+ <!-- ============ CREATE LOG STUFF ============================= -->
<script>
logsDate = strftime("%Y%m%d-%H%M%S",localtime())
LOG_DIR = '%s/%s' % (TMPDIR,logsDate)
diff --git a/opends/tests/system-tests/phases/main_run_lib.xml b/opends/tests/system-tests/phases/main_run_lib.xml
index 9f34d9e..3b4d6a7 100644
--- a/opends/tests/system-tests/phases/main_run_lib.xml
+++ b/opends/tests/system-tests/phases/main_run_lib.xml
@@ -27,7 +27,44 @@
! -->
<stax>
-
+ <!-- ************************************************************ -->
+ <function name="checkConfigurationFiles">
+ <function-no-args/>
+ <sequence>
+ <if expr="OPENDSDIR == 'NEED_VALUE'">
+ <sequence>
+ <message>'ERROR config.py : OPENDSDIR variable not defined'</message>
+ <script> ERR_NUM[0] += 1 </script>
+ </sequence>
+ <else>
+ <sequence>
+ <call function="'grep'">
+ {
+ 'location' : STAXServiceMachine,
+ 'string2grep' : 'NEED_VALUE',
+ 'expect2Find' : FALSE,
+ 'caseSensitive' : FALSE,
+ 'file' : '%s/config.py' % TESTS_DIR,
+ 'fileFd' : NO_FILE
+ }
+ </call>
+ <call function="'grep'">
+ {
+ 'location' : STAXServiceMachine,
+ 'string2grep' : 'NEED_VALUE',
+ 'expect2Find' : FALSE,
+ 'caseSensitive' : FALSE,
+ 'file' : CONF_FILE,
+ 'fileFd' : NO_FILE
+ }
+ </call>
+ </sequence>
+ </else>
+ </if>
+ </sequence>
+ </function>
+
+
<!-- ************************************************************ -->
<function name="mainPreamble">
<function-prolog>
--
Gitblit v1.10.0