Initial QSfera import

This commit is contained in:
Курнат Андрей
2026-06-07 10:20:04 +03:00
commit 2315f25754
16485 changed files with 4826827 additions and 0 deletions
@@ -0,0 +1,258 @@
@skipOnReva
Feature: sharing
As a user
I want to check the webdav share permissions
So that I know the resources have proper permissions
Background:
Given using OCS API version "1"
And these users have been created with default attributes:
| username |
| Alice |
| Brian |
@smokeTest
Scenario Outline: check webdav share-permissions for owned file
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "foo" to "/tmp.txt"
When user "Alice" gets the following properties of file "/tmp.txt" using the WebDAV API
| propertyName |
| ocs:share-permissions |
Then the HTTP status code should be "207"
And the single response should contain a property "ocs:share-permissions" with value "19"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@skipOnReva
Scenario Outline: check webdav share-permissions for received file with edit
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "foo" to "/tmp.txt"
And user "Alice" has sent the following resource share invitation:
| resource | tmp.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | File Editor |
And user "Brian" has a share "tmp.txt" synced
When user "Brian" gets the following properties of file "/Shares/tmp.txt" using the WebDAV API
| propertyName |
| ocs:share-permissions |
Then the HTTP status code should be "207"
And the single response should contain a property "ocs:share-permissions" with value "3"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: check webdav share-permissions for received group shared file with edit
Given using <dav-path-version> DAV path
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has uploaded file with content "foo" to "/tmp.txt"
And user "Alice" has sent the following resource share invitation:
| resource | tmp.txt |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permissionsRole | File Editor |
And user "Brian" has a share "tmp.txt" synced
When user "Brian" gets the following properties of file "/Shares/tmp.txt" using the WebDAV API
| propertyName |
| ocs:share-permissions |
Then the HTTP status code should be "207"
And the single response should contain a property "ocs:share-permissions" with value "3"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@skipOnReva @issue-2213
Scenario Outline: check webdav share-permissions for received file without edit permissions
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "foo" to "/tmp.txt"
And user "Alice" has sent the following resource share invitation:
| resource | tmp.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Brian" has a share "tmp.txt" synced
When user "Brian" gets the following properties of file "/Shares/tmp.txt" using the WebDAV API
| propertyName |
| ocs:share-permissions |
Then the HTTP status code should be "207"
And the single response should contain a property "ocs:share-permissions" with value "1"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: check webdav share-permissions for owned folder
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/tmp"
When user "Alice" gets the following properties of folder "/" using the WebDAV API
| propertyName |
| ocs:share-permissions |
Then the HTTP status code should be "207"
And the single response should contain a property "ocs:share-permissions" with value "31"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@skipOnReva
Scenario Outline: check webdav share-permissions for received folder with all permissions
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/tmp"
And user "Alice" has sent the following resource share invitation:
| resource | tmp |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "tmp" synced
When user "Brian" gets the following properties of folder "/Shares/tmp" using the WebDAV API
| propertyName |
| ocs:share-permissions |
Then the HTTP status code should be "207"
And the single response should contain a property "ocs:share-permissions" with value "15"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: check webdav share-permissions for received group shared folder with all permissions
Given using <dav-path-version> DAV path
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "/tmp"
And user "Alice" has sent the following resource share invitation:
| resource | tmp |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permissionsRole | Editor |
And user "Brian" has a share "tmp" synced
When user "Brian" gets the following properties of folder "/Shares/tmp" using the WebDAV API
| propertyName |
| ocs:share-permissions |
Then the HTTP status code should be "207"
And the single response should contain a property "ocs:share-permissions" with value "15"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@skipOnReva @issue-2213
Scenario: check webdav share-permissions for received folder with all permissions but edit
Given user "Alice" has created folder "/tmp"
And user "Alice" has sent the following resource share invitation:
| resource | tmp |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Brian" has a share "tmp" synced
And using SharingNG
When user "Alice" updates the last share using the sharing API with
| permissions | delete,create,read |
Then the HTTP status code should be "200"
And as user "Brian" folder "/Shares/tmp" should contain a property "ocs:share-permissions" with value "13"
Scenario: check webdav share-permissions for received group shared folder with all permissions but edit
Given group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "/tmp"
And using SharingNG
And user "Alice" has sent the following resource share invitation:
| resource | tmp |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permissionsRole | Viewer |
And user "Brian" has a share "tmp" synced
When user "Alice" updates the last share using the sharing API with
| permissions | delete,create,read |
Then the HTTP status code should be "200"
And as user "Brian" folder "/Shares/tmp" should contain a property "ocs:share-permissions" with value "13"
@skipOnReva
Scenario: check webdav share-permissions for received folder with all permissions but create
Given user "Alice" has created folder "/tmp"
And user "Alice" has sent the following resource share invitation:
| resource | tmp |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Brian" has a share "tmp" synced
And using SharingNG
When user "Alice" updates the last share using the sharing API with
| permissions | delete,update,read |
Then the HTTP status code should be "200"
And as user "Brian" folder "/Shares/tmp" should contain a property "ocs:share-permissions" with value "11"
Scenario: check webdav share-permissions for received group shared folder with all permissions but create
Given group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "/tmp"
And using SharingNG
And user "Alice" has sent the following resource share invitation:
| resource | tmp |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permissionsRole | Viewer |
And user "Brian" has a share "tmp" synced
When user "Alice" updates the last share using the sharing API with
| permissions | delete,update,read |
Then the HTTP status code should be "200"
And as user "Brian" folder "/Shares/tmp" should contain a property "ocs:share-permissions" with value "11"
@skipOnReva
Scenario: check webdav share-permissions for received folder with all permissions but delete
Given user "Alice" has created folder "/tmp"
And user "Alice" has sent the following resource share invitation:
| resource | tmp |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Brian" has a share "tmp" synced
And using SharingNG
When user "Alice" updates the last share using the sharing API with
| permissions | create,update,read |
Then the HTTP status code should be "200"
And as user "Brian" folder "/Shares/tmp" should contain a property "ocs:share-permissions" with value "7"
Scenario: check webdav share-permissions for received group shared folder with all permissions but delete
Given group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "/tmp"
And using SharingNG
And user "Alice" has sent the following resource share invitation:
| resource | tmp |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permissionsRole | Viewer |
And user "Brian" has a share "tmp" synced
When user "Alice" updates the last share using the sharing API with
| permissions | create,update,read |
Then the HTTP status code should be "200"
And as user "Brian" folder "/Shares/tmp" should contain a property "ocs:share-permissions" with value "7"
@@ -0,0 +1,137 @@
@skipOnReva
Feature: share access by ID
As an API consumer (app)
I want to access a share by its id
So that the app can more easily manage shares
Background:
Given these users have been created with default attributes:
| username |
| Alice |
| Brian |
Scenario Outline: get a share with a valid share ID
Given using OCS API version "<ocs-api-version>"
And user "Alice" has uploaded file with content "КуСфера test text file 0" to "/textfile0.txt"
When user "Alice" shares file "textfile0.txt" with user "Brian" using the sharing API
And user "Alice" gets share with id "%last_share_id%" using the sharing API
Then the OCS status code should be "<ocs-status-code>"
And the HTTP status code should be "200"
And the fields of the last response to user "Alice" sharing with user "Brian" should include
| share_with | %username% |
| share_with_displayname | %displayname% |
| file_target | /Shares/textfile0.txt |
| path | /textfile0.txt |
| permissions | read,update |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| item_type | file |
| mimetype | text/plain |
| storage_id | ANY_VALUE |
| share_type | user |
And the content of file "/Shares/textfile0.txt" for user "Brian" should be "КуСфера test text file 0"
Examples:
| ocs-api-version | ocs-status-code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: get a share with an invalid share id
Given using OCS API version "<ocs-api-version>"
When user "Alice" gets share with id "<share-id>" using the sharing API
Then the OCS status code should be "404"
And the HTTP status code should be "<http-status-code>"
And the API should not return any data
Examples:
| ocs-api-version | share-id | http-status-code |
| 1 | 2333311 | 200 |
| 2 | 2333311 | 404 |
| 1 | helloshare | 200 |
| 2 | helloshare | 404 |
| 1 | $#@r3 | 200 |
| 2 | $#@r3 | 404 |
| 1 | 0 | 200 |
| 2 | 0 | 404 |
Scenario Outline: accept a share using the share Id
Given using OCS API version "<ocs-api-version>"
And user "Alice" has uploaded file with content "КуСфера test text file 0" to "/textfile0.txt"
When user "Alice" shares file "textfile0.txt" with user "Brian" using the sharing API
Then the OCS status code should be "<ocs-status-code>"
And the HTTP status code should be "200"
And user "Brian" should see the following elements
| /Shares/textfile0.txt |
And the sharing API should report to user "Brian" that these shares are in the accepted state
| path |
| /Shares/textfile0.txt |
Examples:
| ocs-api-version | ocs-status-code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: accept a share using the invalid share Id
Given using OCS API version "<ocs-api-version>"
When user "Brian" accepts share with ID "<share-id>" using the sharing API
Then the OCS status code should be "998"
And the HTTP status code should be "<http-status-code>"
And the API should not return any data
Examples:
| ocs-api-version | share-id | http-status-code |
| 1 | 2333311 | 200 |
| 2 | 2333311 | 404 |
| 1 | helloshare | 200 |
| 2 | helloshare | 404 |
| 1 | $#@r3 | 200 |
| 2 | $#@r3 | 404 |
| 1 | 0 | 200 |
| 2 | 0 | 404 |
Scenario Outline: accept a share using empty share Id
Given using OCS API version "<ocs-api-version>"
When user "Brian" accepts share with ID "" using the sharing API
Then the HTTP status code should be "<http-status-code>"
Examples:
| ocs-api-version | http-status-code |
| 1 | 405 |
| 2 | 405 |
Scenario Outline: decline a share using the share Id
Given using OCS API version "<ocs-api-version>"
And user "Alice" has uploaded file with content "КуСфера test text file 0" to "/textfile0.txt"
And user "Alice" has sent the following resource share invitation:
| resource | textfile0.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | File Editor |
And user "Brian" has a share "textfile0.txt" synced
And using SharingNG
When user "Brian" declines share with ID "%last_share_id%" using the sharing API
Then the OCS status code should be "<ocs-status-code>"
And the HTTP status code should be "200"
And user "Brian" should not see the following elements
| /Shares/textfile0.txt |
And the sharing API should report to user "Brian" that these shares are in the declined state
| path |
| textfile0.txt |
Examples:
| ocs-api-version | ocs-status-code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: decline a share using empty share Id
Given using OCS API version "<ocs-api-version>"
When user "Brian" declines share with ID "" using the sharing API
Then the OCS status code should be "<ocs-status-code>"
And the HTTP status code should be "<http-status-code>"
And the API should not return any data
Examples:
| ocs-api-version | http-status-code | ocs-status-code |
| 1 | 200 | 998 |
| 2 | 404 | 998 |
@@ -0,0 +1,333 @@
@skipOnReva
Feature: sharing
As a user
I want to upload resources to a folder shared to me
So that other people can access the resource
Background:
Given user "Alice" has been created with default attributes
Scenario Outline: uploading file to a user read-only share folder does not work
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Brian" has a share "FOLDER" synced
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "403"
And as "Alice" file "/FOLDER/textfile.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: uploading file to a group read-only share folder does not work
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permissionsRole | Viewer |
And user "Brian" has a share "FOLDER" synced
And user "Brian" has a share "FOLDER" synced
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "403"
And as "Alice" file "/FOLDER/textfile.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: uploading file to a user upload-only share folder works
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Uploader |
And user "Brian" has a share "FOLDER" synced
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions for user "Brian"
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And the content of file "/FOLDER/textfile.txt" for user "Alice" should be:
"""
This is a testfile.
Cheers.
"""
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: uploading file to a group upload-only share folder works
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permissionsRole | Uploader |
And user "Brian" has a share "FOLDER" synced
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions for user "Brian"
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And the content of file "/FOLDER/textfile.txt" for user "Alice" should be:
"""
This is a testfile.
Cheers.
"""
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@smokeTest
Scenario Outline: uploading file to a user read/write share folder works
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "FOLDER" synced
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "/FOLDER/textfile.txt" for user "Alice" should be:
"""
This is a testfile.
Cheers.
"""
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: uploading file to a group read/write share folder works
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permissionsRole | Editor |
And user "Brian" has a share "FOLDER" synced
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "/FOLDER/textfile.txt" for user "Alice" should be:
"""
This is a testfile.
Cheers.
"""
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@smokeTest
Scenario Outline: check quota of owners parent directory of a shared file
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Admin" has changed the quota of the personal space of user "Brian" to "0"
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/myfile.txt"
And user "Alice" has sent the following resource share invitation:
| resource | myfile.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | File Editor |
And user "Brian" has a share "myfile.txt" synced
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/myfile.txt" using the WebDAV API
Then the HTTP status code should be "204"
And the following headers should match these regular expressions for user "Brian"
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And the content of file "/myfile.txt" for user "Alice" should be:
"""
This is a testfile.
Cheers.
"""
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: uploading to a user shared folder with read/write permission when the sharer has insufficient quota does not work
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has a share "FOLDER" synced
And user "Admin" has changed the quota of the personal space of user "Alice" to "1"
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/myfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/myfile.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: uploading to a group shared folder with read/write permission when the sharer has insufficient quota does not work
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permissionsRole | Editor |
And user "Brian" has a share "FOLDER" synced
And user "Admin" has changed the quota of the personal space of user "Alice" to "1"
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/myfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/myfile.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: uploading to a user shared folder with upload-only permission when the sharer has insufficient quota does not work
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Uploader |
And user "Brian" has a share "FOLDER" synced
And user "Admin" has changed the quota of the personal space of user "Alice" to "1"
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/myfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/myfile.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: uploading to a group shared folder with upload-only permission when the sharer has insufficient quota does not work
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permissionsRole | Uploader |
And user "Brian" has a share "FOLDER" synced
And user "Admin" has changed the quota of the personal space of user "Alice" to "1"
When user "Brian" uploads file "filesForUpload/textfile.txt" to "/Shares/FOLDER/myfile.txt" using the WebDAV API
Then the HTTP status code should be "507"
And as "Alice" file "/FOLDER/myfile.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: sharer can download file uploaded with different permission by sharee to a shared folder
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Alice" has created folder "FOLDER"
And user "Alice" has sent the following resource share invitation:
| resource | FOLDER |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
And user "Brian" has a share "FOLDER" synced
When user "Brian" uploads file with content "some content" to "/Shares/FOLDER/textFile.txt" using the WebDAV API
And user "Alice" downloads file "/FOLDER/textFile.txt" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded content should be "some content"
Examples:
| dav-path-version | permissions-role |
| old | Editor |
| old | Uploader |
| new | Editor |
| new | Uploader |
| spaces | Editor |
| spaces | Uploader |
Scenario Outline: upload an empty file (size zero byte) to a shared folder
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Brian" has created folder "/folder-to-share"
And user "Brian" has sent the following resource share invitation:
| resource | folder-to-share |
| space | Personal |
| sharee | Alice |
| shareType | user |
| permissionsRole | Editor |
And user "Alice" has a share "folder-to-share" synced
When user "Alice" uploads file "filesForUpload/zerobyte.txt" to "/Shares/folder-to-share/zerobyte.txt" using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "/Shares/folder-to-share/zerobyte.txt" should exist
And the content of file "/Shares/folder-to-share/zerobyte.txt" for user "Alice" should be ""
Examples:
| dav-path-version |
| old |
| new |
| spaces |