From 8dde4352e417b4fc6129b2827181de8041842d14 Mon Sep 17 00:00:00 2001
From: andrug <andrug@localhost>
Date: Tue, 24 Jun 2008 09:59:42 +0000
Subject: [PATCH] QA: System Test: code cleanup, upgrade scheluder report section

---
 opendj-sdk/opends/tests/system-tests/phases/scheduler/scheduler.xml         |  108 +++++++++++++++++++-------
 opendj-sdk/opends/tests/system-tests/phases/shared/functions/ldap.xml       |   64 ++++++++-------
 opendj-sdk/opends/tests/system-tests/report/result.xsl                      |   10 +-
 opendj-sdk/opends/tests/system-tests/phases/configuration/configuration.xml |    4 
 opendj-sdk/opends/tests/system-tests/phases/main_run.xml                    |    2 
 5 files changed, 120 insertions(+), 68 deletions(-)

diff --git a/opendj-sdk/opends/tests/system-tests/phases/configuration/configuration.xml b/opendj-sdk/opends/tests/system-tests/phases/configuration/configuration.xml
index 799a983..205189f 100755
--- a/opendj-sdk/opends/tests/system-tests/phases/configuration/configuration.xml
+++ b/opendj-sdk/opends/tests/system-tests/phases/configuration/configuration.xml
@@ -53,7 +53,7 @@
     <sequence>
       <!-- == Call preambule == -->
       <call function="'phasePreamble'">
