mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

andrug
23.04.2008 4d9ec51b7c325e3367501e44dedd16132f937785
QA: System Test: Split clients to have preamble,run,postamble
12 files added
17 files modified
3081 ■■■■ changed files
opends/tests/system-tests/clients/modifyLoad/modifyLoad.xml 181 ●●●● patch | view | raw | blame | history
opends/tests/system-tests/clients/modifyLoad/modifyLoadLib.xml 109 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/clients/modifyLoad/modifyLoadPostamble.xml 114 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/clients/modifyLoad/modifyLoadPreamble.xml 169 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/clients/restartDs/restartDs.xml 1 ●●●● patch | view | raw | blame | history
opends/tests/system-tests/clients/searchLoad/searchLoad.xml 187 ●●●● patch | view | raw | blame | history
opends/tests/system-tests/clients/searchLoad/searchLoadLib.xml 109 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/clients/searchLoad/searchLoadPostamble.xml 113 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/clients/searchLoad/searchLoadPreamble.xml 164 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/clients/verdictOpends/verdictOpends.xml 1 ●●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/configuration/configuration_opends.xml 12 ●●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/installation/installation_opends.xml 2 ●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/log/log.xml 18 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/main_run_lib.xml 17 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/parser/object_lib.xml 55 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/parser/parser.py 7 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/scheduler/scheduler.xml 550 ●●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/shared/functions/opendsadm.xml 32 ●●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/verdict/verdict.xml 2 ●●● patch | view | raw | blame | history
opends/tests/system-tests/scenario/4MMR/4MMR.xml 6 ●●●● patch | view | raw | blame | history
opends/tests/system-tests/scenario/4MMR/clients/addDeleteLoad/addDeleteLoad.xml 180 ●●●● patch | view | raw | blame | history
opends/tests/system-tests/scenario/4MMR/clients/addDeleteLoad/addDeleteLoadLib.xml 113 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/scenario/4MMR/clients/addDeleteLoad/addDeleteLoadPostamble.xml 123 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/scenario/4MMR/clients/addDeleteLoad/addDeleteLoadPreamble.xml 174 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/scenario/4MMR/conf.xml 61 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/scenario/sample2/clients/sampleSearchLoad/sampleSearchLoad.xml 178 ●●●● patch | view | raw | blame | history
opends/tests/system-tests/scenario/sample2/clients/sampleSearchLoad/sampleSearchLoadLib.xml 110 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/scenario/sample2/clients/sampleSearchLoad/sampleSearchLoadPostamble.xml 120 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/scenario/sample2/clients/sampleSearchLoad/sampleSearchLoadPreamble.xml 173 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/clients/modifyLoad/modifyLoad.xml
@@ -35,7 +35,6 @@
  <!-- always define all the parameters below                       -->
  <function name="modifyLoad" scope="local">
    <function-map-args>
      <function-arg-def name="workingDir" type="required"/>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
@@ -55,70 +54,20 @@
        msg = ''
      </script>
      
      <!-- ==================    Preamble   =================== -->
      <!-- ==================    Parser     =================== -->
      <!-- parse the client parameters :                        -->
      <!-- params is [[param1,val1],[param2,val2],...]          -->
      <!-- get the ldap instance parameters                     -->
      <script>
        compilDir = '%s/%s_%s' % (workingDir,client.getHost(),client.getId())
        #
        # Extract client parameters from client.getParams()
        #
        cParams = client.getParams()
        try:
          serverInstanceFromClient = cParams[0][1]
        except IndexError:
          serverInstanceFromClient = NOT_DEFINED
          msg = '%s\nERROR: serverInstanceFromClient undefined,mandatory' % msg
        try:
          baseDn = cParams[1][1]
        except IndexError:
          baseDn = NOT_DEFINED
          msg = '%s\nERROR: baseDn undefined,mandatory' % msg
        try:
          nbCnx = cParams[2][1]
        except IndexError:
          nbCnx = NOT_DEFINED
          msg = '%s\nERROR: nbCnx undefined,mandatory' % msg
        try:
          nbMaxModify = cParams[3][1]
        except IndexError:
          nbMaxModify = NOT_DEFINED
          msg = '%s\nERROR: nbMaxOperations undefined,mandatory' % msg
        try:
          attributeName = cParams[4][1]
        except IndexError:
          attributeName = NOT_DEFINED
        #
        # setup parms to run the client
        #
        if serverInstanceFromClient != NOT_DEFINED:
          sys.path.append("%s/phases/scheduler" % TESTS_DIR )
          from scheduler import getInstance
          serverInstance = getInstance(serverInstanceFromClient,instances)
          if (serverInstance == 'ERROR'):
            msg = '%s\nERROR: cant find client instance named' % msg
            msg = '%s %s in server instance list' % \
                  (msg,serverInstanceFromClient)
          else:
            # remove sec, try to finish before timer kill -9 the client
            duration = duration - 20
            parms=[]
            parms.append('-h %s -p %s' % \
                       (serverInstance.getHost(),serverInstance.getLDAPPort()))
            parms.append('-b "%s"' % baseDn)
            parms.append('-D "%s" -w "%s"' % \
                        (DIRECTORY_INSTANCE_DN,DIRECTORY_INSTANCE_PSWD))
            parms.append('-t %s -M %s -d %s' % (nbCnx,nbMaxModify,duration))
            if attributeName != NOT_DEFINED:
              parms.append('-a %s' % attributeName)
            parms = ' '.join(parms)
      </script>
      <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
              file="'%s/%sLib.xml' % (client.getPath(),client.getName())"/>
      <call function="'%sParser' % client.getName()">
      {
        'client'     : client,
        'instances'  : instances,
        'duration'   : duration,
        'suffix'     : suffix
      }
      </call>
      
      <if expr="msg.find('ERROR') != -1">
        <sequence>
@@ -138,78 +87,6 @@
        </sequence>
      <else>
        <sequence>
          <!-- ==== Add execute permission to build.ksh file ==== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'chmod',
            'fileFd'  : fileFd }
          </call>
          <call function="'writeMessage'">
          {'content' : 'Add execute permission to build.ksh file',
           'fileFd'  : fileFd}
          </call>
          <process name="'%s: chmod +x build.ksh' % client.getHost()">
            <location>client.getHost()</location>
            <command mode="'shell'">'chmod +x build.ksh'</command>
            <parms/>
            <workdir>workingDir</workdir>
            <envs>['PATH=/bin:/usr/bin']</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <call function="'checkRC'">
            { 'returncode' : RC,
              'result'     : STAXResult[0][1],
              'fileFd'     : fileFd }
          </call>
          <script>
            errNum += STAXResult
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
          <!-- ==== Build client : run build.ksh file ==== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'build',
            'fileFd'  : fileFd }
          </call>
          <call function="'writeMessage'">
          {'content' : 'Build client',
           'fileFd'  : fileFd}
          </call>
          <!-- Build Client in unique directory (compilDir), avoid          -->
          <!-- conflict if same client is run several time at the same time -->
          <process name="'%s: build %s' % (client.getHost(),client.getName())">
            <location>client.getHost()</location>
            <command mode="'shell'">'./build.ksh'</command>
            <parms/>
            <workdir>workingDir</workdir>
            <envs>['PATH=%s/bin:/bin:/usr/bin' % JAVA_HOME,'COMPILDIR=%s' % compilDir]</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <call function="'checkRC'">
            { 'returncode' : RC,
              'result'     : STAXResult[0][1],
              'fileFd'     : fileFd }
          </call>
          <if expr="RC != 0">
            <message>
              'FAILED to build client %s on %s' % \
              (client.getName(),client.getHost())
            </message>
          </if>
          <script>
            errNum += STAXResult
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
          <!-- ========== Run the client ========== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'run',
@@ -223,8 +100,9 @@
          </call>
          
          <script>
            cParam = '-client -Xmx1G -Xms1G'
            cParam = '%s -XX:NewRatio=1 -XX:SurvivorRatio=100' % cParam
            cParam = '-client'
            # cParam = '%s -Xmx1G -Xms1G' % cParam
            # cParam = '%s -XX:NewRatio=1 -XX:SurvivorRatio=100' % cParam
            cParam = '%s -cp %s/clients/LDAPjdk/ldapjdk.jar' \
                      % (cParam,LOCAL_TESTS_DIR)
            cParam = '%s:%s/modify.jar' % (cParam,compilDir)
@@ -234,11 +112,17 @@
                        (client.getHost(),client.getName(),
                         serverInstance.getName())
          </script>
          <call function="'writeMessage'">
          { 'fileFd'  : fileFd,
            'content' : 'cmd : cd %s ; %s/bin/java %s' % \
                        (client.getPath(),JAVA_HOME,cParam)
          }
          </call>
          <process name="'%s' % titleName">
            <location>client.getHost()</location>
            <command>'%s/bin/java' % JAVA_HOME</command>
            <parms>cParam </parms>
            <workdir>workingDir</workdir>
            <workdir>client.getPath()</workdir>
            <envs>['PATH=%s/bin:/bin:/usr/bin' % JAVA_HOME]</envs>
            <stderr mode="'stdout'"/>
            <stdout>outFile</stdout>
@@ -256,34 +140,12 @@
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
          
          <!-- ========== Postamble ========== -->
          <call function="'writeMessage'">
          {'content' : 'Output file %s' % outFile,
           'xlink'   : outFile,
           'fileFd'  : fileFd}
          </call>
          
          <process name="'%s:%s: Grep' % (client.getHost(),client.getName())">
            <location>client.getHost()</location>
            <command mode="'shell'">
              "grep 'TOTAL' %s | cut -d ' ' -f3-" % outFile
            </command>
            <envs>['PATH=/bin:/usr/bin']</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <script>
            summary = STAXResult[0][1]
          </script>
          <call function="'writeMessage'">
          {'content' : 'Summary %s' % (summary),
           'fileFd'  : fileFd}
          </call>
        </sequence>
      </else>
      </if>
@@ -295,6 +157,5 @@
  </function>
  
  
</stax>
opends/tests/system-tests/clients/modifyLoad/modifyLoadLib.xml
New file
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
<!--
 ! CDDL HEADER START
 !
 ! The contents of this file are subject to the terms of the
 ! Common Development and Distribution License, Version 1.0 only
 ! (the "License").  You may not use this file except in compliance
 ! with the License.
 !
 ! You can obtain a copy of the license at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
 ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 ! See the License for the specific language governing permissions
 ! and limitations under the License.
 !
 ! When distributing Covered Code, include this CDDL HEADER in each
 ! file and include the License file at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 ! add the following below this CDDL HEADER, with the fields enclosed
 ! by brackets "[]" replaced with your own identifying information:
 !      Portions Copyright [yyyy] [name of copyright owner]
 !
 ! CDDL HEADER END
 !
 !      Copyright 2008 Sun Microsystems, Inc.
 ! -->
<stax>
  <defaultcall function="modifyLoadParser"/>
  <!-- ************************************************************ -->
  <!-- Client Parser -->
  <!-- This function must NOT have scope=local has its variables may -->
  <!-- be used by the caller -->
  <function name="modifyLoadParser">
    <function-map-args>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
      <function-arg-def name="suffix"     type="required"/>
    </function-map-args>
    <sequence>
      <script>
        compilDir = '%s/%s_%s' % \
                    (client.getPath(),client.getHost(),client.getId())
        #
        # Extract client parameters from client.getParams()
        #
        cParams = client.getParams()
        try:
          serverInstanceFromClient = cParams[0][1]
        except IndexError:
          serverInstanceFromClient = NOT_DEFINED
          msg = '%s\nERROR: serverInstanceFromClient undefined,mandatory' % msg
        try:
          baseDn = cParams[1][1]
        except IndexError:
          baseDn = NOT_DEFINED
          msg = '%s\nERROR: baseDn undefined,mandatory' % msg
        try:
          nbCnx = cParams[2][1]
        except IndexError:
          nbCnx = NOT_DEFINED
          msg = '%s\nERROR: nbCnx undefined,mandatory' % msg
        try:
          nbMaxModify = cParams[3][1]
        except IndexError:
          nbMaxModify = NOT_DEFINED
          msg = '%s\nERROR: nbMaxOperations undefined,mandatory' % msg
        try:
          attributeName = cParams[4][1]
        except IndexError:
          attributeName = NOT_DEFINED
        #
        # setup parms to run the client
        #
        if serverInstanceFromClient != NOT_DEFINED:
          sys.path.append("%s/phases/scheduler" % TESTS_DIR )
          from scheduler import getInstance
          serverInstance = getInstance(serverInstanceFromClient,instances)
          if (serverInstance == 'ERROR'):
            msg = '%s\nERROR: cant find client instance named' % msg
            msg = '%s %s in server instance list' % \
                  (msg,serverInstanceFromClient)
          else:
            # remove sec, try to finish before timer kill -9 the client
            duration = duration - 20
            parms=[]
            parms.append('-h %s -p %s' % \
                       (serverInstance.getHost(),serverInstance.getLDAPPort()))
            parms.append('-b "%s"' % baseDn)
            parms.append('-D "%s" -w "%s"' % \
                        (DIRECTORY_INSTANCE_DN,DIRECTORY_INSTANCE_PSWD))
            parms.append('-t %s -M %s -d %s' % (nbCnx,nbMaxModify,duration))
            if attributeName != NOT_DEFINED:
              parms.append('-a %s' % attributeName)
            parms = ' '.join(parms)
      </script>
    </sequence>
  </function>
