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

elocatel
16.48.2008 564b96103aeae6a3b4a7e1fadea99163c02037c8
2 new functions: checkFileNotExists and checkFileExists
1 files modified
49 ■■■■■ changed files
opends/tests/shared/functions/utils.xml 49 ●●●●● patch | view | raw | blame | history
opends/tests/shared/functions/utils.xml
@@ -2130,4 +2130,53 @@
    </sequence>
  </function>
  <function name="checkFileExists" scope="local">
    <function-description>
      Set testcase result to FAIL if file (as param) does not exist
    </function-description>
    <function-map-args>
      <function-arg-def name="file" type="required">
        <function-arg-description>
          The file to check existence
        </function-arg-description>
      </function-arg-def>
    </function-map-args>
    <sequence>
      <script>
        if os.path.exists('%s' % file):
          exist=1
        else:
          exist=0
      </script>
      <if expr="exist == 0">
        <tcstatus result="'fail'"/>
      </if>
    </sequence>
  </function>
  <function name="checkFileNotExists" scope="local">
    <function-description>
      Set testcase result to FAIL if file (as param) exists
    </function-description>
    <function-map-args>
      <function-arg-def name="file" type="required">
        <function-arg-description>
          The file to check absence
        </function-arg-description>
      </function-arg-def>
    </function-map-args>
    <sequence>
      <script>
        if os.path.exists('%s' % file):
          exist=1
        else:
          exist=0
      </script>
      <if expr="exist == 1">
        <tcstatus result="'fail'"/>
      </if>
    </sequence>
  </function>
</stax>