<commit_before>@api
Feature: propagation of etags when copying files or folders

  Background:
    Given user "Alice" has been created with default attributes and without skeleton files

  @skipOnOcis-OC-Storage @issue-product-280
  Scenario Outline: copying a file does not change its etag
    Given using <dav_version> DAV path
    And user "Alice" has uploaded file with content "uploaded content" to "file.txt"
    And user "Alice" has stored etag of element "/"
    And user "Alice" has stored etag of element "/file.txt"
    And user "Alice" has stored etag of element "/file.txt" on path "/renamedFile.txt"
    When user "Alice" copies file "/file.txt" to "/renamedFile.txt" using the WebDAV API
    Then the HTTP status code should be "201"
    And these etags should not have changed:
      | user  | path      |
      | Alice | /file.txt |
    And these etags should have changed:
      | user  | path             |
      | Alice | /                |
      | Alice | /renamedFile.txt |
    Examples:
      | dav_version |
      | old         |
      | new         |

    @skipOnOcV10 @personalSpace
    Examples:
      | dav_version |
      | spaces      |

  @skipOnOcis-OC-Storage @issue-product-280
  Scenario Outline: copying a file inside a folder changes its etag
    Given using <dav_version> DAV path
    And user "Alice" has created folder "/folder"
    And user "Alice" has uploaded file with content "uploaded content" to "file.txt"
    And user "Alice" has stored etag of element "/file.txt"
    And user "Alice" has stored etag of element "/folder"
    And user "Alice" has stored etag of element "/file.txt" on path "/folder/renamedFile.txt"
    When user "Alice" copies file "/file.txt" to "/folder/renamedFile.txt" using the WebDAV API
    Then the HTTP status code should be "201"
    And these etags should not have changed:
      | user  | path      |
      | Alice | /file.txt |
    And these etags should have changed:
      | user  | path                    |
      | Alice | /folder/renamedFile.txt |
      | Alice | /folder                 |
    Examples:
      | dav_version |
      | old         |
      | new         |

    @skipOnOcV10 @personalSpace
    Examples:
      | dav_version |
      | spaces      |

  @skipOnOcis-OC-Storage @issue-product-280
  Scenario Outline: copying a file from one folder to an other changes the etags of destination
    Given using <dav_version> DAV path
    And user "Alice" has created folder "/src"
    And user "Alice" has uploaded file with content "uploaded content" to "/src/file.txt"
    And user "Alice" has created folder "/dst"
    And user "Alice" has stored etag of element "/"
    And user "Alice" has stored etag of element "/src"
    And user "Alice" has stored etag of element "/dst"
    When user "Alice" copies folder "/src/file.txt" to "/dst/file.txt" using the WebDAV API
    Then the HTTP status code should be "201"
    And these etags should have changed:
      | user  | path |
      | Alice | /    |
      | Alice | /dst |
    And these etags should not have changed:
      | user  | path |
      | Alice | /src |
    Examples:
      | dav_version |
      | old         |
      | new         |

    @skipOnOcV10 @personalSpace
    Examples:
      | dav_version |
      | spaces      |

  @skipOnOcis-OC-Storage @issue-product-280
  Scenario Outline: copying a file into a subfolder changes the etags of all parents
    Given using <dav_version> DAV path
    And user "Alice" has created folder "/upload"
    And user "Alice" has created folder "/upload/sub"
    And user "Alice" has uploaded file with content "uploaded content" to "/upload/file.txt"
    And user "Alice" has stored etag of element "/"
    And user "Alice" has stored etag of element "/upload"
    And user "Alice" has stored etag of element "/upload/file.txt"
    And user "Alice" has stored etag of element "/upload/file.txt" on path "/upload/sub/file.txt"
    And user "Alice" has stored etag of element "/upload/sub"
    When user "Alice" copies file "/upload/file.txt" to "/upload/sub/file.txt" using the WebDAV API
    Then the HTTP status code should be "201"
    And these etags should have changed:
      | user  | path                 |
      | Alice | /                    |
      | Alice | /upload              |
      | Alice | /upload/sub          |
      | Alice | /upload/sub/file.txt |
    And these etags should not have changed:
      | user  | path             |
      | Alice | /upload/file.txt |
    Examples:
      | dav_version |
      | old         |
      | new         |

    @skipOnOcV10 @personalSpace
    Examples:
      | dav_version |
      | spaces      |

  @skipOnOcis-OC-Storage @issue-product-280
  Scenario Outline: copying a file inside a publicly shared folder by public changes etag for the sharer
    Given using <dav_version> DAV path
    And user "Alice" has created folder "/upload"
    And user "Alice" has uploaded file with content "uploaded content" to "/upload/file.txt"
    And user "Alice" has created a public link share with settings
      | path        | upload |
      | permissions | change |
    And user "Alice" has stored etag of element "/"
    And user "Alice" has stored etag of element "/upload"
    And user "Alice" has stored etag of element "/upload/file.txt"
    And user "Alice" has stored etag of element "/upload/file.txt" on path "/upload/renamedFile.txt"
    When the public copies file "file.txt" to "/renamedFile.txt" using the new public WebDAV API
    Then the HTTP status code should be "201"
    And these etags should have changed:
      | user  | path                    |
      | Alice | /                       |
      | Alice | /upload                 |
      | Alice | /upload/renamedFile.txt |
    And these etags should not have changed:
      | user  | path             |
      | Alice | /upload/file.txt |<commit_msg>Skip the flaky etag propagation tests when running with oCIS CI<commit_after>@api
