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

el_kaboing
30.18.2006 39f05a47aa7a7ee5ccf1539bd3f38c8bd18673f1
Allows the testing of strings in the functional tests.
3 files modified
54 ■■■■■ changed files
opends/tests/functional-tests/shared/functions/ldap.xml 2 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/functions/utils.xml 42 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/testcases/security/pwd_policy/security_force_pwd_change_all_users.xml 10 ●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/functions/ldap.xml
@@ -180,6 +180,8 @@
            <stderr mode="'stdout'"/>
            <returnstdout/>
        </process>
        <return>STAXResult</return>
      </sequence>
opends/tests/functional-tests/shared/functions/utils.xml
@@ -119,6 +119,48 @@
  </function>
  <function name="checktestString">
    <function-prolog>
        This function checks the return string against an expected return substring for a testcase
    </function-prolog>
    <function-map-args>
        <function-required-arg name="expectedString">
            the substring expected from the command
        </function-required-arg>
        <function-required-arg name="returnString">
            the return string received from command
        </function-required-arg>
    </function-map-args>
      <sequence>
         <script>
              import re
              searchre = re.compile('%s' % expectedString)
            </script>
            <if expr='re.search(searchre, returnString) != None'>
              <sequence>
              <tcstatus result="'pass'"/>
              <message log="1">
                'Success: Found substring, %s, in the return string' % (expectedString)
              </message>
              </sequence>
            <else>
              <sequence>
              <tcstatus result="'fail'"/>
              <message log="1" level="'Error'">
                'Error: Did not find substring, %s, in the return string, %s' % (expectedString, returnString)
              </message>
              </sequence>
            </else>
            </if>
      </sequence>
  </function>
  <function name="isAlive">
    <function-prolog>
opends/tests/functional-tests/testcases/security/pwd_policy/security_force_pwd_change_all_users.xml
@@ -166,9 +166,13 @@
                'extraParams'      : '-s base' }
            </call>
            <call function="'checktestRC'">
                { 'returncode' : RC ,
                  'result'     : STAXResult }
            <script>
             returnString = STAXResult[0][1]
            </script>
            <call function="'checktestString'">
                { 'returnString'       : returnString ,
                  'expectedString'     : 'will expire' }
            </call>
          </sequence>
        </testcase>