external-storage.feature 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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