-      { 'phase'  : PHASE_CONFIGURATION,
+      { 'phase'  : phase,
         'fileFd' : LOG_MAIN_FD }
       </call>
       
@@ -110,7 +110,7 @@
       <!-- ==  Call postphase == -->
       <call function="'phasePostamble'">
       {
-        'phase'  : PHASE_CONFIGURATION,
+        'phase'  : phase,
         'fileFd' : LOG_MAIN_FD
       }
       </call>
diff --git a/opendj-sdk/opends/tests/system-tests/phases/main_run.xml b/opendj-sdk/opends/tests/system-tests/phases/main_run.xml
index ed01830..f7f5647 100644
--- a/opendj-sdk/opends/tests/system-tests/phases/main_run.xml
+++ b/opendj-sdk/opends/tests/system-tests/phases/main_run.xml
@@ -307,7 +307,7 @@
           <call function="'configuration'">
             {
               'phase'     : PHASE_CONFIGURATION,
-              'instances' : instances ,
+              'instances' : instances,
               'suffix'    : suffix
             }
           </call>
diff --git a/opendj-sdk/opends/tests/system-tests/phases/scheduler/scheduler.xml b/opendj-sdk/opends/tests/system-tests/phases/scheduler/scheduler.xml
index df83175..e20eaf0 100755
--- a/opendj-sdk/opends/tests/system-tests/phases/scheduler/scheduler.xml
+++ b/opendj-sdk/opends/tests/system-tests/phases/scheduler/scheduler.xml
@@ -189,11 +189,17 @@
           <script>
             logFile = STAXResult[0]
             fileFd = open(logFile,'w')
+            
+            params = client.getParams()
+            paramsList = ''
+            for p in params:
+              paramsList = '%s%s:%s ' % (paramsList,p[0],p[1])
           </script>
           <!-- == Write tag for xml report -->
           <call function="'writeStartTagClient'">
           {
             'client' : client,
+            'extraParameters' : 'params=\"%s\"' % paramsList,
             'fileFd' : fileFd 
           }
           </call>
@@ -319,11 +325,11 @@
             str = '%s, max duration is %s sec' % (str, duration)
           </script>
           <message> str </message>
-          <call function="'writeMessage'">
+          <!--<call function="'writeMessage'">
           { 'fileFd'  : fileFd,
             'content' : 'Client id %s' % client.getId()
           }
-          </call>
+          </call>-->
         </sequence>
       <else>
         <sequence>
@@ -335,11 +341,11 @@
             str = '%s, max duration is %s sec' % (str, duration)
           </script>
           <message> str </message>
-          <call function="'writeMessage'">
+          <!--<call function="'writeMessage'">
           { 'fileFd'  : fileFd,
             'content' : str
           }
-          </call>
+          </call>-->
         </sequence>
       </else>
       </if>
@@ -444,8 +450,13 @@
       </script>
       <if expr="fileExist == TRUE">
         <sequence>
+          <call function="'writeStartTagOperation'">
+          { 'tagName' : 'clientPreamble',
+            'fileFd'  : fileFd }
+          </call>
           <script>
             errNum = 0
+            errMsg = ''
           </script>
           <!--============= Start the client under a timer =================-->
           <!--== open logfile for details                                 ==-->
@@ -511,7 +522,7 @@
           <!--=============== Log info =====================================-->
           <call function="'writeMessage'">
           { 
-            'content' : 'Client preamble : %s' % logFileDetails,
+            'content' : 'Client preamble',
             'xlink'   : logFileDetailsRelativePath,
             'fileFd'  : fileFd
           }
@@ -525,6 +536,14 @@
             '   Stop pretamble for %s (id=%s) running on %s' % \
             (client.getName(),client.getId(), client.getHost())
           </message>
+          <call function="'checkRC'">
+          {
+            'returncode' : errNum,
+            'result'     : errMsg,
+            'fileFd'     : fileFd
+          }
+          </call>
+          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
         </sequence>
       <else>
         <message>
@@ -561,8 +580,13 @@
       </script>
       <if expr="fileExist == TRUE">
         <sequence>
+          <call function="'writeStartTagOperation'">
+          { 'tagName' : 'clientPostamble',
+            'fileFd'  : fileFd }
+          </call>
           <script>
             errNum = 0
+            errMsg = ''
           </script>
           <!--============= Start the client under a timer =================-->
           <!--== open logfile for details                                 ==-->
@@ -626,7 +650,7 @@
           <!--=============== Log info =====================================-->
           <call function="'writeMessage'">
           { 
-            'content' : 'Client postamble : %s' % logFileDetails,
+            'content' : 'Client postamble',
             'xlink'   : logFileDetailsRelativePath,
             'fileFd'  : fileFd
           }
@@ -640,6 +664,14 @@
             '   Stop postamble for %s (id=%s) running on %s' % \
             (client.getName(),client.getId(), client.getHost())
           </message>
+          <call function="'checkRC'">
+          {
+            'returncode' : errNum,
+            'result'     : errMsg,
+            'fileFd'     : fileFd
+          }
+          </call>
+          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
         </sequence>
       <else>
         <message>
@@ -664,8 +696,13 @@
     </function-map-args>
     
     <sequence>
+      <call function="'writeStartTagOperation'">
+      { 'tagName' : 'clientRun',
+        'fileFd'  : fileFd }
+      </call>
       <script>
         errNum = 0
+        errMsg = ''
       </script>
       <!--=============== Start the client under a timer =================-->
       <!--== open logfile for details                                   ==-->
@@ -705,6 +742,22 @@
         timerKilled = STAXResult[1]
       </script>
       
+      <!--=============== Log info =======================================-->
+      <call function="'writeMessage'">
+      { 
+        'content' : 'Details of the client',
+        'xlink'   : logFileDetailsRelativePath,
+        'fileFd'  : fileFd
+      }
+      </call>
+      <call function="'writeMessage'">
+      { 
+        'content' : 'Client outPuts',
+        'xlink'   : outFile,
+        'fileFd'  : fileFd
+      }
+      </call>
+      
       <!--=============== Analyze client run status ======================-->
       <if expr="timerKilled == TRUE">
         <sequence>
@@ -712,41 +765,36 @@
             errMsg = 'ERROR: client %s has been killed,' % client.getName()
           </script>
           <call function="'writeMessage'">
-            {
-              'content' : errMsg,
-              'fileFd'  : fileFd
-            }
+          {
+            'content' : errMsg,
+            'fileFd'  : fileFd
+          }
           </call>
           <message> errMsg </message>
           <script>
-            ERR_NUM[0] += 1
+            errNum += 1
           </script>
         </sequence>
+      <else>
+        <message>
+          '   Stop run for %s (id=%s) running on %s' % \
+          (client.getName(),client.getId(), client.getHost())
+        </message>
+      </else>
       </if>
       
       <script>
         finishedClients.append(client.getId())
       </script>
+      <call function="'checkRC'">
+      {
+        'returncode' : errNum,
+        'result'     : errMsg,
+        'fileFd'     : fileFd
+      }
+      </call>
+      <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
       
-      <!--=============== Log info =======================================-->
-      <call function="'writeMessage'">
-      { 
-        'content' : 'Details of the client : %s' % logFileDetails,
-        'xlink'   : logFileDetailsRelativePath,
-        'fileFd'  : fileFd
-      }
-      </call>
-      <call function="'writeMessage'">
-      { 
-        'content' : 'Client outPuts : %s' % outFile,
-        'xlink'   : outFile,
-        'fileFd'  : fileFd
-      }
-      </call>
-      <message>
-        '   Stop run for %s (id=%s) running on %s' % \
-        (client.getName(),client.getId(), client.getHost())
-      </message>
       <return> [ errNum , outFile ]</return>
     </sequence>
   </function>
diff --git a/opendj-sdk/opends/tests/system-tests/phases/shared/functions/ldap.xml b/opendj-sdk/opends/tests/system-tests/phases/shared/functions/ldap.xml
index 8ced8cf..9fd322a 100755
--- a/opendj-sdk/opends/tests/system-tests/phases/shared/functions/ldap.xml
+++ b/opendj-sdk/opends/tests/system-tests/phases/shared/functions/ldap.xml
@@ -1077,43 +1077,43 @@
         </function-arg-description>
         <function-arg-property name="type" value="hostname"/>
       </function-arg-def>
-    
+      
       <function-arg-def name="dsPath" type="required"> 
         <function-arg-description>
           Pathname to installation root
         </function-arg-description>
         <function-arg-property name="type" value="filepath"/>
       </function-arg-def>
-    
+      
       <function-arg-def name="dsInstanceHost" type="required">
         <function-arg-description>
           Directory server hostname or IP address
         </function-arg-description>
-    <function-arg-property name="type" value="hostname"/>
-      </function-arg-def>      
-    
+      <function-arg-property name="type" value="hostname"/>
+      </function-arg-def>
+      
       <function-arg-def name="dsInstancePort" type="required">
         <function-arg-description>
           Directory server port number
         </function-arg-description>      
         <function-arg-property name="type" value="Port number"/>
       </function-arg-def>
-    
+      
       <function-arg-def name="dsInstanceDn" type="required">
         <function-arg-description>
           Bind DN
         </function-arg-description>
         <function-arg-property name="type" value="DN"/>
       </function-arg-def> 
-    
+      
       <function-arg-def name="dsInstancePswd" type="required">
         <function-arg-description>
           Bind password
         </function-arg-description>
         <function-arg-property name="type" value="string"/>
       </function-arg-def>          
-    
-     <function-arg-def name="DNToModify" type="required">
+      
+      <function-arg-def name="DNToModify" type="required">
         <function-arg-description>
           DN to modify
         </function-arg-description>
@@ -1126,47 +1126,49 @@
         </function-arg-description>
         <function-arg-property name="type" value="string"/>
       </function-arg-def>
-    
-     <function-arg-def name="newAttributeValue" type="optional">
+      
+      <function-arg-def name="newAttributeValue" type="optional">
         <function-arg-description>
           New Attribute Value
         </function-arg-description>
         <function-arg-property name="type" value="string"/>
       </function-arg-def>
       
-     <function-arg-def name="listAttributes" type="optional" default="' '">
-       <function-arg-description>
-         List of attributes name and value to modify. The format is name:value
-       </function-arg-description>
-       <function-arg-property name="type" value="string"/>       
-     </function-arg-def>
-    
-    <function-arg-def name="changetype" type="required">
+      <function-arg-def name="listAttributes" type="optional" default="' '">
+        <function-arg-description>
+          List of attributes name and value to modify. The format is name:value
+        </function-arg-description>
+        <function-arg-property name="type" value="string"/>       
+      </function-arg-def>
+      
+      <function-arg-def name="changetype" type="required">
         <function-arg-description>
           Type of modification, can be delete, add, replace
         </function-arg-description>
         <function-arg-property name="type" value="string"/>
-    </function-arg-def>
-   
-    <function-arg-def name="suppressTestStatus" type="optional" default="0">
+      </function-arg-def>
+      
+      <function-arg-def name="suppressTestStatus" type="optional" default="0">
         <function-arg-description>
           Supress the call to checkTestRC
         </function-arg-description>
         <function-arg-property name="type" value="string"/>
-    </function-arg-def>
-
-    <function-arg-def name="expectedRC" type="optional" default="0">
-      <function-arg-description>
-        Expected return code value. Default value is 0
-        Wildcard 'noCheck' to not check the RC
-      </function-arg-description>
-      <function-arg-property name="type" value="string"/>
-    </function-arg-def>      
+      </function-arg-def>
+      
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+        <function-arg-property name="type" value="string"/>
+      </function-arg-def>
+      
       <function-arg-def name="fileFd" type="required">
         <function-arg-description>
           Name of output file descriptor
         </function-arg-description>
       </function-arg-def>
+    
     </function-map-args>
     <sequence>
     
diff --git a/opendj-sdk/opends/tests/system-tests/report/result.xsl b/opendj-sdk/opends/tests/system-tests/report/result.xsl
index ca7efec..ba5cde2 100755
--- a/opendj-sdk/opends/tests/system-tests/report/result.xsl
+++ b/opendj-sdk/opends/tests/system-tests/report/result.xsl
@@ -689,10 +689,7 @@
     </a>
     [Start : <xsl:value-of select="clientResult/@startDate"/> / 
     Stop : <xsl:value-of select="clientResult/@stopDate"/>].
-    <p id="{$i}" style="display: none">
-      <xsl:call-template name="parseChildPhase" />
-    </p>
-    Client ends with status :
+    <b>Status : </b>
       <xsl:variable name="clientStatus" 
                     select="normalize-space(clientResult/@status)"/>
       <xsl:choose>
@@ -703,6 +700,11 @@
           <b><span class="fail">FAIL</span></b>
         </xsl:otherwise>
       </xsl:choose>
+    <br/>
+    <p id="{$i}" style="display: none">
+      Paramaters : <i> <xsl:value-of select="normalize-space(@params)"/> </i>
+      <xsl:call-template name="parseChildPhase" />
+    </p>
       
   </li><br/>
 </xsl:template>

--
Gitblit v1.10.0