</stax>
opends/tests/system-tests/clients/modifyLoad/modifyLoadPostamble.xml
New file
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
<!--
 ! CDDL HEADER START
 !
 ! The contents of this file are subject to the terms of the
 ! Common Development and Distribution License, Version 1.0 only
 ! (the "License").  You may not use this file except in compliance
 ! with the License.
 !
 ! You can obtain a copy of the license at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
 ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 ! See the License for the specific language governing permissions
 ! and limitations under the License.
 !
 ! When distributing Covered Code, include this CDDL HEADER in each
 ! file and include the License file at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 ! add the following below this CDDL HEADER, with the fields enclosed
 ! by brackets "[]" replaced with your own identifying information:
 !      Portions Copyright [yyyy] [name of copyright owner]
 !
 ! CDDL HEADER END
 !
 !      Copyright 2008 Sun Microsystems, Inc.
 ! -->
<stax>
  <defaultcall function="modifyLoadPostamble"/>
  <!-- ************************************************************ -->
  <!-- Client postamble is automatically called by the scheduler    -->
  <!-- and must always define all the parameters below              -->
  <function name="modifyLoadPostamble" scope="local">
    <function-map-args>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
      <function-arg-def name="suffix"     type="required"/>
      <function-arg-def name="outFile"    type="required"/>
      <function-arg-def name="fileFd"     type="required"/>
    </function-map-args>
    <sequence>
      <!-- ===================   Comments   =================== -->
      <!-- client is run under paralleliterate tag              -->
      <!-- each variables defined are internal                  -->
      <!-- client should have its own err_num variable in order -->
      <!-- to inform scheduler if it has pass/fail status       -->
      <script>
        errNum = 0
        msg = ''
      </script>
      <!-- ==================    Parser     =================== -->
      <!-- parse the client parameters :                        -->
      <!-- params is [[param1,val1],[param2,val2],...]          -->
      <!-- get the ldap instance parameters                     -->
      <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
              file="'%s/%sLib.xml' % (client.getPath(),client.getName())"/>
      <call function="'%sParser' % client.getName()">
      {
        'client'     : client,
        'instances'  : instances,
        'duration'   : duration,
        'suffix'     : suffix
      }
      </call>
      <if expr="msg.find('ERROR') != -1">
        <sequence>
          <message>'%s' % msg</message>
          <call function="'writeOperationResult'">
            {
              'returncode' : '1',
              'expected'   : '0',
              'result'     : msg,
              'status'     : 'ERROR',
              'fileFd'     : fileFd
            }
          </call>
          <script>
            errNum += 1
          </script>
        </sequence>
      <else>
        <sequence>
          <process name="'%s:%s: Grep' % (client.getHost(),client.getName())">
            <location>client.getHost()</location>
            <command mode="'shell'">
              "grep 'TOTAL' %s | cut -d ' ' -f3-" % outFile
            </command>
            <envs>['PATH=/bin:/usr/bin']</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <script>
            summary = STAXResult[0][1]
          </script>
          <call function="'writeMessage'">
          {'content' : 'Summary %s' % (summary),
           'fileFd'  : fileFd}
          </call>
        </sequence>
      </else>
      </if>
      <return> errNum </return>
    </sequence>
  </function>
</stax>
opends/tests/system-tests/clients/modifyLoad/modifyLoadPreamble.xml
New file
@@ -0,0 +1,169 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
<!--
 ! CDDL HEADER START
 !
 ! The contents of this file are subject to the terms of the
 ! Common Development and Distribution License, Version 1.0 only
 ! (the "License").  You may not use this file except in compliance
 ! with the License.
 !
 ! You can obtain a copy of the license at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
 ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 ! See the License for the specific language governing permissions
 ! and limitations under the License.
 !
 ! When distributing Covered Code, include this CDDL HEADER in each
 ! file and include the License file at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 ! add the following below this CDDL HEADER, with the fields enclosed
 ! by brackets "[]" replaced with your own identifying information:
 !      Portions Copyright [yyyy] [name of copyright owner]
 !
 ! CDDL HEADER END
 !
 !      Copyright 2008 Sun Microsystems, Inc.
 ! -->
<stax>
  <defaultcall function="modifyLoadPreamble"/>
  <!-- ************************************************************ -->
  <!-- Client preamble is automatically called by the scheduler     -->
  <!-- and must always define all the parameters below              -->
  <function name="modifyLoadPreamble" scope="local">
    <function-map-args>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
      <function-arg-def name="suffix"     type="required"/>
      <function-arg-def name="outFile"    type="required"/>
      <function-arg-def name="fileFd"     type="required"/>
    </function-map-args>
    <sequence>
      <!-- ===================   Comments   =================== -->
      <!-- client is run under paralleliterate tag              -->
      <!-- each variables defined are internal                  -->
      <!-- client should have its own err_num variable in order -->
      <!-- to inform scheduler if it has pass/fail status       -->
      <script>
        errNum = 0
        msg = ''
      </script>
      <!-- ==================    Parser     =================== -->
      <!-- parse the client parameters :                        -->
      <!-- params is [[param1,val1],[param2,val2],...]          -->
      <!-- get the ldap instance parameters                     -->
      <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
              file="'%s/%sLib.xml' % (client.getPath(),client.getName())"/>
      <call function="'%sParser' % client.getName()">
      {
        'client'     : client,
        'instances'  : instances,
        'duration'   : duration,
        'suffix'     : suffix
      }
      </call>
      <if expr="msg.find('ERROR') != -1">
        <sequence>
          <message>'%s' % msg</message>
          <call function="'writeOperationResult'">
            {
              'returncode' : '1',
              'expected'   : '0',
              'result'     : msg,
              'status'     : 'ERROR',
              'fileFd'     : fileFd
            }
          </call>
          <script>
            errNum += 1
          </script>
        </sequence>
      <else>
        <sequence>
          <!-- ==== Add execute permission to build.ksh file ==== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'chmod',
            'fileFd'  : fileFd }
          </call>
          <call function="'writeMessage'">
          {'content' : 'Add execute permission to build.ksh file',
           'fileFd'  : fileFd}
          </call>
          <process name="'%s: chmod +x build.ksh' % client.getHost()">
            <location>client.getHost()</location>
            <command mode="'shell'">'chmod +x build.ksh'</command>
            <parms/>
            <workdir>client.getPath()</workdir>
            <envs>['PATH=/bin:/usr/bin']</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <call function="'checkRC'">
            { 'returncode' : RC,
              'result'     : STAXResult[0][1],
              'fileFd'     : fileFd }
          </call>
          <script>
            errNum += STAXResult
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
          <!-- ==== Build client : run build.ksh file ==== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'build',
            'fileFd'  : fileFd }
          </call>
          <call function="'writeMessage'">
          {'content' : 'Build client',
           'fileFd'  : fileFd}
          </call>
          <!-- Build Client in unique directory (compilDir), avoid          -->
          <!-- conflict if same client is run several time at the same time -->
          <process name="'%s: build %s' % (client.getHost(),client.getName())">
            <location>client.getHost()</location>
            <command mode="'shell'">'./build.ksh'</command>
            <parms/>
            <workdir>client.getPath()</workdir>
            <envs>['PATH=%s/bin:/bin:/usr/bin' % JAVA_HOME,'COMPILDIR=%s' % compilDir]</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <call function="'checkRC'">
            { 'returncode' : RC,
              'result'     : STAXResult[0][1],
              'fileFd'     : fileFd }
          </call>
          <if expr="RC != 0">
            <message>
              'FAILED to build client %s on %s' % \
              (client.getName(),client.getHost())
            </message>
          </if>
          <script>
            errNum += STAXResult
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
        </sequence>
      </else>
      </if>
      <return> errNum </return>
    </sequence>
  </function>
</stax>
opends/tests/system-tests/clients/restartDs/restartDs.xml
@@ -35,7 +35,6 @@
  <!-- always define all the parameters below                       -->
  <function name="restartDs" scope="local">
    <function-map-args>
      <function-arg-def name="workingDir" type="required"/>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
opends/tests/system-tests/clients/searchLoad/searchLoad.xml
@@ -28,14 +28,13 @@
<stax>
  <defaultcall function="searchLoad"/>
  <!-- ************************************************************ -->
  <!-- Client is automatically called by the scheduler and must     -->
  <!-- always define all the parameters below                       -->
  <function name="searchLoad" scope="local">
  <function name="searchLoad">
    <function-map-args>
      <function-arg-def name="workingDir" type="required"/>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
@@ -55,70 +54,20 @@
        msg = ''
      </script>
      
      <!-- ==================    Preamble   =================== -->
      <!-- ==================    Parser     =================== -->
      <!-- parse the client parameters :                        -->
      <!-- params is [[param1,val1],[param2,val2],...]          -->
      <!-- get the ldap instance parameters                     -->
      <script>
        compilDir = '%s/%s_%s' % (workingDir,client.getHost(),client.getId())
        #
        # Extract client parameters from client.getParams()
        #
        cParams = client.getParams()
        try:
          serverInstanceFromClient = cParams[0][1]
        except IndexError:
          serverInstanceFromClient = NOT_DEFINED
          msg = '%s\nERROR: serverInstanceFromClient undefined,mandatory' % msg
        try:
          baseDn = cParams[1][1]
        except IndexError:
          baseDn = NOT_DEFINED
          msg = '%s\nERROR: baseDn undefined,mandatory' % msg
        try:
          nbCnx = cParams[2][1]
        except IndexError:
          nbCnx = NOT_DEFINED
          msg = '%s\nERROR: nbCnx undefined,mandatory' % msg
        try:
          nbMaxSearch = cParams[3][1]
        except IndexError:
          nbMaxSearch = NOT_DEFINED
          msg = '%s\nERROR: nbMaxOperations undefined,mandatory' % msg
        try:
          attributeName = cParams[4][1]
        except IndexError:
          attributeName = NOT_DEFINED
        #
        # setup parms to run the client
        #
        if serverInstanceFromClient != NOT_DEFINED:
          sys.path.append("%s/phases/scheduler" % TESTS_DIR )
          from scheduler import getInstance
          serverInstance = getInstance(serverInstanceFromClient,instances)
          if (serverInstance == 'ERROR'):
            msg = '%s\nERROR: cant find client instance named' % msg
            msg = '%s %s in server instance list' % \
                  (msg,serverInstanceFromClient)
          else:
            # remove sec, try to finish before timer kill -9 the client
            duration = duration - 20
            parms=[]
            parms.append('-h %s -p %s' % \
                       (serverInstance.getHost(),serverInstance.getLDAPPort()))
            parms.append('-b "%s"' % baseDn)
            parms.append('-D "%s" -w "%s"' % \
                        (DIRECTORY_INSTANCE_DN,DIRECTORY_INSTANCE_PSWD))
            parms.append('-t %s -M %s -d %s' % (nbCnx,nbMaxSearch,duration))
            if attributeName != NOT_DEFINED:
              parms.append('-a %s' % attributeName)
            parms = ' '.join(parms)
      </script>
      <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
              file="'%s/%sLib.xml' % (client.getPath(),client.getName())"/>
      <call function="'%sParser' % client.getName()">
      {
        'client'     : client,
        'instances'  : instances,
        'duration'   : duration,
        'suffix'     : suffix
      }
      </call>
      
      <if expr="msg.find('ERROR') != -1">
        <sequence>
@@ -138,78 +87,6 @@
        </sequence>
      <else>
        <sequence>
          <!-- ==== Add execute permission to build.ksh file ==== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'chmod',
            'fileFd'  : fileFd }
          </call>
          <call function="'writeMessage'">
          {'content' : 'Add execute permission to build.ksh file',
           'fileFd'  : fileFd}
          </call>
          <process name="'%s: chmod +x build.ksh' % client.getHost()">
            <location>client.getHost()</location>
            <command mode="'shell'">'chmod +x build.ksh'</command>
            <parms/>
            <workdir>workingDir</workdir>
            <envs>['PATH=/bin:/usr/bin']</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <call function="'checkRC'">
            { 'returncode' : RC,
              'result'     : STAXResult[0][1],
              'fileFd'     : fileFd }
          </call>
          <script>
            errNum += STAXResult
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
          <!-- ==== Build client : run build.ksh file ==== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'build',
            'fileFd'  : fileFd }
          </call>
          <call function="'writeMessage'">
          {'content' : 'Build client',
           'fileFd'  : fileFd}
          </call>
          <!-- Build Client in unique directory (compilDir), avoid          -->
          <!-- conflict if same client is run several time at the same time -->
          <process name="'%s: build %s' % (client.getHost(),client.getName())">
            <location>client.getHost()</location>
            <command mode="'shell'">'./build.ksh'</command>
            <parms/>
            <workdir>workingDir</workdir>
            <envs>['PATH=%s/bin:/bin:/usr/bin' % JAVA_HOME,'COMPILDIR=%s' % compilDir ]</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <call function="'checkRC'">
            { 'returncode' : RC,
              'result'     : STAXResult[0][1],
              'fileFd'     : fileFd }
          </call>
          <if expr="RC != 0">
            <message>
              'FAILED to build client %s on %s' % \
              (client.getName(),client.getHost())
            </message>
          </if>
          <script>
            errNum += STAXResult
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
          <!-- ========== Run the client ========== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'run',
@@ -223,9 +100,11 @@
          </call>
          
          <script>
            cParam = '-client -Xmx1G -Xms1G'
            cParam = '%s -XX:NewRatio=1 -XX:SurvivorRatio=100' % cParam
            cParam = '%s -cp %s/clients/LDAPjdk/ldapjdk.jar' % (cParam,LOCAL_TESTS_DIR)
            cParam = '-client'
            # cParam = '%s -Xmx1G -Xms1G' % cParam
            # cParam = '%s -XX:NewRatio=1 -XX:SurvivorRatio=100' % cParam
            cParam = '%s -cp %s/clients/LDAPjdk/ldapjdk.jar' % \
                     (cParam,LOCAL_TESTS_DIR)
            cParam = '%s:%s/search.jar' % (cParam,compilDir)
            cParam = '%s Client %s' % (cParam,parms)
            