Feature: propagation of etags when copying files or folders

  Background:
    Given user "Alice" has been created with default attributes and without skeleton files

  @skipOnOcis-OC-Storage @issue-product-280
  Scenario Outline: copying a file does not change its etag
    Given using <dav_version> DAV path
    And user "Alice" has uploaded file with content "uploaded content" to "file.txt"
    And user "Alice" has stored etag of element "/"
    And user "Alice" has stored etag of element "/file.txt"
    And user "Alice" has stored etag of element "/file.txt" on path "/renamedFile.txt"
    When user "Alice" copies file "/file.txt" to "/renamedFile.txt" using the WebDAV API
    Then the HTTP status code should be "201"
    And these etags should not have changed:
      | user  | path      |
      | Alice | /file.txt |
    And these etags should have changed:
      | user  | path             |
      | Alice | /                |
      | Alice | /renamedFile.txt |
    Examples:
      | dav_version |
      | old         |
      | new         |

    @skipOnOcV10 @personalSpace
    Examples:
      | dav_version |
      | spaces      |

  @skipOnOcis-OC-Storage @issue-product-280
  Scenario Outline: copying a file inside a folder changes its etag
    Given using <dav_version> DAV path
    And user "Alice" has created folder "/folder"
    And user "Alice" has uploaded file with content "uploaded content" to "file.txt"
    And user "Alice" has stored etag of element "/file.txt"
    And user "Alice" has stored etag of element "/folder"
    And user "Alice" has stored etag of element "/file.txt" on path "/folder/renamedFile.txt"
    When user "Alice" copies file "/file.txt" to "/folder/renamedFile.txt" using the WebDAV API
    Then the HTTP status code should be "201"
    And these etags should not have changed:
      | user  | path      |
      | Alice | /file.txt |
    And these etags should have changed:
      | user  | path                    |
      | Alice | /folder/renamedFile.txt |
      | Alice | /folder                 |
    Examples:
      | dav_version |
      | old         |
      | new         |

    @skipOnOcV10 @personalSpace
    Examples:
      | dav_version |
      | spaces      |

  @skipOnOcis-OC-Storage @issue-product-280
  Scenario Outline: copying a file from one folder to an other changes the etags of destination
    Given using <dav_version> DAV path
    And user "Alice" has created folder "/src"
    And user "Alice" has uploaded file with content "uploaded content" to "/src/file.txt"
    And user "Alice" has created folder "/dst"
    And user "Alice" has stored etag of element "/"
    And user "Alice" has stored etag of element "/src"
    And user "Alice" has stored etag of element "/dst"
    When user "Alice" copies folder "/src/file.txt" to "/dst/file.txt" using the WebDAV API
    Then the HTTP status code should be "201"
    And these etags should have changed:
      | user  | path |
      | Alice | /    |
      | Alice | /dst |
    And these etags should not have changed:
      | user  | path |
      | Alice | /src |
    Examples:
      | dav_version |
      | old         |
      | new         |

    @skipOnOcV10 @personalSpace
    Examples:
      | dav_version |
      | spaces      |

  @skipOnOcis-OC-Storage @issue-product-280
  Scenario Outline: copying a file into a subfolder changes the etags of all parents
    Given using <dav_version> DAV path
    And user "Alice" has created folder "/upload"
    And user "Alice" has created folder "/upload/sub"
    And user "Alice" has uploaded file with content "uploaded content" to "/upload/file.txt"
    And user "Alice" has stored etag of element "/"
    And user "Alice" has stored etag of element "/upload"
    And user "Alice" has stored etag of element "/upload/file.txt"
    And user "Alice" has stored etag of element "/upload/file.txt" on path "/upload/sub/file.txt"
    And user "Alice" has stored etag of element "/upload/sub"
    When user "Alice" copies file "/upload/file.txt" to "/upload/sub/file.txt" using the WebDAV API
    Then the HTTP status code should be "201"
    And these etags should have changed:
      | user  | path                 |
      | Alice | /                    |
      | Alice | /upload              |
      | Alice | /upload/sub          |
      | Alice | /upload/sub/file.txt |
    And these etags should not have changed:
      | user  | path             |
      | Alice | /upload/file.txt |
    @skipOnOcis @issue-ocis-4091
    Examples:
      | dav_version |
      | old         |
      | new         |

    @skipOnOcV10 @personalSpace
    Examples:
      | dav_version |
      | spaces      |

  @skipOnOcis-OC-Storage @issue-product-280
  Scenario Outline: copying a file inside a publicly shared folder by public changes etag for the sharer
    Given using <dav_version> DAV path
    And user "Alice" has created folder "/upload"
    And user "Alice" has uploaded file with content "uploaded content" to "/upload/file.txt"
    And user "Alice" has created a public link share with settings
      | path        | upload |
      | permissions | change |
    And user "Alice" has stored etag of element "/"
    And user "Alice" has stored etag of element "/upload"
    And user "Alice" has stored etag of element "/upload/file.txt"
    And user "Alice" has stored etag of element "/upload/file.txt" on path "/upload/renamedFile.txt"
    When the public copies file "file.txt" to "/renamedFile.txt" using the new public WebDAV API
    Then the HTTP status code should be "201"
    And these etags should have changed:
      | user  | path                    |
      | Alice | /                       |
      | Alice | /upload                 |
      | Alice | /upload/renamedFile.txt |
    And these etags should not have changed:
      | user  | path             |
      | Alice | /upload/file.txt |
    @skipOnOcis @issue-ocis-4091
{'fraction_non_alphanumeric': 0.08534322820037106, 'fraction_numerical': 0.0070838252656434475, 'mean_word_length': 2.1598721023181455, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3318326', 'n_tokens_mistral': 3575, 'n_tokens_neox': 3432, 'n_words': 1352}