Skip to content

Commit

Permalink
delete re-sharing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ScharfViktor committed Mar 20, 2024
1 parent c4abc81 commit b761f0c
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 1,002 deletions.
6 changes: 4 additions & 2 deletions tests/TestHelpers/SharingHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SharingHelper {
'update' => 2,
'create' => 4,
'delete' => 8,
'share' => 16,
// 'share' => 16,
'invite' => 0
];

Expand Down Expand Up @@ -123,7 +123,9 @@ public static function createShare(

if ($permissions !== null) {
$fd['permissions'] = self::getPermissionSum($permissions);
}
} else {
$fd['permissions'] = 1;
}

if (!\in_array($ocsApiVersion, [1, 2], true)) {
throw new InvalidArgumentException(
Expand Down
20 changes: 0 additions & 20 deletions tests/acceptance/config/behat-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,26 +145,6 @@ default:
- WebDavPropertiesContext:
- OcisConfigContext:

coreApiShareReshareToShares1:
paths:
- "%paths.base%/../features/coreApiShareReshareToShares1"
context: *common_ldap_suite_context
contexts:
- FeatureContext: *common_feature_context_params
- PublicWebDavContext:
- TrashbinContext:
- WebDavPropertiesContext:

coreApiShareReshareToShares2:
paths:
- "%paths.base%/../features/coreApiShareReshareToShares2"
context: *common_ldap_suite_context
contexts:
- FeatureContext: *common_feature_context_params
- PublicWebDavContext:
- TrashbinContext:
- WebDavPropertiesContext:

coreApiShareUpdateToShares:
paths:
- "%paths.base%/../features/coreApiShareUpdateToShares"
Expand Down
12 changes: 0 additions & 12 deletions tests/acceptance/expected-failures-API-on-OCIS-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,6 @@ cannot share a folder with create permission
- [coreApiTrashbin/trashbinSharingToShares.feature:201](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiTrashbin/trashbinSharingToShares.feature#L201)
- [coreApiTrashbin/trashbinSharingToShares.feature:224](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiTrashbin/trashbinSharingToShares.feature#L224)

#### [Expiration date for shares is not implemented](https://github.com/owncloud/ocis/issues/1250)

#### Expiration date of user shares

- [coreApiShareReshareToShares2/reShareWithExpiryDate.feature:33](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares2/reShareWithExpiryDate.feature#L33)
- [coreApiShareReshareToShares2/reShareWithExpiryDate.feature:34](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares2/reShareWithExpiryDate.feature#L34)

#### Expiration date of group shares

- [coreApiShareReshareToShares2/reShareWithExpiryDate.feature:56](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares2/reShareWithExpiryDate.feature#L56)
- [coreApiShareReshareToShares2/reShareWithExpiryDate.feature:57](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares2/reShareWithExpiryDate.feature#L57)

#### [Cannot move folder/file from one received share to another](https://github.com/owncloud/ocis/issues/2442)

- [coreApiShareUpdateToShares/updateShare.feature:124](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareUpdateToShares/updateShare.feature#L124)
Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance/features/apiContract/sharesReport.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Feature: REPORT request to Shares space
And user "Alice" has created folder "/folderMain"
And user "Alice" has created folder "/folderMain/SubFolder1"
And user "Alice" has created folder "/folderMain/SubFolder1/subFOLDER2"
And user "Alice" has shared entry "/folderMain" with user "Brian" with permissions "17"
And user "Alice" has shared entry "/folderMain" with user "Brian" with permissions "1"


Scenario Outline: check the REPORT response of the found folder
Expand Down Expand Up @@ -60,7 +60,7 @@ Feature: REPORT request to Shares space
Given user "Brian" has disabled auto-accepting
And using <dav-path-version> DAV path
And user "Alice" has created folder "/folderToBrian"
And user "Alice" has shared entry "/folderToBrian" with user "Brian" with permissions "17"
And user "Alice" has shared entry "/folderToBrian" with user "Brian" with permissions "1"
When user "Brian" searches for "folderToBrian" using the WebDAV API
Then the HTTP status code should be "207"
And the following headers should match these regular expressions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ Feature: Notification

Scenario Outline: get a notification about a file share in various languages
Given user "Brian" has switched the system language to "<language>" using the <api> API
And user "Alice" has shared entry "textfile1.txt" with user "Brian" with permissions "17"
And user "Alice" has shared entry "textfile1.txt" with user "Brian"
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "<subject>" and the message-details should match
Expand Down Expand Up @@ -272,7 +272,7 @@ Feature: Notification
@env-config
Scenario: get a notification about a file share in default languages
Given the config "OCIS_DEFAULT_LANGUAGE" has been set to "de"
And user "Alice" has shared entry "textfile1.txt" with user "Brian" with permissions "17"
And user "Alice" has shared entry "textfile1.txt" with user "Brian"
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "Neue Freigabe" and the message-details should match
Expand Down
57 changes: 0 additions & 57 deletions tests/acceptance/features/apiReshare/disableReshare.feature

This file was deleted.

165 changes: 62 additions & 103 deletions tests/acceptance/features/apiReshare/resharing.feature
Original file line number Diff line number Diff line change
@@ -1,120 +1,79 @@
Feature: Resharing
Feature: re-share resources
As a user
I want to reshare resources
So that other users can have access to them

Note - this feature is run in CI with ACCOUNTS_HASH_DIFFICULTY set to the default for production
See https://github.com/owncloud/ocis/issues/1542 and https://github.com/owncloud/ocis/pull/839
I cannot to re-share resources
This feature has been removed from ocis

Background:
Given these users have been created with default attributes and without skeleton files:
| username |
| Alice |
| Brian |
| Carol |
| Damian |
| Ember |
| Fred |
| Gina |
And user "Alice" has created folder "folder"
And user "Alice" has shared folder "folder" with user "Brian" with permissions "31"
And user "Brian" has shared folder "Shares/folder" with user "Carol" with permissions "31"
And user "Carol" has shared folder "Shares/folder" with user "Damian" with permissions "17"
And user "Alice" has created folder "test"


Scenario Outline: user should only be able to see direct outgoing shares not all the chain
Given user "Brian" has shared folder "Shares/folder" with user "Fred" with permissions "17"
When user "<user>" gets all the shares inside the folder "Shares/folder" using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And the response should contain <visible-shares-no> entries
And user "Brian" should not be included in the response
And user "Carol" <carol-visible> included in the response
And user "Damian" <damian-visible> included in the response
And user "Fred" <fred-visible> included in the response
Scenario Outline: share folder with different roles
Given using <dav-path-version> DAV path
When user "Alice" creates a share inside of space "Personal" with settings:
| path | test |
| shareWith | Brian |
| role | <role> |
Then the HTTP status code should be "200"
And the OCS status code should be "200"
And the fields of the last response to user "Alice" sharing with user "Brian" should include
| permissions | <expected-permissions> |
Examples:
| user | visible-shares-no | carol-visible | damian-visible | fred-visible |
| Brian | 2 | should be | should not be | should be |
| Carol | 1 | should not be | should be | should not be |
| Damian | 0 | should not be | should not be | should not be |
| Fred | 0 | should not be | should not be | should not be |


Scenario: owners can see all the chain
When user "Alice" gets all the shares inside the folder "folder" using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And the response should contain 3 entries
And user "Brian" should be included in the response
And user "Carol" should be included in the response
And user "Damian" should be included in the response
| dav-path-version | role | expected-permissions |
| old | editor | 15 |
| old | viewer | 1 |
| new | editor | 15 |
| new | viewer | 1 |
| spaces | editor | 15 |
| spaces | viewer | 1 |

@skipOnRevaMaster
Scenario: user can't share with more permissions than they have
When user "Damian" shares folder "Shares/folder" with user "Ember" with permissions "31" using the sharing API
Then the OCS status code should be "403"
And the OCS status message should be "Cannot set the requested share permissions"


Scenario Outline: editing reshares
Given user "Carol" has shared folder "Shares/folder" with user "Fred" with permissions "17"
When user "<user>" updates the last share using the sharing API with
| permissions | 31 |
Then the OCS status code should be "<ocs-status-code>"
And user "Fred" <can-upload> able to upload file "filesForUpload/textfile.txt" to "/Shares/folder/textfile.txt"
Examples:
| user | ocs-status-code | can-upload |
| Alice | 100 | should be |
| Brian | 998 | should not be |
| Carol | 100 | should be |


Scenario Outline: deleting reshares
Given user "Carol" has shared folder "Shares/folder" with user "Gina" with permissions "17"
When user "<user>" deletes the last share using the sharing API
Then the OCS status code should be "<ocs-status-code>"
And as "Gina" folder "Shares/folder" <exists>
And as "Carol" folder "Shares/folder" should exist
Examples:
| user | ocs-status-code | exists |
| Alice | 100 | should not exist |
| Brian | 998 | should exist |
| Carol | 100 | should not exist |

@skipOnRevaMaster
Scenario Outline: resharing folder with different permissions
When user "<user>" shares folder "Shares/folder" with user "Ember" with permissions "<sharee-permissions>" using the sharing API
Then the OCS status code should be "<ocs-status-code>"
Examples:
| user | sharee-permissions | ocs-status-code |
| Brian | 17 | 100 |
| Carol | 31 | 100 |
| Damian | 17 | 100 |
| Damian | 27 | 403 |
| Damian | 31 | 403 |

@skipOnRevaMaster
Scenario Outline: Resharing files with different permissions
Given user "Alice" has uploaded file with content "Random data" to "/file.txt"
And user "Alice" has shared file "/file.txt" with user "Brian" with permissions "<sharee-permissions>"
When user "Brian" shares file "Shares/file.txt" with user "Fred" with permissions "<grantee-permissions>" using the sharing API
Then the OCS status code should be "<ocs-status-code>"
Scenario Outline: try to re-share folder
Given using <dav-path-version> DAV path
And user "Alice" has created a share inside of space "Personal" with settings:
| path | test |
| shareWith | Brian |
| role | <role> |
When user "Brian" creates a share inside of space "Shares" with settings:
| path | test |
| shareWith | Carol |
| role | <role> |
Then the HTTP status code should be "403"
And the OCS status code should be "403"
And the OCS status message should be "No share permission"
Examples:
| sharee-permissions | grantee-permissions | ocs-status-code |
| 17 | 17 | 100 |
| 17 | 19 | 403 |
| 19 | 19 | 100 |
| dav-path-version | role |
| old | editor |
| old | viewer |
| new | editor |
| new | viewer |
| spaces | editor |
| spaces | viewer |


Scenario Outline: resharing with group with different permissions
Given group "security department" has been created
And the administrator has added a user "Ember" to the group "security department" using the Graph API
And the administrator has added a user "Fred" to the group "security department" using the Graph API
When user "Brian" shares folder "Shares/folder" with group "security department" with permissions "<sharee-permissions>" using the sharing API
Then the OCS status code should be "100"
And user "Ember" <can-upload> able to upload file "filesForUpload/textfile.txt" to "/Shares/folder/textfile.txt"
And user "Fred" <can-upload> able to upload file "filesForUpload/textfile.txt" to "/Shares/folder/textfile.txt"
Scenario Outline: try to re-share file
Given user "Alice" has uploaded file with content "other data" to "/textfile1.txt"
Given using <dav-path-version> DAV path
And user "Alice" has created a share inside of space "Personal" with settings:
| path | textfile1.txt |
| shareWith | Brian |
| role | <role> |
When user "Brian" creates a share inside of space "Shares" with settings:
| path | textfile1.txt |
| shareWith | Carol |
| role | <role> |
Then the HTTP status code should be "403"
And the OCS status code should be "403"
And the OCS status message should be "No share permission"
Examples:
| sharee-permissions | can-upload |
| 17 | should not be |
| 31 | should be |
| dav-path-version | role |
| old | editor |
| old | viewer |
| new | editor |
| new | viewer |
| spaces | editor |
| spaces | viewer |
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Feature: share resources where the sharee receives the share in multiple ways
| file_target | /zzzfolder |
| item_type | folder |
| permissions | read,delete |
When user "Carol" shares folder "zzzfolder" with user "Alice" with permissions "read,share" using the sharing API
When user "Carol" shares folder "zzzfolder" with user "Alice" with permissions "read" using the sharing API
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And as "Alice" the info about the last share by user "Carol" with user "Alice" should include
Expand Down
Loading

0 comments on commit b761f0c

Please sign in to comment.