@@ -233,11 +112,17 @@
                        (client.getHost(),client.getName(),
                         serverInstance.getName())
          </script>
          <call function="'writeMessage'">
          { 'fileFd'  : fileFd,
            'content' : 'cmd : cd %s ; %s/bin/java %s' % \
                        (client.getPath(),JAVA_HOME,cParam)
          }
          </call>
          <process name="'%s' % titleName">
            <location>client.getHost()</location>
            <command>'%s/bin/java' % JAVA_HOME</command>
            <parms>cParam </parms>
            <workdir>workingDir</workdir>
            <workdir>client.getPath()</workdir>
            <envs>['PATH=%s/bin:/bin:/usr/bin' % JAVA_HOME]</envs>
            <stderr mode="'stdout'"/>
            <stdout>outFile</stdout>
@@ -255,31 +140,12 @@
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
          
          <!-- ========== Postamble ========== -->
          <call function="'writeMessage'">
          {'content' : 'Output file %s' % outFile,
           'xlink'   : outFile,
           'fileFd'  : fileFd}
          </call>
          
          <process name="'%s:%s: Grep' % (client.getHost(),client.getName())">
            <location>client.getHost()</location>
            <command mode="'shell'">
              "grep 'TOTAL' %s | cut -d ' ' -f3-" % outFile
            </command>
            <envs>['PATH=/bin:/usr/bin']</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <script>
            summary = STAXResult[0][1]
          </script>
          <call function="'writeMessage'">
          {'content' : 'Summary %s' % (summary),
           'fileFd'  : fileFd}
          </call>
        </sequence>
      </else>
      </if>
@@ -291,6 +157,5 @@
  </function>
  
  
</stax>
opends/tests/system-tests/clients/searchLoad/searchLoadLib.xml
New file
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
<!--
 ! CDDL HEADER START
 !
 ! The contents of this file are subject to the terms of the
 ! Common Development and Distribution License, Version 1.0 only
 ! (the "License").  You may not use this file except in compliance
 ! with the License.
 !
 ! You can obtain a copy of the license at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
 ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 ! See the License for the specific language governing permissions
 ! and limitations under the License.
 !
 ! When distributing Covered Code, include this CDDL HEADER in each
 ! file and include the License file at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 ! add the following below this CDDL HEADER, with the fields enclosed
 ! by brackets "[]" replaced with your own identifying information:
 !      Portions Copyright [yyyy] [name of copyright owner]
 !
 ! CDDL HEADER END
 !
 !      Copyright 2008 Sun Microsystems, Inc.
 ! -->
<stax>
  <defaultcall function="searchLoadParser"/>
  <!-- ************************************************************ -->
  <!-- Client Parser -->
  <!-- This function must NOT have scope=local has its variables may -->
  <!-- be used by the caller -->
  <function name="searchLoadParser">
    <function-map-args>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
      <function-arg-def name="suffix"     type="required"/>
    </function-map-args>
    <sequence>
      <script>
        compilDir = '%s/%s_%s' % \
                    (client.getPath(),client.getHost(),client.getId())
        #
        # Extract client parameters from client.getParams()
        #
        cParams = client.getParams()
        try:
          serverInstanceFromClient = cParams[0][1]
        except IndexError:
          serverInstanceFromClient = NOT_DEFINED
          msg = '%s\nERROR: serverInstanceFromClient undefined,mandatory' % msg
        try:
          baseDn = cParams[1][1]
        except IndexError:
          baseDn = NOT_DEFINED
          msg = '%s\nERROR: baseDn undefined,mandatory' % msg
        try:
          nbCnx = cParams[2][1]
        except IndexError:
          nbCnx = NOT_DEFINED
          msg = '%s\nERROR: nbCnx undefined,mandatory' % msg
        try:
          nbMaxSearch = cParams[3][1]
        except IndexError:
          nbMaxSearch = NOT_DEFINED
          msg = '%s\nERROR: nbMaxOperations undefined,mandatory' % msg
        try:
          attributeName = cParams[4][1]
        except IndexError:
          attributeName = NOT_DEFINED
        #
        # setup parms to run the client
        #
        if serverInstanceFromClient != NOT_DEFINED:
          sys.path.append("%s/phases/scheduler" % TESTS_DIR )
          from scheduler import getInstance
          serverInstance = getInstance(serverInstanceFromClient,instances)
          if (serverInstance == 'ERROR'):
            msg = '%s\nERROR: cant find client instance named' % msg
            msg = '%s %s in server instance list' % \
                  (msg,serverInstanceFromClient)
          else:
            # remove sec, try to finish before timer kill -9 the client
            duration = duration - 20
            parms=[]
            parms.append('-h %s -p %s' % \
                       (serverInstance.getHost(),serverInstance.getLDAPPort()))
            parms.append('-b "%s"' % baseDn)
            parms.append('-D "%s" -w "%s"' % \
                        (DIRECTORY_INSTANCE_DN,DIRECTORY_INSTANCE_PSWD))
            parms.append('-t %s -M %s -d %s' % (nbCnx,nbMaxSearch,duration))
            if attributeName != NOT_DEFINED:
              parms.append('-a %s' % attributeName)
            parms = ' '.join(parms)
      </script>
    </sequence>
  </function>
</stax>
opends/tests/system-tests/clients/searchLoad/searchLoadPostamble.xml
New file
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
<!--
 ! CDDL HEADER START
 !
 ! The contents of this file are subject to the terms of the
 ! Common Development and Distribution License, Version 1.0 only
 ! (the "License").  You may not use this file except in compliance
 ! with the License.
 !
 ! You can obtain a copy of the license at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
 ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 ! See the License for the specific language governing permissions
 ! and limitations under the License.
 !
 ! When distributing Covered Code, include this CDDL HEADER in each
 ! file and include the License file at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 ! add the following below this CDDL HEADER, with the fields enclosed
 ! by brackets "[]" replaced with your own identifying information:
 !      Portions Copyright [yyyy] [name of copyright owner]
 !
 ! CDDL HEADER END
 !
 !      Copyright 2008 Sun Microsystems, Inc.
 ! -->
<stax>
  <defaultcall function="searchLoadPostamble"/>
  <!-- ************************************************************ -->
  <!-- Client postamble is automatically called by the scheduler    -->
  <!-- and must always define all the parameters below              -->
  <function name="searchLoadPostamble" scope="local">
    <function-map-args>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
      <function-arg-def name="suffix"     type="required"/>
      <function-arg-def name="outFile"    type="required"/>
      <function-arg-def name="fileFd"     type="required"/>
    </function-map-args>
    <sequence>
      <!-- ===================   Comments   =================== -->
      <!-- client is run under paralleliterate tag              -->
      <!-- each variables defined are internal                  -->
      <!-- client should have its own err_num variable in order -->
      <!-- to inform scheduler if it has pass/fail status       -->
      <script>
        errNum = 0
        msg = ''
      </script>
      <!-- ==================    Parser     =================== -->
      <!-- parse the client parameters :                        -->
      <!-- params is [[param1,val1],[param2,val2],...]          -->
      <!-- get the ldap instance parameters                     -->
      <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
              file="'%s/%sLib.xml' % (client.getPath(),client.getName())"/>
      <call function="'%sParser' % client.getName()">
      {
        'client'     : client,
        'instances'  : instances,
        'duration'   : duration,
        'suffix'     : suffix
      }
      </call>
      <if expr="msg.find('ERROR') != -1">
        <sequence>
          <message>'%s' % msg</message>
          <call function="'writeOperationResult'">
            {
              'returncode' : '1',
              'expected'   : '0',
              'result'     : msg,
              'status'     : 'ERROR',
              'fileFd'     : fileFd
            }
          </call>
          <script>
            errNum += 1
          </script>
        </sequence>
      <else>
        <sequence>
          <process name="'%s:%s: Grep' % (client.getHost(),client.getName())">
            <location>client.getHost()</location>
            <command mode="'shell'">
              "grep 'TOTAL' %s | cut -d ' ' -f3-" % outFile
            </command>
            <envs>['PATH=/bin:/usr/bin']</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <script>
            summary = STAXResult[0][1]
          </script>
          <call function="'writeMessage'">
          {'content' : 'Summary %s' % (summary),
           'fileFd'  : fileFd}
          </call>
        </sequence>
      </else>
      </if>
      <return> errNum </return>
    </sequence>
  </function>
</stax>
opends/tests/system-tests/clients/searchLoad/searchLoadPreamble.xml
New file
@@ -0,0 +1,164 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
<!--
 ! CDDL HEADER START
 !
 ! The contents of this file are subject to the terms of the
 ! Common Development and Distribution License, Version 1.0 only
 ! (the "License").  You may not use this file except in compliance
 ! with the License.
 !
 ! You can obtain a copy of the license at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
 ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 ! See the License for the specific language governing permissions
 ! and limitations under the License.
 !
 ! When distributing Covered Code, include this CDDL HEADER in each
 ! file and include the License file at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 ! add the following below this CDDL HEADER, with the fields enclosed
 ! by brackets "[]" replaced with your own identifying information:
 !      Portions Copyright [yyyy] [name of copyright owner]
 !
 ! CDDL HEADER END
 !
 !      Copyright 2008 Sun Microsystems, Inc.
 ! -->
<stax>
  <defaultcall function="searchLoadPreamble"/>
  <!-- ************************************************************ -->
  <!-- Client preamble is automatically called by the scheduler     -->
  <!-- and must always define all the parameters below              -->
  <function name="searchLoadPreamble" scope="local">
    <function-map-args>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
      <function-arg-def name="suffix"     type="required"/>
      <function-arg-def name="outFile"    type="required"/>
      <function-arg-def name="fileFd"     type="required"/>
    </function-map-args>
    <sequence>
      <!-- ===================   Comments   =================== -->
      <!-- client is run under paralleliterate tag              -->
      <!-- each variables defined are internal                  -->
      <!-- client should have its own err_num variable in order -->
      <!-- to inform scheduler if it has pass/fail status       -->
      <script>
        errNum = 0
        msg = ''
      </script>
      <!-- ==================    Parser     =================== -->
      <!-- parse the client parameters :                        -->
      <!-- params is [[param1,val1],[param2,val2],...]          -->
      <!-- get the ldap instance parameters                     -->
      <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
              file="'%s/%sLib.xml' % (client.getPath(),client.getName())"/>
      <call function="'%sParser' % client.getName()">
      {
        'client'     : client,
        'instances'  : instances,
        'duration'   : duration,
        'suffix'     : suffix
      }
      </call>
      <if expr="msg.find('ERROR') != -1">
        <sequence>
          <message>'%s' % msg</message>
          <call function="'writeOperationResult'">
            {
              'returncode' : '1',
              'expected'   : '0',
              'result'     : msg,
              'status'     : 'ERROR',
              'fileFd'     : fileFd
            }
          </call>
          <script>
            errNum += 1
          </script>
        </sequence>
      <else>
        <sequence>
          <!-- ==== Add execute permission to build.ksh file ==== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'chmod',
            'fileFd'  : fileFd }
          </call>
          <call function="'writeMessage'">
          {'content' : 'Add execute permission to build.ksh file',
           'fileFd'  : fileFd}
          </call>
          <process name="'%s: chmod +x build.ksh' % client.getHost()">
            <location>client.getHost()</location>
            <command mode="'shell'">'chmod +x build.ksh'</command>
            <parms/>
            <workdir>client.getPath()</workdir>
            <envs>['PATH=/bin:/usr/bin']</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <call function="'checkRC'">
            { 'returncode' : RC,
              'result'     : STAXResult[0][1],
              'fileFd'     : fileFd }
          </call>
          <script>
            errNum += STAXResult
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
          <!-- ==== Build client : run build.ksh file ==== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'build',
            'fileFd'  : fileFd }
          </call>
          <call function="'writeMessage'">
          {'content' : 'Build client',
           'fileFd'  : fileFd}
          </call>
          <!-- Build Client in unique directory (compilDir), avoid          -->
          <!-- conflict if same client is run several time at the same time -->
          <process name="'%s: build %s' % (client.getHost(),client.getName())">
            <location>client.getHost()</location>
            <command mode="'shell'">'./build.ksh'</command>
            <parms/>
            <workdir>client.getPath()</workdir>
            <envs>['PATH=%s/bin:/bin:/usr/bin' % JAVA_HOME,'COMPILDIR=%s' % compilDir ]</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <call function="'checkRC'">
            { 'returncode' : RC,
              'result'     : STAXResult[0][1],
              'fileFd'     : fileFd }
          </call>
          <if expr="RC != 0">
            <message>
              'FAILED to build client %s on %s' % \
              (client.getName(),client.getHost())
            </message>
          </if>
          <script>
            errNum += STAXResult
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
        </sequence>
      </else>
      </if>
      <return> errNum </return>
    </sequence>
  </function>
</stax>
opends/tests/system-tests/clients/verdictOpends/verdictOpends.xml
@@ -35,7 +35,6 @@
  <!-- always define all the parameters below                       -->
  <function name="verdictOpends" scope="local">
    <function-map-args>
      <function-arg-def name="workingDir" type="required"/>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
opends/tests/system-tests/phases/configuration/configuration_opends.xml
@@ -137,7 +137,7 @@
            }
          </call>
          <script>
            logFile = STAXResult
            logFile = STAXResult[0]
            
            fileList.append(logFile)
            
@@ -223,7 +223,7 @@
            }
          </call>
          <script>
            logFile = STAXResult
            logFile = STAXResult[0]
            
            # reopen existing files, no need to add in fileList variable 
            # as it has already been added
@@ -580,7 +580,7 @@
            }
          </call>
          <script>
            logFile = STAXResult
            logFile = STAXResult[0]
            # reopen existing files, no need to add in fileList variable
            # as it has already been added
            cFileFd = open(logFile,'a')
