From c51f7cdcdbf499aec9c8313603cdd6c3cdd738cc Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Fri, 25 Mar 2022 16:17:15 +0545 Subject: [PATCH] details and examples for spaces tests --- docs/ocis/development/beta-testplan.md | 76 ++++++++++++++++++++------ 1 file changed, 58 insertions(+), 18 deletions(-) diff --git a/docs/ocis/development/beta-testplan.md b/docs/ocis/development/beta-testplan.md index ab92ceb75f..1ff8f09416 100644 --- a/docs/ocis/development/beta-testplan.md +++ b/docs/ocis/development/beta-testplan.md @@ -77,23 +77,62 @@ documentations resources: ## Spaces Prerequisite: +- variable declaration, for curl examples: +```shell +SERVER_URI=https://localhost:9200 +GRAPH_API_PATH=graph/v1.0 +SHARE_API_PATH=ocs/v2.php/apps/files_sharing/api/v1/shares +USER=admin +PASSWORD=admin +``` - create a new user TODO curl commands -- give the user the "Admin" role TODO curl commands +- give the user the "Admin" role + 1. get the id of the admin role `curl -k -u $USER:$PASSWORD $SERVER_URI/api/v0/settings/roles-list -d"{}" | jq '.bundles[] | select (.name | test("admin")) | .id'` + 2. get the id of the user: `curl -k -u $USER:$PASSWORD $SERVER_URI/api/v0/accounts/accounts-list -d"{}" | jq '.accounts[] | select (.preferredName | test("")) | .id'` + 3. assign role user to role: `curl -k -u $USER:$PASSWORD $SERVER_URI/api/v0/settings/assignments-add -d'{"account_uuid":"","role_id":""}` +- create a space: `curl -k -u $USER:$PASSWORD "$SERVER_URI/$GRAPH_API_PATH/drives" -X POST -d'{"Name":"Space for finance","driveType":"project", "description":"we need some space"}'` +- list spaces: `curl -k -u $USER:$PASSWORD $SERVER_URI/$GRAPH_API_PATH/me/drives` +- disable a space: `curl -k -u $USER:$PASSWORD $SERVER_URI/$GRAPH_API_PATH/drives/ -X DELETE` +- delete a space: `curl -k -u $USER:$PASSWORD $SERVER_URI/$GRAPH_API_PATH/drives/ -X DELETE -H'Purge: T'` +- restore a space: `curl -k -u $USER:$PASSWORD $SERVER_URI/$GRAPH_API_PATH/drives/ -X PATCH -d"{}" -H"Restore: true"` +- share a space: `curl -k -u $USER:$PASSWORD $SERVER_URI/$SHARE_API_PATH -d'space_ref=&shareType=7&shareWith=&role='` + - Roles: + - viewer + - editor + - manager +- share a resource within a space `curl -k -u $USER:$PASSWORD $SERVER_URI/$SHARE_API_PATH -d'shareType=0&shareWith=&space_ref=%2F&permissions=` + - possible permissions + - 1 = read + - 2 = update + - 4 = create + - 8 = delete + - 15 = read/write + - 16 = share + - 31 = All permissions +- WebDAV + - root: `https:///dav/spaces/` + - [example commands for operations](#webdav) + +| Test Case | Expected Result | Example / Comment | +|---------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|-------------------| +| create a space | space should exist | | +| create a space with special characters as a name & description | space should exist | | +| create a space, delete the space | space should not exist | | +| create a space, share the space with a user | space should be accessible | | +| create a space, share the space with a group | space should be accessible, space content is shared among all users | | +| create a space, share the space with a group, disable the space | space should not be accessible | | +| create a space, share the space with a user, disable the space, restore the space | space should be accessible | | +| create a space, disable the space, delete the space, restore the space | it should not be possible to restore the space | | +| create a space, disable the space, try to share the space | sharing the space should not be possible | | +| create a space, try delete the space | it should not be possible to delete an enabled space | | +| create & share a space with a group with viewer role, do CRUD file/folder operations with WebDAV | space content is readable but neither space not content should not be writable | | +| create & share a space with a group with editor role, do CRUD file/folder operations with WebDAV | space and content should be writable | | +| create a space, try CRUD file/folder operations with WebDAV on the space with a user that its not shared with | space and content should not be accessible | | +| create a space with a quota, share the space, upload files till the quota is exceeded | upload should work till quota is full, uploads should not work when quota is full | | +| share file/folders from inside a space (see other sharing section) | sharing works and obeys the permissions | | +| try the various space operations with invalid data | good error output, server does not crash | | +| try the various space operations without the correct permissions | operations are not possible without sufficient permissions | | -| Test Case | Expected Result | Example / Comment | -|---------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------| -| create a space | space should exist | TODO curl commands | -| create a space with special characters as a name & description | space should exist | TODO curl commands / **what are valid characters for space name/ description?** | -| create a space, delete the space | space should not exist | TODO curl commands | -| create a space, share the space with a user | space should be accessible | TODO curl commands | -| create a space, share the space with a group | space should be accessible, space content is shared among all users | TODO curl commands | -| create a space, share the space with a group, disable the space | space should not be accessible | TODO curl commands | -| create a space, disable the space, try to share the space | sharing the space should not be possible | TODO curl commands | -| create & share a space with a group with viewer role, do CRUD file/folder operations | space content is readable but neither space not content should not be writable | TODO curl commands | -| create & share a space with a group with editor role, do CRUD file/folder operations | space and content should be writable | TODO curl commands | -| create a space, try CRUD file/folder operations on the space with a user that its not shared with | space and content should not be accessible | TODO curl commands | -| create a space with a quota, share the space, upload files till the quota is exceeded | upload should work till quota is full, uploads should not work when quota is full | TODO curl commands | -| share file/folders from inside a space (see other sharing section) | | | ## Web @@ -183,9 +222,10 @@ Prerequisite: # Tips for testing ## WebDav -WebDav is accessible under two different path -- https://\/remote.php/webdav -- https://\/remote.php/dav/files/\ +WebDav is accessible under different path +- old: https://\/remote.php/webdav +- new: https://\/remote.php/dav/files/\ +- spaces: https://\/dav/spaces/\ WebDav specifications can be found on http://webdav.org/