external-storage.feature 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. Feature: external-storage
  5. Background:
  6. Given using api version "1"
  7. Given using old dav path
  8. @local_storage
  9. Scenario: Share by link a file inside a local external storage
  10. Given user "user0" exists
  11. And user "user1" exists
  12. And As an "user0"
  13. And user "user0" created a folder "/local_storage/foo"
  14. And User "user0" moved file "/textfile0.txt" to "/local_storage/foo/textfile0.txt"
  15. And folder "/local_storage/foo" of user "user0" is shared with user "user1"
  16. And As an "user1"
  17. And accepting last share
  18. When creating a share with
  19. | path | foo |
  20. | shareType | 3 |
  21. Then the OCS status code should be "100"
  22. And the HTTP status code should be "200"
  23. And Share fields of last share match with
  24. | id | A_NUMBER |
  25. | url | AN_URL |
  26. | token | A_TOKEN |
  27. | mimetype | httpd/unix-directory |
  28. Scenario: Shares don't overwrite external storage
  29. Given user "user0" exists
  30. And user "user1" exists
  31. And As an "user0"
  32. And User "user0" moved file "/textfile0.txt" to "/local_storage/textfile0.txt"
  33. And invoking occ with "files_external:create --user user0 test local null::null -c datadir=./build/integration/work/local_storage"
  34. And invoking occ with "files:scan --path /user0/files/test"
  35. And as "user0" the file "/local_storage/textfile0.txt" exists
  36. And as "user0" the folder "/test" exists
  37. And as "user0" the file "/test/textfile0.txt" exists
  38. And As an "user1"
  39. And user "user1" created a folder "/test"
  40. And User "user1" moved file "/textfile0.txt" to "/test/textfile1.txt"
  41. And folder "/test" of user "user1" is shared with user "user0"
  42. And As an "user0"
  43. Then as "user0" the file "/test/textfile1.txt" does not exist
  44. Scenario: Move a file into storage works
  45. Given user "user0" exists
  46. And user "user1" exists
  47. And As an "user0"
  48. And user "user0" created a folder "/local_storage/foo1"
  49. When User "user0" moved file "/textfile0.txt" to "/local_storage/foo1/textfile0.txt"
  50. Then as "user1" the file "/local_storage/foo1/textfile0.txt" exists
  51. And as "user0" the file "/local_storage/foo1/textfile0.txt" exists
  52. Scenario: Move a file out of the storage works
  53. Given user "user0" exists
  54. And user "user1" exists
  55. And As an "user0"
  56. And user "user0" created a folder "/local_storage/foo2"
  57. And User "user0" moved file "/textfile0.txt" to "/local_storage/foo2/textfile0.txt"
  58. When User "user1" moved file "/local_storage/foo2/textfile0.txt" to "/local.txt"
  59. Then as "user1" the file "/local_storage/foo2/textfile0.txt" does not exist
  60. And as "user0" the file "/local_storage/foo2/textfile0.txt" does not exist
  61. And as "user1" the file "/local.txt" exists
  62. Scenario: Save an external storage with password provided by user
  63. Given Logging in using web as "admin"
  64. And logged in user creates external global storage
  65. | mountPoint | "ExternalStorageTest" |
  66. | backend | "owncloud" |
  67. | authMechanism | "password::userprovided" |
  68. | backendOptions | {"host":"http://localhost:8080","secure":false} |
  69. And fields of last external storage match with
  70. | status | 2 |
  71. When logged in user updates last external userglobal storage
  72. | backendOptions | {"user":"admin","password":"admin"} |
  73. Then fields of last external storage match with
  74. | status | 0 |
  75. Scenario: Save an external storage again with an unmodified password provided by user
  76. Given Logging in using web as "admin"
  77. And logged in user creates external global storage
  78. | mountPoint | "ExternalStorageTest" |
  79. | backend | "owncloud" |
  80. | authMechanism | "password::userprovided" |
  81. | backendOptions | {"host":"http://localhost:8080","secure":false} |
  82. And fields of last external storage match with
  83. | status | 2 |
  84. And logged in user updates last external userglobal storage
  85. | backendOptions | {"user":"admin","password":"admin"} |
  86. When logged in user updates last external userglobal storage
  87. | backendOptions | {"user":"admin","password":"__unmodified__"} |
  88. Then fields of last external storage match with
  89. | status | 0 |
  90. Scenario: Save an external storage with global credentials provided by user
  91. Given Logging in using web as "admin"
  92. And logged in user creates external global storage
  93. | mountPoint | "ExternalStorageTest" |
  94. | backend | "owncloud" |
  95. | authMechanism | "password::global::user" |
  96. | backendOptions | {"host":"http://localhost:8080","secure":false} |
  97. And fields of last external storage match with
  98. | status | 2 |
  99. When logged in user updates last external userglobal storage
  100. | backendOptions | {"user":"admin","password":"admin"} |
  101. Then fields of last external storage match with
  102. | status | 0 |
  103. Scenario: Save an external storage again with unmodified global credentials provided by user
  104. Given Logging in using web as "admin"
  105. And logged in user creates external global storage
  106. | mountPoint | "ExternalStorageTest" |
  107. | backend | "owncloud" |
  108. | authMechanism | "password::global::user" |
  109. | backendOptions | {"host":"http://localhost:8080","secure":false} |
  110. And fields of last external storage match with
  111. | status | 2 |
  112. And logged in user updates last external userglobal storage
  113. | backendOptions | {"user":"admin","password":"admin"} |
  114. When logged in user updates last external userglobal storage
  115. | backendOptions | {"user":"admin","password":"__unmodified__"} |
  116. Then fields of last external storage match with
  117. | status | 0 |