@@ -839,7 +839,7 @@
            }
          </call>
          <script>
            logFile = STAXResult
            logFile = STAXResult[0]
            # reopen existing files, no need to add in fileList variable
            # as it has already been added
            cFileFd = open(logFile,'a')
@@ -909,7 +909,7 @@
            }
          </call>
          <script>
            logFile = STAXResult
            logFile = STAXResult[0]
            # reopen existing files, no need to add in fileList variable
            # as it has already been added
            cFileFd = open(logFile,'a')
@@ -978,7 +978,7 @@
            }
          </call>
          <script>
            logFile = STAXResult
            logFile = STAXResult[0]
            # reopen existing files, no need to add in fileList variable
            # as it has already been added
            cFileFd = open(logFile,'a')
opends/tests/system-tests/phases/installation/installation_opends.xml
@@ -64,7 +64,7 @@
            }
          </call>
          <script>
            logFile = STAXResult
            logFile = STAXResult[0]
            
            fileList.append(logFile)
            
opends/tests/system-tests/phases/log/log.xml
@@ -80,24 +80,28 @@
    <sequence>
      <if expr="type == 'client'">
        <script>
          logFile = '%s/%s_%s_%s_%s.xml' % \
                    ( LOG_TMP_DIR,prefix,\
          logName = '%s_%s_%s_%s' % \
                    ( prefix,\
                      object.getName(),object.getHost(),object.getId())
        </script>
      <elseif expr="type == 'instance'">
        <script>
          logFile = '%s/%s_%s_%s.xml' % \
          (LOG_TMP_DIR,prefix,object.getName(),object.getHost())
          logName = '%s_%s_%s' % (prefix,object.getName(),object.getHost())
        </script>
      </elseif>
      <else>
        <script>
          logFile = 'getLogFileName_%s' % NOT_DEFINED
          logName = 'getLogFileName_%s' % NOT_DEFINED
        </script>
      </else>
      </if>
      <script>
        logFile = '%s/%s.xml' % (LOG_TMP_DIR,logName)
      </script>
      <return>
        logFile
        [ logFile , logName ]
      </return>
    </sequence>
  </function>
@@ -212,7 +216,7 @@
                    }
                  </call>
                  <script>
                    cFileList.append(STAXResult)
                    cFileList.append(STAXResult[0])
                  </script>
                </sequence>
              </iterate>
opends/tests/system-tests/phases/main_run_lib.xml
@@ -346,6 +346,23 @@
        </sequence>
      </if>
      
      <!-- Set path to clients -->
      <!-- set local client by default if exist in the scenario -->
      <!-- else get the shared client if exist -->
      <call function="'getEnabledClients'">{'scheduler':scheduler}</call>
      <script>clients = STAXResult </script>
      <if expr="len(clients) > 0">
        <paralleliterate in="clients" var="client">
          <sequence>
            <call function="'clientSetPath'">
            { 'client' : client }
            </call>
          </sequence>
        </paralleliterate>
      </if>
      <message log="1">
        '== Found %s Error(s) during this phase' % (ERR_NUM[0])
      </message>
opends/tests/system-tests/phases/parser/object_lib.xml
@@ -86,5 +86,60 @@
      <return>clients</return>
    </sequence>
  </function>
  <!-- ************************************************************ -->
  <function name="clientSetPath">
    <function-map-args>
      <function-required-arg name="client"/>
    </function-map-args>
    <sequence>
      <script>
        localWorkingDir = '%s/scenario/%s/clients/%s' % \
                           (LOCAL_TESTS_DIR,DIR_NAME,client.getName())
        sharedWorkingdir = '%s/clients/%s/' % \
                           (LOCAL_TESTS_DIR,client.getName())
      </script>
      <call function="'isFile'">
      {
        'location' : client.getHost(),
        'fileName' : '%s/%s.xml' % (localWorkingDir,client.getName())
      }
      </call>
      <script>
        localClientExist = STAXResult
      </script>
      <call function="'isFile'">
      {
        'location' : client.getHost(),
        'fileName' : '%s/%s.xml' % (sharedWorkingdir,client.getName())
      }
      </call>
      <script>
        sharedClientExist = STAXResult
      </script>
      <!-- use local client by default else the shared client -->
      <if expr="localClientExist == TRUE">
        <script> client.setPath(localWorkingDir) </script>
      <elseif expr="sharedClientExist == TRUE">
        <script> client.setPath(sharedWorkingdir) </script>
      </elseif>
      <else>
        <sequence>
          <message>
            'ERROR : cant find files %s/%s.xml, %s/%s.xml'% \
            (localWorkingDir,client.getName(),\
             sharedWorkingdir,client.getName())
          </message>
          <script> ERR_NUM[0] += 1 </script>
        </sequence>
      </else>
      </if>
    </sequence>
  </function>
</stax>
opends/tests/system-tests/phases/parser/parser.py
@@ -456,6 +456,7 @@
    self.logDir     = NOT_DEFINED
    self.startDate  = NOT_DEFINED
    self.stopDate   = NOT_DEFINED
    self.path       = NOT_DEFINED
    
  def getId(self):
    return self.iid
@@ -513,6 +514,12 @@
    
  def setStopDate(self,stopDate):
    self.stopDate = stopDate
  def getPath(self):
    return self.path
  def setPath(self,path):
    self.path = path
###########################
opends/tests/system-tests/phases/scheduler/scheduler.xml
@@ -140,7 +140,6 @@
    <sequence>
      <!--==========  Define variables  =========-->
      <script>
        fileList = STAXGlobal([])
        finishedClients = STAXGlobal([])
      </script>
      
@@ -188,8 +187,7 @@
            }
          </call>
          <script>
            logFile = STAXResult
            fileList.append(logFile)
            logFile = STAXResult[0]
            fileFd = open(logFile,'w')
          </script>
          <!-- == Write tag for xml report -->
@@ -308,14 +306,14 @@
      <script>
        startTime=strftime("%Y%m%d@%H:%M:%S",localtime())
        client.setStartDate(startTime)
        errNum = NOT_DEFINED
        errNum = 0
      </script>
      
      <!--=============== Log info =======================================-->
      <if expr="client.getHost() == NOT_DEFINED">
        <sequence>
          <script>
            str = '++ Start client %s'         % (client.getName())
            str = '++ START CLIENT %s'         % (client.getName())
            str = '%s (id=%s)'                 % (str, client.getId())
            str = '%s at %s'                   % (str, startTime)
            str = '%s, max duration is %s sec' % (str, duration)
@@ -330,7 +328,7 @@
      <else>
        <sequence>
          <script>
            str = '++ Start client %s'         % (client.getName())
            str = '++ START CLIENT %s'         % (client.getName())
            str = '%s (id=%s)'                 % (str, client.getId())
            str = '%s running on %s'           % (str, client.getHost())
            str = '%s at %s'                   % (str, startTime)
@@ -346,65 +344,43 @@
      </else>
      </if>
      
      <!--=============== Start the client under a timer =================-->
      <!--== open logfile for details                                   ==-->
      <!-- All informations loged in this this function will              -->
      <!-- not be displayed in the main report, to avoid broken xml file  -->
       <call function="'getLogFileName'">
        {
          'type'   : 'client',
          'object' : client,
          'prefix' : 'client_details'
        }
      </call>
      <script>
        logFileDetails = STAXResult
        logFileDetailsRelativePath = logFileDetails.replace(LOG_DIR,'.')
        fileList.append(logFileDetails)
        fileFdDetails = open(logFileDetails,'w')
        outFile = '%s/client_%s_id%s.txt' % \
                  (client.getLogDir(),client.getName(),client.getId())
      </script>
      <call function="'startTimer'">
      <!--=============== Run client phases ==============================-->
      <call function="'runClientPreamble'">
      { 
        'client'     : client,
        'instances'  : instances,
        'duration'   : duration,
        'suffix'     : suffix,
        'outFile'    : outFile,
        'fileFd'     : fileFdDetails
        'client'    : client,
        'instances' : instances,
        'duration'  : duration,
        'suffix'    : suffix,
        'fileFd'    : fileFd
      }
      </call>
      <script>
        fileFdDetails.close()
        errNum = STAXResult[0]
        timerKilled = STAXResult[1]
      <script> errNum += STAXResult </script>
      <call function="'runClientMain'">
      {
        'client'    : client,
        'instances' : instances,
        'duration'  : duration,
        'suffix'    : suffix,
        'fileFd'    : fileFd
      }
      </call>
      <script>
        errNum += STAXResult[0]
        outFileRun = STAXResult[1]
      </script>
      
      <!--=============== Analyze client run status ======================-->
      <if expr="timerKilled == TRUE">
        <sequence>
          <script>
            errMsg = 'ERROR: client %s has been killed,' % client.getName()
          </script>
          <call function="'writeMessage'">
            {
              'content' : errMsg,
              'fileFd'  : fileFd
            }
          </call>
          <message> errMsg </message>
          <script>
            ERR_NUM[0] += 1
          </script>
        </sequence>
      </if>
      <script>
        finishedClients.append(client.getId())
      </script>
      <call function="'runClientPostamble'">
      {
        'client'    : client,
        'instances' : instances,
        'duration'  : duration,
        'suffix'    : suffix,
        'outFile'   : outFileRun,
        'fileFd'    : fileFd
      }
      </call>
      <script> errNum += STAXResult </script>
      
      <!--=============== Log info =======================================-->
      <script>
@@ -412,23 +388,9 @@
        client.setStopDate(stopTime)
      </script>
      <message>
        '-- Stop %s client (id %s) running on %s at %s' %\
        '-- STOP CLIENT %s (id %s) running on %s at %s' %\
        (client.getName(),client.getId(),client.getHost(),stopTime)
      </message>
      <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>
      
      
      <!--=============== Set client result ==============================-->
