From 48e12ec78a178f795b258c2e90c77e7fa89b5eb8 Mon Sep 17 00:00:00 2001
From: andrug <andrug@localhost>
Date: Tue, 18 Mar 2008 18:22:14 +0000
Subject: [PATCH] add pre/post configuration phases

---
 opends/tests/system-tests/phases/main_run.xml |   98 +++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 87 insertions(+), 11 deletions(-)

diff --git a/opends/tests/system-tests/phases/main_run.xml b/opends/tests/system-tests/phases/main_run.xml
index 01cb8d4..baa10a4 100644
--- a/opends/tests/system-tests/phases/main_run.xml
+++ b/opends/tests/system-tests/phases/main_run.xml
@@ -33,7 +33,17 @@
     <function-map-args>
       <function-arg-def name="configurationFile" type="required">
         <function-arg-description>
-          configuration file path
+          xml configuration file
+        </function-arg-description>
+      </function-arg-def>
+      <function-arg-def name="preConfigurationFile" type="optional">
+        <function-arg-description>
+          pre configuration file for custom pre configuration
+        </function-arg-description>
+      </function-arg-def>
+      <function-arg-def name="postConfigurationFile" type="optional">
+        <function-arg-description>
+          post configuration file for custom pre configuration
         </function-arg-description>
       </function-arg-def>
       <function-arg-def name="runInstallation" type="optional" 
@@ -48,12 +58,24 @@
           run generateLdif phase
         </function-arg-description>
       </function-arg-def>
+      <function-arg-def name="runPreConfiguration" type="optional"
+                                                default="'false'">
+        <function-arg-description>
+          run configuration phase
+        </function-arg-description>
+      </function-arg-def>
       <function-arg-def name="runConfiguration" type="optional"
                                                 default="'true'">
         <function-arg-description>
           run configuration phase
         </function-arg-description>
       </function-arg-def>
+      <function-arg-def name="runPostConfiguration" type="optional"
+                                                default="'false'">
+        <function-arg-description>
+          run configuration phase
+        </function-arg-description>
+      </function-arg-def>
       <function-arg-def name="runScheduler" type="optional" default="'true'">
         <function-arg-description>
           run scheduler phase
@@ -79,13 +101,15 @@
         DOMAIN[0]       = ''
         
         ERR_NUM = STAXGlobal([0])
-        ERR_NUM_PARSER        = ''
-        ERR_NUM_INSTALL       = ''
-        ERR_NUM_GEN_LDIF      = ''
-        ERR_NUM_CONFIGURATION = ''
-        ERR_NUM_SCHEDULER     = ''
-        ERR_NUM_VERDICT       = ''
-        ERR_NUM_TOTAL         = 0
+        ERR_NUM_PARSER             = ''
+        ERR_NUM_INSTALL            = ''
+        ERR_NUM_GEN_LDIF           = ''
+        ERR_NUM_PRE_CONFIGURATION  = ''
+        ERR_NUM_CONFIGURATION      = ''
+        ERR_NUM_POST_CONFIGURATION = ''
+        ERR_NUM_SCHEDULER          = ''
+        ERR_NUM_VERDICT            = ''
+        ERR_NUM_TOTAL              = 0
       </script>
       
       
@@ -120,7 +144,9 @@
       <!-- ============ CONF FILES CHECK ============================= -->
       <!-- Check that configuration files have no NEED_VALUE string    -->
       <script>ERR_NUM[0] = 0</script>
-      <call function="'checkConfigurationFiles'"/>
+      <call function="'checkConfigurationFiles'">
+        { 'configurationFile' : configurationFile }
+      </call>
       <if expr="ERR_NUM[0] != 0">
         <return/>
       <else>
@@ -212,8 +238,32 @@
       </if>
       
       <!-- ============ PRE-CONFIGURATION ============================ -->
-      
-      
+      <if expr="runPreConfiguration == 'true'">
+        <sequence>
+          <call function="'isFile'">
+          {
+            'location' : STAXServiceMachine,
+            'fileName' : preConfigurationFile
+          }
+          </call>
+          <if expr="STAXResult == TRUE">
+            <sequence>
+              <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
+                      file="'%s' % preConfigurationFile"/>
+              <call function="'preConfiguration'">
+              { 
+                'instances' : instances,
+                'suffix'    : suffix
+              }
+              </call>
+              <script>
+                ERR_NUM_PRE_CONFIGURATION = ERR_NUM[0]
+                ERR_NUM_TOTAL             = ERR_NUM_TOTAL + ERR_NUM[0]
+              </script>
+            </sequence>
+          </if>
+        </sequence>
+      </if>
       
       <!-- ============ CONFIGURATION  =============================== -->
       <if expr="runConfiguration == 'true'">
@@ -235,6 +285,32 @@
       
       
       <!-- ============ POST-CONFIGURATION =========================== -->
+      <if expr="runPostConfiguration == 'true'">
+        <sequence>
+          <call function="'isFile'">
+          {
+            'location' : STAXServiceMachine,
+            'fileName' : postConfigurationFile
+          }
+          </call>
+          <if expr="STAXResult == TRUE">
+            <sequence>
+              <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
+                      file="'%s' % postConfigurationFile"/>
+              <call function="'postConfiguration'">
+              { 
+                'instances' : instances,
+                'suffix'    : suffix
+              }
+              </call>
+              <script>
+                ERR_NUM_POST_CONFIGURATION = ERR_NUM[0]
+                ERR_NUM_TOTAL              = ERR_NUM_TOTAL + ERR_NUM[0]
+              </script>
+            </sequence>
+          </if>
+        </sequence>
+      </if>
       
       
       <!-- ============ MONITORING =================================== -->

--
Gitblit v1.10.0