checksums.feature 5.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. Feature: checksums
  5. Scenario: Uploading a file with checksum should work
  6. Given user "user0" exists
  7. When user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
  8. Then The webdav response should have a status code "201"
  9. Scenario: Uploading a file with checksum should return the checksum in the propfind
  10. Given user "user0" exists
  11. And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
  12. When user "user0" request the checksum of "/myChecksumFile.txt" via propfind
  13. Then The webdav checksum should match "MD5:d70b40f177b14b470d1756a3c12b963a"
  14. Scenario: Uploading a file with checksum should return the checksum in the download header
  15. Given user "user0" exists
  16. And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
  17. When user "user0" downloads the file "/myChecksumFile.txt"
  18. Then The header checksum should match "MD5:d70b40f177b14b470d1756a3c12b963a"
  19. Scenario: Moving a file with checksum should return the checksum in the propfind
  20. Given user "user0" exists
  21. And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
  22. When User "user0" moved file "/myChecksumFile.txt" to "/myMovedChecksumFile.txt"
  23. And user "user0" request the checksum of "/myMovedChecksumFile.txt" via propfind
  24. Then The webdav checksum should match "MD5:d70b40f177b14b470d1756a3c12b963a"
  25. Scenario: Moving file with checksum should return the checksum in the download header
  26. Given user "user0" exists
  27. And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
  28. When User "user0" moved file "/myChecksumFile.txt" to "/myMovedChecksumFile.txt"
  29. And user "user0" downloads the file "/myMovedChecksumFile.txt"
  30. Then The header checksum should match "MD5:d70b40f177b14b470d1756a3c12b963a"
  31. Scenario: Copying a file with checksum should return the checksum in the propfind
  32. Given user "user0" exists
  33. And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
  34. When User "user0" copied file "/myChecksumFile.txt" to "/myChecksumFileCopy.txt"
  35. And user "user0" request the checksum of "/myChecksumFileCopy.txt" via propfind
  36. Then The webdav checksum should match "MD5:d70b40f177b14b470d1756a3c12b963a"
  37. Scenario: Copying file with checksum should return the checksum in the download header
  38. Given user "user0" exists
  39. And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
  40. When User "user0" copied file "/myChecksumFile.txt" to "/myChecksumFileCopy.txt"
  41. And user "user0" downloads the file "/myChecksumFileCopy.txt"
  42. Then The header checksum should match "MD5:d70b40f177b14b470d1756a3c12b963a"
  43. Scenario: Overwriting a file with checksum should remove the checksum and not return it in the propfind
  44. Given user "user0" exists
  45. And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
  46. When user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt"
  47. And user "user0" request the checksum of "/myChecksumFile.txt" via propfind
  48. Then The webdav checksum should be empty
  49. Scenario: Overwriting a file with checksum should remove the checksum and not return it in the download header
  50. Given user "user0" exists
  51. And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
  52. When user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt"
  53. And user "user0" downloads the file "/myChecksumFile.txt"
  54. Then The OC-Checksum header should not be there
  55. Scenario: Uploading a chunked file with checksum should return the checksum in the propfind
  56. Given user "user0" exists
  57. And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChecksumFile.txt" with checksum "MD5:e892fdd61a74bc89cd05673cc2e22f88"
  58. And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChecksumFile.txt" with checksum "MD5:e892fdd61a74bc89cd05673cc2e22f88"
  59. And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChecksumFile.txt" with checksum "MD5:e892fdd61a74bc89cd05673cc2e22f88"
  60. When user "user0" request the checksum of "/myChecksumFile.txt" via propfind
  61. Then The webdav checksum should match "MD5:e892fdd61a74bc89cd05673cc2e22f88"
  62. Scenario: Uploading a chunked file with checksum should return the checksum in the download header
  63. Given user "user0" exists
  64. And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChecksumFile.txt" with checksum "MD5:e892fdd61a74bc89cd05673cc2e22f88"
  65. And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChecksumFile.txt" with checksum "MD5:e892fdd61a74bc89cd05673cc2e22f88"
  66. And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChecksumFile.txt" with checksum "MD5:e892fdd61a74bc89cd05673cc2e22f88"
  67. When user "user0" downloads the file "/myChecksumFile.txt"
  68. Then The header checksum should match "MD5:e892fdd61a74bc89cd05673cc2e22f88"