@@ -458,6 +420,336 @@
      
    </sequence>
  </function>
  <!-- ************************************************************ -->
  <function name="runClientPreamble" scope="local">
    <function-map-args>
      <function-arg-def name="client" type="required"/>
      <function-arg-def name="duration" type="required"/>
      <function-arg-def name="instances" type="required"/>
      <function-arg-def name="suffix" type="required"/>
      <function-arg-def name="fileFd" type="required"/>
    </function-map-args>
    <sequence>
      <call function="'isFile'">
      {
        'location' : client.getHost(),
        'fileName' : '%s/%sPreamble.xml' % (client.getPath(),client.getName()),
      }
      </call>
      <script>
        fileExist = STAXResult
      </script>
      <if expr="fileExist == TRUE">
        <sequence>
          <script>
            errNum = 0
          </script>
          <!--============= Start the client under a timer =================-->
          <!--== open logfile for details                                 ==-->
          <!-- All informations loged in this this function will            -->
          <!-- not be displayed in the main report, to avoid broken xml file-->
           <call function="'getLogFileName'">
            {
              'type'   : 'client',
              'object' : client,
              'prefix' : 'client_details_preamble'
            }
          </call>
          <script>
            logFileDetails = STAXResult[0]
            logFileDetailsName = STAXResult[1]
            logFileDetailsRelativePath = logFileDetails.replace(LOG_DIR,'.')
            fileFdDetails = open(logFileDetails,'w')
            outFile = '%s/%s.txt' % (client.getLogDir(),logFileDetailsName)
          </script>
          <message>
            '   Start preamble for %s (id=%s) running on %s' % \
            (client.getName(),client.getId(), client.getHost())
          </message>
          <!-- ==== Log info ====================================-->
          <!--== Write root tag for xml details file -->
          <script>
            str = '&lt;?xml version=\"1.0\" encoding=\"UTF-8\"'
            str = '%s standalone=\"no\"?&gt;\n' % str
            str = '%s &lt;?xml-stylesheet type="text/xsl"' % str
            str = '%s href="clientDetails.xsl"?>\n' % str
            fileFdDetails.write(str)
          </script>
          <call function="'writeStartTagClient'">
          {
            'client'          : client,
            'extraParameters' : 'xmlns:xlink="http://www.w3.org/1999/xlink"',
            'fileFd'          : fileFdDetails
          }
          </call>
          <call function="'writeMessage'">
          {
            'content' : 'Client Preamble details',
            'fileFd'  : fileFdDetails,
          }
          </call>
          <!--=============== run preamble =================================-->
          <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
           file="'%s/%sPreamble.xml' % (client.getPath(),client.getName())"/>
          <call function="'%sPreamble' % client.getName()">
          {
            'client'     : client,
            'instances'  : instances,
            'duration'   : duration,
            'suffix'     : suffix,
            'outFile'    : outFile,
            'fileFd'     : fileFdDetails
          }
          </call>
          <script>
            errNum = STAXResult
          </script>
          <!--=============== Log info =====================================-->
          <call function="'writeMessage'">
          {
            'content' : 'Client preamble : %s' % logFileDetails,
            'xlink'   : logFileDetailsRelativePath,
            'fileFd'  : fileFd
          }
          </call>
          <!--== Close root tag for xml details file -->
          <call function="'writeEndTagClient'">
          { 'fileFd'    : fileFdDetails }
          </call>
          <script> fileFdDetails.close() </script>
          <message>
            '   Stop pretamble for %s (id=%s) running on %s' % \
            (client.getName(),client.getId(), client.getHost())
          </message>
        </sequence>
      <else>
        <message>
          '   File not found, skip preamble : %s/%sPreamble.xml' % \
          (client.getPath(),client.getName())
        </message>
      </else>
      </if>
      <return>errNum</return>
    </sequence>
  </function>
  <!-- ************************************************************ -->
  <function name="runClientPostamble" scope="local">
    <function-map-args>
      <function-arg-def name="client" type="required"/>
      <function-arg-def name="duration" type="required"/>
      <function-arg-def name="instances" type="required"/>
      <function-arg-def name="suffix" type="required"/>
      <function-arg-def name="outFile" type="required"/>
      <function-arg-def name="fileFd" type="required"/>
    </function-map-args>
    <sequence>
      <call function="'isFile'">
      {
        'location' : client.getHost(),
        'fileName' : '%s/%sPostamble.xml'%(client.getPath(),client.getName()),
      }
      </call>
      <script>
        fileExist = STAXResult
      </script>
      <if expr="fileExist == TRUE">
        <sequence>
          <script>
            errNum = 0
          </script>
          <!--============= Start the client under a timer =================-->
          <!--== open logfile for details                                 ==-->
          <!-- All informations loged in this this function will            -->
          <!-- not be displayed in the main report, to avoid broken xml file-->
           <call function="'getLogFileName'">
            {
              'type'   : 'client',
              'object' : client,
              'prefix' : 'client_details_postamble'
            }
          </call>
          <script>
            logFileDetails = STAXResult[0]
            logFileDetailsName = STAXResult[1]
            logFileDetailsRelativePath = logFileDetails.replace(LOG_DIR,'.')
            fileFdDetails = open(logFileDetails,'w')
          </script>
          <message>
            '   Start postamble for %s (id=%s) running on %s' % \
            (client.getName(),client.getId(), client.getHost())
          </message>
          <!-- ==== Log info ====================================-->
          <!--== Write root tag for xml details file -->
          <script>
            str = '&lt;?xml version=\"1.0\" encoding=\"UTF-8\"'
            str = '%s standalone=\"no\"?&gt;\n' % str
            str = '%s &lt;?xml-stylesheet type="text/xsl"' % str
            str = '%s href="clientDetails.xsl"?>\n' % str
            fileFdDetails.write(str)
          </script>
          <call function="'writeStartTagClient'">
          {
            'client'          : client,
            'extraParameters' : 'xmlns:xlink="http://www.w3.org/1999/xlink"',
            'fileFd'          : fileFdDetails
          }
          </call>
          <call function="'writeMessage'">
          {
            'content' : 'Client Postamble details',
            'fileFd'  : fileFdDetails,
          }
          </call>
          <!--=============== run postamble ================================-->
          <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
           file="'%s/%sPostamble.xml' % (client.getPath(),client.getName())"/>
          <call function="'%sPostamble' % client.getName()">
          {
            'client'     : client,
            'instances'  : instances,
            'duration'   : duration,
            'suffix'     : suffix,
            'outFile'    : outFile,
            'fileFd'     : fileFdDetails
          }
          </call>
          <script>
            errNum = STAXResult
          </script>
          <!--=============== Log info =====================================-->
          <call function="'writeMessage'">
          {
            'content' : 'Client postamble : %s' % logFileDetails,
            'xlink'   : logFileDetailsRelativePath,
            'fileFd'  : fileFd
          }
          </call>
          <!--== Close root tag for xml details file -->
          <call function="'writeEndTagClient'">
          { 'fileFd'    : fileFdDetails }
          </call>
          <script> fileFdDetails.close() </script>
          <message>
            '   Stop postamble for %s (id=%s) running on %s' % \
            (client.getName(),client.getId(), client.getHost())
          </message>
        </sequence>
      <else>
        <message>
          '   File not found, skip postamble : %s/%sPostamble.xml' % \
          (client.getPath(),client.getName())
        </message>
      </else>
      </if>
      <return>errNum</return>
    </sequence>
  </function>
  <!-- ************************************************************ -->
  <function name="runClientMain" scope="local">
    <function-map-args>
      <function-arg-def name="client" type="required"/>
      <function-arg-def name="duration" type="required"/>
      <function-arg-def name="instances" type="required"/>
      <function-arg-def name="suffix" type="required"/>
      <function-arg-def name="fileFd" type="required"/>
    </function-map-args>
    <sequence>
      <script>
        errNum = 0
      </script>
      <!--=============== Start the client under a timer =================-->
      <!--== open logfile for details                                   ==-->
      <!-- All informations loged in this this function will              -->
      <!-- not be displayed in the main report, to avoid broken xml file  -->
       <call function="'getLogFileName'">
        {
          'type'   : 'client',
          'object' : client,
          'prefix' : 'client_details'
        }
      </call>
      <script>
        logFileDetails = STAXResult[0]
        logFileDetailsName = STAXResult[1]
        logFileDetailsRelativePath = logFileDetails.replace(LOG_DIR,'.')
        fileFdDetails = open(logFileDetails,'w')
        outFile = '%s/%s.txt' % (client.getLogDir(),logFileDetailsName)
      </script>
      <message>
        '   Start run for %s (id=%s) running on %s' % \
        (client.getName(),client.getId(), client.getHost())
      </message>
      <call function="'startTimer'">
      {
        'client'     : client,
        'instances'  : instances,
        'duration'   : duration,
        'suffix'     : suffix,
        'outFile'    : outFile,
        'fileFd'     : fileFdDetails
      }
      </call>
      <script>
        fileFdDetails.close()
        errNum += STAXResult[0]
        timerKilled = STAXResult[1]
      </script>
      <!--=============== Analyze client run status ======================-->
      <if expr="timerKilled == TRUE">
        <sequence>
          <script>
            errMsg = 'ERROR: client %s has been killed,' % client.getName()
          </script>
          <call function="'writeMessage'">
            {
              'content' : errMsg,
              'fileFd'  : fileFd
            }
          </call>
          <message> errMsg </message>
          <script>
            ERR_NUM[0] += 1
          </script>
        </sequence>
      </if>
      <script>
        finishedClients.append(client.getId())
      </script>
      <!--=============== 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>
  <!-- ************************************************************ -->
@@ -492,103 +784,43 @@
      <!--=============== Select local/shared client file ================-->
      <script>
        timerKilled = TRUE
        workingDir  = NOT_DEFINED
        localWorkingDir = '%s/scenario/%s/clients/%s' % \
                           (LOCAL_TESTS_DIR,DIR_NAME,client.getName())
        sharedWorkingdir = '%s/clients/%s/' % \
                           (LOCAL_TESTS_DIR,client.getName())
      </script>
      
      <!-- Check if local file exists before launching it-->
      <call function="'isFile'">
      {
        'location' : STAXServiceMachine,
        'fileName' : '%s/%s.xml' % (localWorkingDir,client.getName())
      }
      </call>
      <script>
        localClientExist = STAXResult
      </script>
      <!-- Check if remote file exists before launching it-->
      <call function="'isFile'">
      {
        'location' : STAXServiceMachine,
        'fileName' : '%s/%s.xml' % (sharedWorkingdir,client.getName())
      }
      </call>
      <script>
        sharedClientExist = STAXResult
      </script>
      <!--================================================================-->
      <!--====== run the client, exit if time exceed duration time  ======-->
      <timer duration="'%ss' % duration">
        <sequence>
          <!-- use local client by default else the shared client -->
          <if expr="localClientExist == TRUE">
            <script> workingDir = localWorkingDir </script>
          <elseif expr="sharedClientExist == TRUE">
            <script> workingDir = sharedWorkingdir </script>
          </elseif>
          <else>
          <!-- Check that staf is running on the client -->
          <call function="'pingStaf'">
            { 'targetHost' : client.getHost(),
              'fileFd'     : fileFd}
          </call>
          <script>
            pingRC = STAXResult[0]
          </script>
          <if expr="pingRC == 0">
            <sequence>
              <script>
                str = 'ERROR : cant find files %s/%s.xml and %s/%s.xml' % \
                (localWorkingDir,client.getName(),\
                 sharedWorkingdir,client.getName())
              </script>
              <message>
                str
              </message>
              <call function="'writeMessage'">
              { 'fileFd'  : fileFd,
                'content' : str
              <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
               file="'%s/%s.xml' % (client.getPath(),client.getName())"/>
              <call function="'%s' % client.getName()">
              {
                'client'     : client,
                'instances'  : instances,
                'duration'   : duration,
                'suffix'     : suffix,
                'outFile'    : outFile,
                'fileFd'     : fileFd
              }
              </call>
              <script>ERR_NUM[0] += 1</script>
              <script>errNum = STAXResult</script>
            </sequence>
          <else>
            <!-- staf does not answer ping on client host -->
            <script> errNum = 1 </script>
          </else>
          </if>
          <if expr="workingDir != NOT_DEFINED">
            <sequence>
              <!-- Check that staf is running on the client -->
              <call function="'pingStaf'">
                { 'targetHost' : client.getHost(),
                  'fileFd'     : fileFd}
              </call>
              <script>
                pingRC = STAXResult[0]
              </script>
              <if expr="pingRC == 0">
                <sequence>
                  <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
                          file="'%s/%s.xml' % (workingDir,client.getName())"/>
                  <call function="'%s' % client.getName()">
                  {
                    'workingDir' : workingDir,
                    'client'     : client,
                    'instances'  : instances,
                    'duration'   : duration,
                    'suffix'     : suffix,
                    'outFile'    : outFile,
                    'fileFd'     : fileFd
                  }
                  </call>
                  <script>errNum = STAXResult</script>
                </sequence>
              <else>
                <!-- staf does not answer ping on client host -->
                <script> errNum = 1 </script>
              </else>
              </if>
              <script>timerKilled = FALSE</script>
            </sequence>
          </if>
          <script>timerKilled = FALSE</script>
        </sequence>
      </timer>
      
      
opends/tests/system-tests/phases/shared/functions/opendsadm.xml
@@ -1197,11 +1197,11 @@
      <script>
        STAFCmdParamsList=[]
        STAFCmdParams=''
        if dsPath:
          dsBinPath='%s/bin' % (dsPath)
          STAFCmd='%s/backup' % (dsBinPath)
        if dsInstanceHost:
          STAFCmdParamsList.append('-h %s' % dsInstanceHost)
        
@@ -1213,20 +1213,20 @@
        
        if dsInstancePswd:
          STAFCmdParamsList.append('-w "%s"' % dsInstancePswd)
    if backupDir:
      STAFCmdParamsList.append('-d %s' % backupDir)
    if backEnd:
      STAFCmdParamsList.append('-n %s' % backEnd)
    if extraParams:
      STAFCmdParamsList.append('%s' % extraParams)
    if startTask:
      STAFCmdParamsList.append('-t %s' % startTask)
    STAFCmdParams=' '.join(STAFCmdParamsList)
        if backupDir:
          STAFCmdParamsList.append('-d %s' % backupDir)
        if backEnd:
          STAFCmdParamsList.append('-n %s' % backEnd)
        if extraParams:
          STAFCmdParamsList.append('%s' % extraParams)
        if startTask:
          STAFCmdParamsList.append('-t %s' % startTask)
        STAFCmdParams=' '.join(STAFCmdParamsList)
      </script>
      
      <call function="'writeStartTagOperation'">
opends/tests/system-tests/phases/verdict/verdict.xml
@@ -138,7 +138,7 @@
                }
              </call>
              <script>
                logFile = STAXResult
                logFile = STAXResult[0]
                
                fileList.append(logFile)
                
opends/tests/system-tests/scenario/4MMR/4MMR.xml
@@ -47,9 +47,9 @@
        <call function="'main_run'">
        {
         'configurationFile': fConf,
         'runInstallation'  : 'true',
         'runGenerateLdif'  : 'true',
         'runConfiguration' : 'true',
         'runInstallation'  : 'false',
         'runGenerateLdif'  : 'false',
         'runConfiguration' : 'false',
         'runScheduler'     : 'true'
        }
        </call>
opends/tests/system-tests/scenario/4MMR/clients/addDeleteLoad/addDeleteLoad.xml
@@ -35,7 +35,6 @@
  <!-- always define all the parameters below                       -->
  <function name="addDeleteLoad" scope="local">
    <function-map-args>
      <function-arg-def name="workingDir" type="required"/>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
@@ -55,71 +54,20 @@
        msg = ''
      </script>
      
      <!-- ==================    Preamble   =================== -->
      <!-- ==================    Parser     =================== -->
      <!-- parse the client parameters :                        -->
      <!-- params is [[param1,val1],[param2,val2],...]          -->
      <!-- get the ldap instance parameters                     -->
      <script>
        compilDir = '%s/%s_%s' % (workingDir,client.getHost(),client.getId())
        #
        # Extract client parameters from client.getParams()
        #
        cParams = client.getParams()
        try:
          serverInstanceFromClient = cParams[0][1]
        except IndexError:
          serverInstanceFromClient = NOT_DEFINED
          msg = '%s\nERROR: serverInstanceFromClient undefined,mandatory' % msg
        try:
          baseDn = cParams[1][1]
        except IndexError:
          baseDn = NOT_DEFINED
          msg = '%s\nERROR: baseDn undefined,mandatory' % msg
        try:
          nbCnx = cParams[2][1]
        except IndexError:
          nbCnx = NOT_DEFINED
          msg = '%s\nERROR: nbCnx undefined,mandatory' % msg
        try:
          nbMaxOps = cParams[3][1]
        except IndexError:
          nbMaxOps = NOT_DEFINED
        try:
          attributeName = cParams[4][1]
        except IndexError:
          attributeName = NOT_DEFINED
        #
        # setup parms to run the client
        #
        if serverInstanceFromClient != NOT_DEFINED:
          sys.path.append("%s/phases/scheduler" % TESTS_DIR )
          from scheduler import getInstance
          serverInstance = getInstance(serverInstanceFromClient,instances)
          if (serverInstance == 'ERROR'):
            msg = '%s\nERROR: cant find client instance named' % msg
            msg = '%s %s in server instance list' % \
                  (msg,serverInstanceFromClient)
          else:
            # remove sec, try to finish before timer kill -9 the client
            duration = duration - 20
            parms=[]
            parms.append('-h %s -p %s' % \
                       (serverInstance.getHost(),serverInstance.getLDAPPort()))
            parms.append('-b "%s"' % baseDn)
            parms.append('-D "%s" -w "%s"' % \
                        (DIRECTORY_INSTANCE_DN,DIRECTORY_INSTANCE_PSWD))
            parms.append('-t %s -d %s' % (nbCnx,duration))
            if nbMaxOps != NOT_DEFINED:
              parms.append('-M %s' % nbMaxOps)
            if attributeName != NOT_DEFINED:
              parms.append('-a %s' % attributeName)
            parms = ' '.join(parms)
      </script>
      <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
              file="'%s/%sLib.xml' % (client.getPath(),client.getName())"/>
      <call function="'%sParser' % client.getName()">
      {
        'client'     : client,
        'instances'  : instances,
        'duration'   : duration,
        'suffix'     : suffix
      }
      </call>
      
      <if expr="msg.find('ERROR') != -1">
        <sequence>
