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

andrug
16.55.2008 b5e8f8c3f36965a76406d9e5addb4244ec94b498
verifyTrees(): more robust, isAlive(): more robust: avoid sleeping if server ot responding, move from removed phase/verdict/verdict_opends.xml file the function named checkLogs() 
1 files modified
103 ■■■■■ changed files
opends/tests/system-tests/phases/shared/functions/ldap.xml 103 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/shared/functions/ldap.xml
@@ -111,7 +111,12 @@
      }
      </call>
      
      <script>ldapRC=9999</script>
      <script>
        ldapRC=9999
        timerKilled = TRUE
      </script>
      <timer duration="'120s'">
        <sequence>
      <loop from="1" to="noOfLoops" while="ldapRC != 0">
        <sequence>
          <call function="'ldapSearch'">
@@ -144,7 +149,22 @@
          
        </sequence>
      </loop>
          <script>
            timerKilled = FALSE
          </script>
        </sequence>
      </timer>
      <if expr="timerKilled == TRUE">
        <sequence>
          <call function="'writeMessage'">
          { 'fileFd'  : fileFd,
            'content' : 'server is not alive, ldapsearch not responding'
          }
          </call>
          <script>returnValue = FALSE</script>
        </sequence>
      <else>
        <sequence>
      <if expr="ldapRC == 0">
        <sequence>
          <call function="'writeMessage'">
@@ -165,7 +185,9 @@
        </sequence>
      </else>
      </if>
        </sequence>
      </else>
      </if>
      <call function="'writeEndTagOperation'">{'fileFd'  : fileFd}</call>
      <return>returnValue</return>
    </sequence>
@@ -217,6 +239,8 @@
        instance2 = NOT_DEFINED
        i = 0
        found = FALSE
        failedServers = []
        myRC = 0
        
        # get the real instance reference from instances list
        for cInstance in instances:
@@ -246,9 +270,8 @@
          </call>
          
          <script>
            myRC = 0
            dsPath = instance.getInstallDir()
            failedServers = []
            failingServerList = ''
            referenceServerPath = instance.getInstallDir()
            referenceTree = '%s/%s_%s_referenceTree.ldif' % \
@@ -287,7 +310,8 @@
            }
          </call>
          <if expr="STAXResult[0] != 0">
            <!-- == If the reference tree could not be retrieved, return an error == -->
            <!-- == If the reference tree could not be retrieved,  == -->
            <!-- == return an error                                == -->
            <sequence>
              <call function="'writeEndTagStep'">{ 'fileFd' : fileFd}</call>
              <return> [1, None] </return>
@@ -374,9 +398,9 @@
          
          <call function="'writeEndTagStep'">{ 'fileFd' : fileFd}</call>
          
          <return>[myRC, failedServers]</return>
        </sequence>
      </if>
      <return>[myRC, failedServers]</return>
    </sequence>
  </function>
@@ -897,7 +921,6 @@
  
  <!-- ************************************************************ -->
  <!-- Add a New entry-->
  <function name="addAnEntry">
    <function-prolog>
@@ -1045,6 +1068,7 @@
    
  
  <!-- ************************************************************ -->
   <!-- Modify an attribute -->
  <function name="modifyAnAttribute">
    <function-prolog>
@@ -1253,6 +1277,7 @@
  </function>    
  
 <!-- ************************************************************ -->
 <function name="modifyEntry">
    <function-prolog>
      This function modifies an entry in the Directory Server
@@ -1370,4 +1395,66 @@
    </sequence>
  </function>  
  
  <!-- ************************************************************ -->
  <function name="checkLogs" scope="local">
    <function-map-args>
      <function-arg-def name="location" type="optional"
                        default="STAF_REMOTE_HOSTNAME">
        <function-arg-description>
          Location of target host
        </function-arg-description>
      </function-arg-def>
      <function-arg-def name="installDir" type="required">
        <function-arg-description>
          instance installation path
        </function-arg-description>
      </function-arg-def>
      <function-arg-def name="fileFd" type="required">
        <function-arg-description>
          Name of output file descriptor
        </function-arg-description>
      </function-arg-def>
    </function-map-args>
    <sequence>
      <script> _errNum = 0 </script>
      <call function="'writeStartTagStep'">
      { 'tagName' : 'checkLogs',
        'fileFd'  : fileFd }
      </call>
      <call function="'grep'">
      {
        'location'      : location,
        'string2grep'   : 'ERROR',
        'expect2Find'   : FALSE,
        'caseSensitive' : FALSE,
        'file'          : '%s/logs/errors' % installDir,
        'fileFd'        : fileFd
      }
      </call>
      <script> _errNum += STAXResult </script>
      <call function="'grep'">
      {
        'location'      : location,
        'string2grep'   : 'exception',
        'expect2Find'   : FALSE,
        'caseSensitive' : FALSE,
        'file'          : '%s/logs/errors' % installDir,
        'fileFd'        : fileFd
      }
      </call>
      <script> _errNum += STAXResult </script>
      <call function="'writeEndTagStep'">{ 'fileFd' : fileFd}</call>
      <return> _errNum </return>
    </sequence>
  </function>
</stax>