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

andrug
02.53.2008 af24d34127f8ccfe859cc23434ca73261e49d145
createFolder(): do not create folder if already exists
1 files modified
69 ■■■■■ changed files
opendj-sdk/opends/tests/system-tests/phases/shared/functions/stafcmd.xml 69 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/system-tests/phases/shared/functions/stafcmd.xml
@@ -508,36 +508,61 @@
    </function-map-args>
    <sequence>
      <script>
        cmdRC = 0
      </script>
      <call function="'writeStartTagOperation'">
      { 'tagName' : 'createFolder',
        'fileFd'  : fileFd }
      </call>
      <call function="'writeMessage'">
        {
          'content'  : 'Create directory %s on %s' % (foldername,location) ,
          'fileFd'   : fileFd
        }
      <call function="'isFile'">
      {
        'location' : location,
        'fileName' : foldername
      }
      </call>
      <stafcmd name="'STAF Command: Create Folder'">
        <location>'%s' % location</location>
        <service>'fs'</service>
        <request>
          'CREATE DIRECTORY %s FULLPATH' % foldername
        </request>
      </stafcmd>
      <script>
        cmdRC=RC
        cmdResult=STAFResult
        fileExist = STAXResult
      </script>
       <call function="'checkRC'">
          { 'returncode' : cmdRC ,
            'result'     : cmdResult ,
            'fileFd'     : fileFd
      <if expr="fileExist == TRUE">
        <call function="'writeMessage'">
          {
            'content'  : '%s: Directory %s already exists, skip' %\
                         (location,foldername),
            'fileFd'   : fileFd
          }
      </call>
        </call>
      <else>
        <sequence>
          <call function="'writeMessage'">
            {
              'content'  : 'Create directory %s on %s' % (foldername,location) ,
              'fileFd'   : fileFd
            }
          </call>
          <stafcmd name="'STAF Command: Create Folder'">
            <location>'%s' % location</location>
            <service>'fs'</service>
            <request>
              'CREATE DIRECTORY %s FULLPATH' % foldername
            </request>
          </stafcmd>
          <script>
            cmdRC=RC
            cmdResult=STAFResult
          </script>
           <call function="'checkRC'">
              { 'returncode' : cmdRC ,
                'result'     : cmdResult ,
                'fileFd'     : fileFd
              }
          </call>
        </sequence>
      </else>
      </if>
      <call function="'writeEndTagOperation'">{'fileFd' : fileFd}</call>
      
      <return>cmdRC</return>