@@ -139,78 +87,6 @@
        </sequence>
      <else>
        <sequence>
          <!-- ==== Add execute permission to build.ksh file ==== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'chmod',
            'fileFd'  : fileFd }
          </call>
          <call function="'writeMessage'">
          {'content' : 'Add execute permission to build.ksh file',
           'fileFd'  : fileFd}
          </call>
          <process name="'%s: chmod +x build.ksh' % client.getHost()">
            <location>client.getHost()</location>
            <command mode="'shell'">'chmod +x build.ksh'</command>
            <parms/>
            <workdir>workingDir</workdir>
            <envs>['PATH=/bin:/usr/bin']</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <call function="'checkRC'">
            { 'returncode' : RC,
              'result'     : STAXResult[0][1],
              'fileFd'     : fileFd }
          </call>
          <script>
            errNum += STAXResult
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
          <!-- ==== Build client : run build.ksh file ==== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'build',
            'fileFd'  : fileFd }
          </call>
          <call function="'writeMessage'">
          {'content' : 'Build client',
           'fileFd'  : fileFd}
          </call>
          <!-- Build Client in unique directory (compilDir), avoid          -->
          <!-- conflict if same client is run several time at the same time -->
          <process name="'%s: build %s' % (client.getHost(),client.getName())">
            <location>client.getHost()</location>
            <command mode="'shell'">'./build.ksh'</command>
            <parms/>
            <workdir>workingDir</workdir>
            <envs>['PATH=%s/bin:/bin:/usr/bin' % JAVA_HOME,'COMPILDIR=%s' % compilDir]</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <call function="'checkRC'">
            { 'returncode' : RC,
              'result'     : STAXResult[0][1],
              'fileFd'     : fileFd }
          </call>
          <if expr="RC != 0">
            <message>
              'FAILED to build client %s on %s' % \
              (client.getName(),client.getHost())
            </message>
          </if>
          <script>
            errNum += STAXResult
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
          <!-- ========== Run the client ========== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'run',
@@ -224,8 +100,9 @@
          </call>
          
          <script>
            cParam = '-client -Xmx1G -Xms1G'
            cParam = '%s -XX:NewRatio=1 -XX:SurvivorRatio=100' % cParam
            cParam = '-client'
            # cParam = '%s -Xmx1G -Xms1G' % cParam
            # cParam = '%s -XX:NewRatio=1 -XX:SurvivorRatio=100' % cParam
            cParam = '%s -cp %s/clients/LDAPjdk/ldapjdk.jar' \
                      % (cParam,LOCAL_TESTS_DIR)
            cParam = '%s:%s/addDeleteLoad.jar' % (cParam,compilDir)
@@ -235,11 +112,17 @@
                        (client.getHost(),client.getName(),
                         serverInstance.getName())
          </script>
          <call function="'writeMessage'">
          { 'fileFd'  : fileFd,
            'content' : 'cmd : cd %s ; %s/bin/java %s' % \
                        (client.getPath(),JAVA_HOME,cParam)
          }
          </call>
          <process name="'%s' % titleName">
            <location>client.getHost()</location>
            <command>'%s/bin/java' % JAVA_HOME</command>
            <parms>cParam </parms>
            <workdir>workingDir</workdir>
            <workdir>client.getPath()</workdir>
            <envs>['PATH=%s/bin:/bin:/usr/bin' % JAVA_HOME]</envs>
            <stderr mode="'stdout'"/>
            <stdout>outFile</stdout>
@@ -258,32 +141,11 @@
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
          
          
          <!-- ========== Postamble ========== -->
          <call function="'writeMessage'">
          {'content' : 'Output file %s' % outFile,
           'fileFd'  : fileFd}
          </call>
          
          <process name="'%s:%s: Grep' % (client.getHost(),client.getName())">
            <location>client.getHost()</location>
            <command mode="'shell'">
              "grep 'TOTAL' %s | cut -d ' ' -f3-" % outFile
            </command>
            <envs>['PATH=/bin:/usr/bin']</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <script>
            summary = STAXResult[0][1]
          </script>
          <call function="'writeMessage'">
          {'content' : 'Summary %s' % (summary),
           'fileFd'  : fileFd}
          </call>
        </sequence>
      </else>
      </if>
opends/tests/system-tests/scenario/4MMR/clients/addDeleteLoad/addDeleteLoadLib.xml
New file
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "../../../../../shared/stax.dtd">
<!--
 ! CDDL HEADER START
 !
 ! The contents of this file are subject to the terms of the
 ! Common Development and Distribution License, Version 1.0 only
 ! (the "License").  You may not use this file except in compliance
 ! with the License.
 !
 ! You can obtain a copy of the license at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
 ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 ! See the License for the specific language governing permissions
 ! and limitations under the License.
 !
 ! When distributing Covered Code, include this CDDL HEADER in each
 ! file and include the License file at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 ! add the following below this CDDL HEADER, with the fields enclosed
 ! by brackets "[]" replaced with your own identifying information:
 !      Portions Copyright [yyyy] [name of copyright owner]
 !
 ! CDDL HEADER END
 !
 !      Copyright 2008 Sun Microsystems, Inc.
 ! -->
<stax>
  <defaultcall function="addDeleteLoadParser"/>
  <!-- ************************************************************ -->
  <!-- Client Parser -->
  <!-- This function must NOT have scope=local has its variables may -->
  <!-- be used by the caller -->
  <function name="addDeleteLoadParser">
    <function-map-args>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
      <function-arg-def name="suffix"     type="required"/>
    </function-map-args>
    <sequence>
      <script>
        compilDir = '%s/%s_%s' % \
                    (client.getPath(),client.getHost(),client.getId())
        #
        # Extract client parameters from client.getParams()
        #
        cParams = client.getParams()
        try:
          serverInstanceFromClient = cParams[0][1]
        except IndexError:
          serverInstanceFromClient = NOT_DEFINED
          msg = '%s\nERROR: serverInstanceFromClient undefined,mandatory' % msg
        try:
          baseDn = cParams[1][1]
        except IndexError:
          baseDn = NOT_DEFINED
          msg = '%s\nERROR: baseDn undefined,mandatory' % msg
        try:
          nbCnx = cParams[2][1]
        except IndexError:
          nbCnx = NOT_DEFINED
          msg = '%s\nERROR: nbCnx undefined,mandatory' % msg
        try:
          nbMaxOps = cParams[3][1]
        except IndexError:
          nbMaxOps = NOT_DEFINED
        try:
          attributeName = cParams[4][1]
        except IndexError:
          attributeName = NOT_DEFINED
        #
        # setup parms to run the client
        #
        if serverInstanceFromClient != NOT_DEFINED:
          sys.path.append("%s/phases/scheduler" % TESTS_DIR )
          from scheduler import getInstance
          serverInstance = getInstance(serverInstanceFromClient,instances)
          if (serverInstance == 'ERROR'):
            msg = '%s\nERROR: cant find client instance named' % msg
            msg = '%s %s in server instance list' % \
                  (msg,serverInstanceFromClient)
          else:
            # remove sec, try to finish before timer kill -9 the client
            duration = duration - 20
            parms=[]
            parms.append('-h %s -p %s' % \
                       (serverInstance.getHost(),serverInstance.getLDAPPort()))
            parms.append('-b "%s"' % baseDn)
            parms.append('-D "%s" -w "%s"' % \
                        (DIRECTORY_INSTANCE_DN,DIRECTORY_INSTANCE_PSWD))
            parms.append('-t %s -d %s' % (nbCnx,duration))
            if nbMaxOps != NOT_DEFINED:
              parms.append('-M %s' % nbMaxOps)
            if attributeName != NOT_DEFINED:
              parms.append('-a %s' % attributeName)
            parms = ' '.join(parms)
      </script>
    </sequence>
  </function>
</stax>
opends/tests/system-tests/scenario/4MMR/clients/addDeleteLoad/addDeleteLoadPostamble.xml
New file
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "../../../../../shared/stax.dtd">
<!--
 ! CDDL HEADER START
 !
 ! The contents of this file are subject to the terms of the
 ! Common Development and Distribution License, Version 1.0 only
 ! (the "License").  You may not use this file except in compliance
 ! with the License.
 !
 ! You can obtain a copy of the license at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
 ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 ! See the License for the specific language governing permissions
 ! and limitations under the License.
 !
 ! When distributing Covered Code, include this CDDL HEADER in each
 ! file and include the License file at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 ! add the following below this CDDL HEADER, with the fields enclosed
 ! by brackets "[]" replaced with your own identifying information:
 !      Portions Copyright [yyyy] [name of copyright owner]
 !
 ! CDDL HEADER END
 !
 !      Copyright 2008 Sun Microsystems, Inc.
 ! -->
<stax>
  <defaultcall function="addDeleteLoadPostamble"/>
  <!-- ************************************************************ -->
  <!-- Client is automatically called by the scheduler and must     -->
  <!-- always define all the parameters below                       -->
  <function name="addDeleteLoadPostamble" scope="local">
    <function-map-args>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
      <function-arg-def name="suffix"     type="required"/>
      <function-arg-def name="outFile"    type="required"/>
      <function-arg-def name="fileFd"     type="required"/>
    </function-map-args>
    <sequence>
      <!-- ===================   Comments   =================== -->
      <!-- client is run under paralleliterate tag              -->
      <!-- each variables defined are internal                  -->
      <!-- client should have its own err_num variable in order -->
      <!-- to inform scheduler if it has pass/fail status       -->
      <script>
        errNum = 0
        msg = ''
      </script>
      <!-- ==================    Parser     =================== -->
      <!-- parse the client parameters :                        -->
      <!-- params is [[param1,val1],[param2,val2],...]          -->
      <!-- get the ldap instance parameters                     -->
      <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
              file="'%s/%sLib.xml' % (client.getPath(),client.getName())"/>
      <call function="'%sParser' % client.getName()">
      {
        'client'     : client,
        'instances'  : instances,
        'duration'   : duration,
        'suffix'     : suffix
      }
      </call>
      <if expr="msg.find('ERROR') != -1">
        <sequence>
          <message>'%s' % msg</message>
          <call function="'writeOperationResult'">
            {
              'returncode' : '1',
              'expected'   : '0',
              'result'     : msg,
              'status'     : 'ERROR',
              'fileFd'     : fileFd
            }
          </call>
          <script>
            errNum += 1
          </script>
        </sequence>
      <else>
        <sequence>
          <process name="'%s:%s: Grep' % (client.getHost(),client.getName())">
            <location>client.getHost()</location>
            <command mode="'shell'">
              "grep 'TOTAL' %s | cut -d ' ' -f3-" % outFile
            </command>
            <envs>['PATH=/bin:/usr/bin']</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <script>
            summary = STAXResult[0][1]
          </script>
          <call function="'writeMessage'">
          {'content' : 'Summary %s' % (summary),
           'fileFd'  : fileFd}
          </call>
        </sequence>
      </else>
      </if>
      <return> errNum </return>
    </sequence>
  </function>
</stax>
opends/tests/system-tests/scenario/4MMR/clients/addDeleteLoad/addDeleteLoadPreamble.xml
New file
@@ -0,0 +1,174 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "../../../../../shared/stax.dtd">
<!--
 ! CDDL HEADER START
 !
 ! The contents of this file are subject to the terms of the
 ! Common Development and Distribution License, Version 1.0 only
 ! (the "License").  You may not use this file except in compliance
 ! with the License.
 !
 ! You can obtain a copy of the license at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
 ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 ! See the License for the specific language governing permissions
 ! and limitations under the License.
 !
 ! When distributing Covered Code, include this CDDL HEADER in each
 ! file and include the License file at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 ! add the following below this CDDL HEADER, with the fields enclosed
 ! by brackets "[]" replaced with your own identifying information:
 !      Portions Copyright [yyyy] [name of copyright owner]
 !
 ! CDDL HEADER END
 !
 !      Copyright 2008 Sun Microsystems, Inc.
 ! -->
<stax>
  <defaultcall function="addDeleteLoadPreamble"/>
  <!-- ************************************************************ -->
  <!-- Client is automatically called by the scheduler and must     -->
  <!-- always define all the parameters below                       -->
  <function name="addDeleteLoadPreamble" scope="local">
    <function-map-args>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
      <function-arg-def name="suffix"     type="required"/>
      <function-arg-def name="outFile"    type="required"/>
      <function-arg-def name="fileFd"     type="required"/>
    </function-map-args>
    <sequence>
      <!-- ===================   Comments   =================== -->
      <!-- client is run under paralleliterate tag              -->
      <!-- each variables defined are internal                  -->
      <!-- client should have its own err_num variable in order -->
      <!-- to inform scheduler if it has pass/fail status       -->
      <script>
        errNum = 0
        msg = ''
      </script>
      <!-- ==================    Parser     =================== -->
      <!-- parse the client parameters :                        -->
      <!-- params is [[param1,val1],[param2,val2],...]          -->
      <!-- get the ldap instance parameters                     -->
      <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
              file="'%s/%sLib.xml' % (client.getPath(),client.getName())"/>
      <call function="'%sParser' % client.getName()">
      {
        'client'     : client,
        'instances'  : instances,
        'duration'   : duration,
        'suffix'     : suffix
      }
      </call>
      <if expr="msg.find('ERROR') != -1">
        <sequence>
          <message>'%s' % msg</message>
          <call function="'writeOperationResult'">
            {
              'returncode' : '1',
              'expected'   : '0',
              'result'     : msg,
              'status'     : 'ERROR',
              'fileFd'     : fileFd
            }
          </call>
          <script>
            errNum += 1
          </script>
        </sequence>
      <else>
        <sequence>
          <!-- ==== Add execute permission to build.ksh file ==== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'chmod',
            'fileFd'  : fileFd }
          </call>
          <call function="'writeMessage'">
          {'content' : 'Add execute permission to build.ksh file',
           'fileFd'  : fileFd}
          </call>
          <process name="'%s: chmod +x build.ksh' % client.getHost()">
            <location>client.getHost()</location>
            <command mode="'shell'">'chmod +x build.ksh'</command>
            <parms/>
            <workdir>client.getPath()</workdir>
            <envs>['PATH=/bin:/usr/bin']</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <call function="'checkRC'">
            { 'returncode' : RC,
              'result'     : STAXResult[0][1],
              'fileFd'     : fileFd }
          </call>
          <script>
            errNum += STAXResult
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
          <!-- ==== Build client : run build.ksh file ==== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'build',
            'fileFd'  : fileFd }
          </call>
          <call function="'writeMessage'">
          {'content' : 'Build client',
           'fileFd'  : fileFd}
          </call>
          <!-- Build Client in unique directory (compilDir), avoid          -->
          <!-- conflict if same client is run several time at the same time -->
          <process name="'%s: build %s' % (client.getHost(),client.getName())">
            <location>client.getHost()</location>
            <command mode="'shell'">'./build.ksh'</command>
            <parms/>
            <workdir>client.getPath()</workdir>
            <envs>['PATH=%s/bin:/bin:/usr/bin' % JAVA_HOME,'COMPILDIR=%s' % compilDir]</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <call function="'checkRC'">
            { 'returncode' : RC,
              'result'     : STAXResult[0][1],
              'fileFd'     : fileFd }
          </call>
          <if expr="RC != 0">
            <message>
              'FAILED to build client %s on %s' % \
              (client.getName(),client.getHost())
            </message>
          </if>
          <script>
            errNum += STAXResult
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
        </sequence>
      </else>
      </if>
      <return> errNum </return>
    </sequence>
  </function>
</stax>
opends/tests/system-tests/scenario/4MMR/conf.xml
@@ -44,7 +44,7 @@
      </description>
    </scenario>
    
    <opendsZip>NEED_VALUE</opendsZip>
    <opendsZip>/local/qa/build/OpenDS-1.0.0.zip</opendsZip>
    <!-- Example : <domain>france.sun.com</domain> -->
    <domain></domain>
  </globalParameters>
@@ -53,47 +53,31 @@
  <!-- ================= Instance ============================== -->
  <instance name="I1" product="opends" role="ldapServer">
    <host>localhost</host>
    <installDir>NEED_VALUE</installDir>
    <installDir>/local/qa/realtmp/systest/I1</installDir>
    <ports>
      <ldap>5021</ldap>
      <ldaps>5022</ldaps>
      <jmx>5023</jmx>
      <replicationServer>5025</replicationServer>
    </ports>
    <tuning>
      <java xms="2g" xmx="2g"
            xxNewSize="512m" xxMaxNewSize="512m"
            xxSurvivorRatio="6" xxPermSize="128m"
            xxMaxPermSize="128m" xxUseConcMarkSweepGC="true"/>
      <databaseCachePercentage>40</databaseCachePercentage>
      <replicationPurgeDelay unit="h">4</replicationPurgeDelay>
    </tuning>
  </instance>
  
  <!-- ================= Instance ============================== -->
  <instance name="I2" product="opends" role="ldapServer">
    <host>localhost</host>
    <installDir>NEED_VALUE</installDir>
    <installDir>/local/qa/realtmp/systest/I2</installDir>
    <ports>
      <ldap>6021</ldap>
      <ldaps>6022</ldaps>
      <jmx>6023</jmx>
      <replicationServer>6025</replicationServer>
    </ports>
    <tuning>
      <java xms="2g" xmx="2g"
            xxNewSize="512m" xxMaxNewSize="512m"
            xxSurvivorRatio="6" xxPermSize="128m"
            xxMaxPermSize="128m" xxUseConcMarkSweepGC="true"/>
      <databaseCachePercentage>40</databaseCachePercentage>
      <replicationPurgeDelay unit="h">4</replicationPurgeDelay>
    </tuning>
  </instance>
  
  <!-- ================= Instance ============================== -->
  <instance name="I3" product="opends" role="ldapServer">
<!--  <instance name="I3" product="opends" role="ldapServer">
    <host>localhost</host>
    <installDir>NEED_VALUE</installDir>
    <installDir>NsEED_VALUE</installDir>
    <ports>
      <ldap>7021</ldap>
      <ldaps>7022</ldaps>
@@ -109,11 +93,11 @@
      <replicationPurgeDelay unit="h">4</replicationPurgeDelay>
    </tuning>
  </instance>
-->
  <!-- ================= Instance ============================== -->
  <instance name="I4" product="opends" role="ldapServer">
<!--  <instance name="I4" product="opends" role="ldapServer">
    <host>localhost</host>
    <installDir>NEED_VALUE</installDir>
    <installDir>NsEED_VALUE</installDir>
    <ports>
      <ldap>8021</ldap>
      <ldaps>8022</ldaps>
@@ -129,7 +113,7 @@
      <replicationPurgeDelay unit="h">4</replicationPurgeDelay>
    </tuning>
  </instance>
  -->
  <!-- ================= Suffix  ============================== -->
  <suffix dn="dc=com">
    
@@ -137,10 +121,10 @@
        <element instanceName="I1" initRule="importLdif"/>
      <element instanceName="I2" initRule="totalUpdate"
               instanceSourceName="I1"/>
      <element instanceName="I3" initRule="totalUpdate"
     <!-- <element instanceName="I3" initRule="totalUpdate"
               instanceSourceName="I1"/>
      <element instanceName="I4" initRule="totalUpdate"
               instanceSourceName="I1"/>
               instanceSourceName="I1"/>-->
    </topology>
    
    <tree nbOfEntries="200">
@@ -168,7 +152,7 @@
  <!-- [2] dependencyId is a list of client id ie : 1,2         -->
  <!--     if using it, specify id attribute for each clients   -->
  <scheduler>
    <duration unit="h">4</duration>
    <duration unit="m">2</duration>
    <!-- 60h : 1% <-> 36 min , 10% <-> 6h -->
    
    
@@ -176,19 +160,28 @@
    <!--== Module 1 ==-->
    <module name="search" enabled="true">
      
      <client id="1" name="searchLoad" host="localhost" start="t0" stop="t10">
      <client id="1" name="searchLoad" host="gahia" start="t0" stop="t100">
        <serverInstance>I1</serverInstance>
        <baseDn>dc=com</baseDn>
        <nbCnx>20</nbCnx>
        <nbMaxOperations>20</nbMaxOperations>
        <nbCnx>2</nbCnx>
        <nbMaxOperations>2</nbMaxOperations>
        <attribute>sn</attribute>
      </client>
      <client id="2" name="modifyLoad" host="gahia" start="t10" stop="t90">
        <serverInstance>I1</serverInstance>
        <baseDn>dc=com</baseDn>
        <nbCnx>2</nbCnx>
        <nbMaxOperations>2</nbMaxOperations>
        <attribute>sn</attribute>
      </client>
      <client id="8" name="restartDs" host="localhost" start="t70">
        <serverInstance>I1</serverInstance>
      </client>
    </module>
    
    
    <!--== Module 2 ==-->
    <module name="modify" enabled="true">
    <module name="modify" enabled="false">
      
      <client id="3" name="modifyLoad" host="localhost" start="t20" stop="t50">
        <serverInstance>I1</serverInstance>
@@ -221,7 +214,7 @@
      
      <client id="7" name="restartDs" host="localhost" start="t70"
                                                       dependencyId="6">
        <serverInstance>I3</serverInstance>
        <serverInstance>I1</serverInstance>
      </client>
      
    </module>
opends/tests/system-tests/scenario/sample2/clients/sampleSearchLoad/sampleSearchLoad.xml
@@ -35,7 +35,6 @@
  <!-- always define all the parameters below                       -->
  <function name="sampleSearchLoad" scope="local">
    <function-map-args>
      <function-arg-def name="workingDir" type="required"/>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
@@ -55,70 +54,20 @@
        msg = ''
      </script>
      
      <!-- ==================    Preamble   =================== -->
      <!-- ==================    Parser     =================== -->
      <!-- parse the client parameters :                        -->
      <!-- params is [[param1,val1],[param2,val2],...]          -->
      <!-- get the ldap instance parameters                     -->
      <script>
        compilDir = '%s/%s_%s' % (workingDir,client.getHost(),client.getId())
        #
        # Extract client parameters from client.getParams()
        #
        cParams = client.getParams()
        try:
          serverInstanceFromClient = cParams[0][1]
        except IndexError:
          serverInstanceFromClient = NOT_DEFINED
          msg = '%s\nERROR: serverInstanceFromClient undefined,mandatory' % msg
        try:
          baseDn = cParams[1][1]
        except IndexError:
          baseDn = NOT_DEFINED
          msg = '%s\nERROR: baseDn undefined,mandatory' % msg
        try:
          nbCnx = cParams[2][1]
        except IndexError:
          nbCnx = NOT_DEFINED
          msg = '%s\nERROR: nbCnx undefined,mandatory' % msg
        try:
          nbMaxSearch = cParams[3][1]
        except IndexError:
          nbMaxSearch = NOT_DEFINED
          msg = '%s\nERROR: nbMaxOperations undefined,mandatory' % msg
        try:
          attributeName = cParams[4][1]
        except IndexError:
          attributeName = NOT_DEFINED
        #
        # setup parms to run the client
        #
        if serverInstanceFromClient != NOT_DEFINED:
          sys.path.append("%s/phases/scheduler" % TESTS_DIR )
          from scheduler import getInstance
          serverInstance = getInstance(serverInstanceFromClient,instances)
          if (serverInstance == 'ERROR'):
            msg = '%s\nERROR: cant find client instance named' % msg
            msg = '%s %s in server instance list' % \
                  (msg,serverInstanceFromClient)
          else:
            # remove sec, try to finish before timer kill -9 the client
            duration = duration - 20
            parms=[]
            parms.append('-h %s -p %s' % \
                       (serverInstance.getHost(),serverInstance.getLDAPPort()))
            parms.append('-b "%s"' % baseDn)
            parms.append('-D "%s" -w "%s"' % \
                        (DIRECTORY_INSTANCE_DN,DIRECTORY_INSTANCE_PSWD))
            parms.append('-t %s -M %s -d %s' % (nbCnx,nbMaxSearch,duration))
            if attributeName != NOT_DEFINED:
              parms.append('-a %s' % attributeName)
            parms = ' '.join(parms)
      </script>
      <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
              file="'%s/%sLib.xml' % (client.getPath(),client.getName())"/>
      <call function="'searchLoadParser'">
      {
        'client'     : client,
        'instances'  : instances,
        'duration'   : duration,
        'suffix'     : suffix
      }
      </call>
      
      <if expr="msg.find('ERROR') != -1">
        <sequence>
@@ -138,78 +87,6 @@
        </sequence>
      <else>
        <sequence>
          <!-- ==== Add execute permission to build.sh file ==== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'chmod',
            'fileFd'  : fileFd }
          </call>
          <call function="'writeMessage'">
          {'content' : 'Add execute permission to build.sh file',
           'fileFd'  : fileFd}
          </call>
          <process name="'%s: chmod +x build.sh' % client.getHost()">
            <location>client.getHost()</location>
            <command mode="'shell'">'chmod +x build.sh'</command>
            <parms/>
            <workdir>workingDir</workdir>
            <envs>['PATH=/bin:/usr/bin']</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <call function="'checkRC'">
            { 'returncode' : RC,
              'result'     : STAXResult[0][1],
              'fileFd'     : fileFd }
          </call>
          <script>
            errNum += STAXResult
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
          <!-- ==== build client : run build.sh file ==== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'build',
            'fileFd'  : fileFd }
          </call>
          <call function="'writeMessage'">
          {'content' : 'Build client',
           'fileFd'  : fileFd}
          </call>
          <!-- Build Client in unique directory (compilDir), avoid          -->
          <!-- conflict if same client is run several time at the same time -->
          <process name="'%s: build %s' % (client.getHost(),client.getName())">
            <location>client.getHost()</location>
            <command mode="'shell'">'./build.sh'</command>
            <parms/>
            <workdir>workingDir</workdir>
            <envs>['PATH=%s/bin:/bin:/usr/bin' % JAVA_HOME,'COMPILDIR=%s' % compilDir]</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <call function="'checkRC'">
            { 'returncode' : RC,
              'result'     : STAXResult[0][1],
              'fileFd'     : fileFd }
          </call>
          <if expr="RC != 0">
            <message>
              'FAILED to build client %s on %s' % \
              (client.getName(),client.getHost())
            </message>
          </if>
          <script>
            errNum += STAXResult
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
          <!-- ========== Run the client ========== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'run',
@@ -223,8 +100,9 @@
          </call>
          
          <script>
            cParam = '-client -Xmx1G -Xms1G'
            cParam = '%s -XX:NewRatio=1 -XX:SurvivorRatio=100' % cParam
            cParam = '-client'
            # cParam = '%s -Xmx1G -Xms1G' % cParam
            # cParam = '%s -XX:NewRatio=1 -XX:SurvivorRatio=100' % cParam
            cParam = '%s -cp %s/clients/LDAPjdk/ldapjdk.jar' % \
                     (cParam,LOCAL_TESTS_DIR)
            cParam = '%s:%s/search.jar' % (cParam,compilDir)
@@ -234,11 +112,17 @@
                        (client.getHost(),client.getName(),
                         serverInstance.getName())
          </script>
          <call function="'writeMessage'">
          { 'fileFd'  : fileFd,
            'content' : 'cmd : cd %s ; %s/bin/java %s' % \
                        (client.getPath(),JAVA_HOME,cParam)
          }
          </call>
          <process name="'%s' % titleName">
            <location>client.getHost()</location>
            <command>'%s/bin/java' % JAVA_HOME</command>
            <parms>cParam </parms>
            <workdir>workingDir</workdir>
            <workdir>client.getPath()</workdir>
            <envs>['PATH=%s/bin:/bin:/usr/bin' % JAVA_HOME]</envs>
            <stderr mode="'stdout'"/>
            <stdout>outFile</stdout>
@@ -256,31 +140,11 @@
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
          
          <!-- ========== Postamble ========== -->
          <call function="'writeMessage'">
          {'content' : 'Output file %s' % outFile,
           'xlink'   : outFile,
           'fileFd'  : fileFd}
          </call>
          <process name="'%s:%s: Grep' % (client.getHost(),client.getName())">
            <location>client.getHost()</location>
            <command mode="'shell'">
              "grep 'TOTAL' %s | cut -d ' ' -f3-" % outFile
            </command>
            <envs>['PATH=/bin:/usr/bin']</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <script>
            summary = STAXResult[0][1]
          </script>
          <call function="'writeMessage'">
          {'content' : 'Summary %s' % (summary),
           'fileFd'  : fileFd}
          </call>
        </sequence>
      </else>
      </if>
opends/tests/system-tests/scenario/sample2/clients/sampleSearchLoad/sampleSearchLoadLib.xml
New file
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "../../../../../shared/stax.dtd">
<!--
 ! CDDL HEADER START
 !
 ! The contents of this file are subject to the terms of the
 ! Common Development and Distribution License, Version 1.0 only
 ! (the "License").  You may not use this file except in compliance
 ! with the License.
 !
 ! You can obtain a copy of the license at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
 ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 ! See the License for the specific language governing permissions
 ! and limitations under the License.
 !
 ! When distributing Covered Code, include this CDDL HEADER in each
 ! file and include the License file at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 ! add the following below this CDDL HEADER, with the fields enclosed
 ! by brackets "[]" replaced with your own identifying information:
 !      Portions Copyright [yyyy] [name of copyright owner]
 !
 ! CDDL HEADER END
 !
 !      Copyright 2008 Sun Microsystems, Inc.
 ! -->
<stax>
  <defaultcall function="sampleSearchLoadParser"/>
  <!-- ************************************************************ -->
  <!-- Client Parser -->
  <!-- This function must NOT have scope=local has its variables may -->
  <!-- be used by the caller -->
  <function name="sampleSearchLoadParser">
    <function-map-args>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
      <function-arg-def name="suffix"     type="required"/>
    </function-map-args>
    <sequence>
      <script>
        compilDir = '%s/%s_%s' % \
                    (client.getPath(),client.getHost(),client.getId())
        #
        # Extract client parameters from client.getParams()
        #
        cParams = client.getParams()
        try:
          serverInstanceFromClient = cParams[0][1]
        except IndexError:
          serverInstanceFromClient = NOT_DEFINED
          msg = '%s\nERROR: serverInstanceFromClient undefined,mandatory' % msg
        try:
          baseDn = cParams[1][1]
        except IndexError:
          baseDn = NOT_DEFINED
          msg = '%s\nERROR: baseDn undefined,mandatory' % msg
        try:
          nbCnx = cParams[2][1]
        except IndexError:
          nbCnx = NOT_DEFINED
          msg = '%s\nERROR: nbCnx undefined,mandatory' % msg
        try:
          nbMaxSearch = cParams[3][1]
        except IndexError:
          nbMaxSearch = NOT_DEFINED
          msg = '%s\nERROR: nbMaxOperations undefined,mandatory' % msg
        try:
          attributeName = cParams[4][1]
        except IndexError:
          attributeName = NOT_DEFINED
        #
        # setup parms to run the client
        #
        if serverInstanceFromClient != NOT_DEFINED:
          sys.path.append("%s/phases/scheduler" % TESTS_DIR )
          from scheduler import getInstance
          serverInstance = getInstance(serverInstanceFromClient,instances)
          if (serverInstance == 'ERROR'):
            msg = '%s\nERROR: cant find client instance named' % msg
            msg = '%s %s in server instance list' % \
                  (msg,serverInstanceFromClient)
          else:
            # remove sec, try to finish before timer kill -9 the client
            duration = duration - 20
            parms=[]
            parms.append('-h %s -p %s' % \
                       (serverInstance.getHost(),serverInstance.getLDAPPort()))
            parms.append('-b "%s"' % baseDn)
            parms.append('-D "%s" -w "%s"' % \
                        (DIRECTORY_INSTANCE_DN,DIRECTORY_INSTANCE_PSWD))
            parms.append('-t %s -M %s -d %s' % (nbCnx,nbMaxSearch,duration))
            if attributeName != NOT_DEFINED:
              parms.append('-a %s' % attributeName)
            parms = ' '.join(parms)
      </script>
    </sequence>
  </function>
</stax>
opends/tests/system-tests/scenario/sample2/clients/sampleSearchLoad/sampleSearchLoadPostamble.xml
New file
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "../../../../../shared/stax.dtd">
<!--
 ! CDDL HEADER START
 !
 ! The contents of this file are subject to the terms of the
 ! Common Development and Distribution License, Version 1.0 only
 ! (the "License").  You may not use this file except in compliance
 ! with the License.
 !
 ! You can obtain a copy of the license at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
 ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 ! See the License for the specific language governing permissions
 ! and limitations under the License.
 !
 ! When distributing Covered Code, include this CDDL HEADER in each
 ! file and include the License file at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 ! add the following below this CDDL HEADER, with the fields enclosed
 ! by brackets "[]" replaced with your own identifying information:
 !      Portions Copyright [yyyy] [name of copyright owner]
 !
 ! CDDL HEADER END
 !
 !      Copyright 2008 Sun Microsystems, Inc.
 ! -->
<stax>
  <defaultcall function="sampleSearchLoadPostamble"/>
  <!-- ************************************************************ -->
  <!-- Client is automatically called by the scheduler and must     -->
  <!-- always define all the parameters below                       -->
  <function name="sampleSearchLoadPostamble" scope="local">
    <function-map-args>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
      <function-arg-def name="suffix"     type="required"/>
      <function-arg-def name="outFile"    type="required"/>
      <function-arg-def name="fileFd"     type="required"/>
    </function-map-args>
    <sequence>
      <!-- ===================   Comments   =================== -->
      <!-- client is run under paralleliterate tag              -->
      <!-- each variables defined are internal                  -->
      <!-- client should have its own err_num variable in order -->
      <!-- to inform scheduler if it has pass/fail status       -->
      <script>
        errNum = 0
        msg = ''
      </script>
      <!-- ==================    Parser     =================== -->
      <!-- parse the client parameters :                        -->
      <!-- params is [[param1,val1],[param2,val2],...]          -->
      <!-- get the ldap instance parameters                     -->
      <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
              file="'%s/%sLib.xml' % (client.getPath(),client.getName())"/>
      <call function="'searchLoadParser'">
      {
        'client'     : client,
        'instances'  : instances,
        'duration'   : duration,
        'suffix'     : suffix
      }
      </call>
      <if expr="msg.find('ERROR') != -1">
        <sequence>
          <message>'%s' % msg</message>
          <call function="'writeOperationResult'">
            {
              'returncode' : '1',
              'expected'   : '0',
              'result'     : msg,
              'status'     : 'ERROR',
              'fileFd'     : fileFd
            }
          </call>
          <script>
            errNum += 1
          </script>
        </sequence>
      <else>
        <sequence>
          <process name="'%s:%s: Grep' % (client.getHost(),client.getName())">
            <location>client.getHost()</location>
            <command mode="'shell'">
              "grep 'TOTAL' %s | cut -d ' ' -f3-" % outFile
            </command>
            <envs>['PATH=/bin:/usr/bin']</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <script>
            summary = STAXResult[0][1]
          </script>
          <call function="'writeMessage'">
          {'content' : 'Summary %s' % (summary),
           'fileFd'  : fileFd}
          </call>
        </sequence>
      </else>
      </if>
      <return> errNum </return>
    </sequence>
  </function>
</stax>
opends/tests/system-tests/scenario/sample2/clients/sampleSearchLoad/sampleSearchLoadPreamble.xml
New file
@@ -0,0 +1,173 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "../../../../../shared/stax.dtd">
<!--
 ! CDDL HEADER START
 !
 ! The contents of this file are subject to the terms of the
 ! Common Development and Distribution License, Version 1.0 only
 ! (the "License").  You may not use this file except in compliance
 ! with the License.
 !
 ! You can obtain a copy of the license at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
 ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 ! See the License for the specific language governing permissions
 ! and limitations under the License.
 !
 ! When distributing Covered Code, include this CDDL HEADER in each
 ! file and include the License file at
 ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 ! add the following below this CDDL HEADER, with the fields enclosed
 ! by brackets "[]" replaced with your own identifying information:
 !      Portions Copyright [yyyy] [name of copyright owner]
 !
 ! CDDL HEADER END
 !
 !      Copyright 2008 Sun Microsystems, Inc.
 ! -->
<stax>
  <defaultcall function="sampleSearchLoadPreamble"/>
  <!-- ************************************************************ -->
  <!-- Client is automatically called by the scheduler and must     -->
  <!-- always define all the parameters below                       -->
  <function name="sampleSearchLoadPreamble" scope="local">
    <function-map-args>
      <function-arg-def name="client"     type="required"/>
      <function-arg-def name="instances"  type="required"/>
      <function-arg-def name="duration"   type="required"/>
      <function-arg-def name="suffix"     type="required"/>
      <function-arg-def name="outFile"    type="required"/>
      <function-arg-def name="fileFd"     type="required"/>
    </function-map-args>
    <sequence>
      <!-- ===================   Comments   =================== -->
      <!-- client is run under paralleliterate tag              -->
      <!-- each variables defined are internal                  -->
      <!-- client should have its own err_num variable in order -->
      <!-- to inform scheduler if it has pass/fail status       -->
      <script>
        errNum = 0
        msg = ''
      </script>
      <!-- ==================    Parser     =================== -->
      <!-- parse the client parameters :                        -->
      <!-- params is [[param1,val1],[param2,val2],...]          -->
      <!-- get the ldap instance parameters                     -->
      <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
              file="'%s/%sLib.xml' % (client.getPath(),client.getName())"/>
      <call function="'searchLoadParser'">
      {
        'client'     : client,
        'instances'  : instances,
        'duration'   : duration,
        'suffix'     : suffix
      }
      </call>
      <if expr="msg.find('ERROR') != -1">
        <sequence>
          <message>'%s' % msg</message>
          <call function="'writeOperationResult'">
            {
              'returncode' : '1',
              'expected'   : '0',
              'result'     : msg,
              'status'     : 'ERROR',
              'fileFd'     : fileFd
            }
          </call>
          <script>
            errNum += 1
          </script>
        </sequence>
      <else>
        <sequence>
          <!-- ==== Add execute permission to build.sh file ==== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'chmod',
            'fileFd'  : fileFd }
          </call>
          <call function="'writeMessage'">
          {'content' : 'Add execute permission to build.sh file',
           'fileFd'  : fileFd}
          </call>
          <process name="'%s: chmod +x build.sh' % client.getHost()">
            <location>client.getHost()</location>
            <command mode="'shell'">'chmod +x build.sh'</command>
            <parms/>
            <workdir>client.getPath()</workdir>
            <envs>['PATH=/bin:/usr/bin']</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <call function="'checkRC'">
            { 'returncode' : RC,
              'result'     : STAXResult[0][1],
              'fileFd'     : fileFd }
          </call>
          <script>
            errNum += STAXResult
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
          <!-- ==== build client : run build.sh file ==== -->
          <call function="'writeStartTagOperation'">
          { 'tagName' : 'build',
            'fileFd'  : fileFd }
          </call>
          <call function="'writeMessage'">
          {'content' : 'Build client',
           'fileFd'  : fileFd}
          </call>
          <!-- Build Client in unique directory (compilDir), avoid          -->
          <!-- conflict if same client is run several time at the same time -->
          <process name="'%s: build %s' % (client.getHost(),client.getName())">
            <location>client.getHost()</location>
            <command mode="'shell'">'./build.sh'</command>
            <parms/>
            <workdir>client.getPath()</workdir>
            <envs>['PATH=%s/bin:/bin:/usr/bin' % JAVA_HOME,'COMPILDIR=%s' % compilDir]</envs>
            <stderr mode="'stdout'"/>
            <stdout/>
            <returnstdout/>
          </process>
          <call function="'checkRC'">
            { 'returncode' : RC,
              'result'     : STAXResult[0][1],
              'fileFd'     : fileFd }
          </call>
          <if expr="RC != 0">
            <message>
              'FAILED to build client %s on %s' % \
              (client.getName(),client.getHost())
            </message>
          </if>
          <script>
            errNum += STAXResult
          </script>
          <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
        </sequence>
      </else>
      </if>
      <return> errNum </return>
    </sequence>
  </function>
</stax>