Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only][full-ci] Test coverage for federated user trying to delete deleted federation connection #11017

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/acceptance/bootstrap/OcmContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ public function theUserWaitsForTokenToExpire(int $number): void {

/**
* @When user :user deletes federated connection with user :ocmUser using the Graph API
* @When user :user tries to delete federated connection with user :ocmUser using the Graph API
*
* @param string $user
* @param string $ocmUser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,12 @@ The expected failures in this file are from features in the owncloud/ocis repo.

#### [OCM. federated connection is not dropped when one of the users deletes the connection](https://github.com/owncloud/ocis/issues/10216)

- [apiOcm/deleteFederatedConnections.feature:21](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/deleteFederatedConnections.feature#L21)
- [apiOcm/deleteFederatedConnections.feature:67](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/deleteFederatedConnections.feature#L67)
- [apiOcm/deleteFederatedConnections.feature:19](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/deleteFederatedConnections.feature#L19)
- [apiOcm/deleteFederatedConnections.feature:61](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/deleteFederatedConnections.feature#L61)

#### [OCM. server crash after deleting share for ocm user](https://github.com/owncloud/ocis/issues/10213)

- [apiOcm/deleteFederatedConnections.feature:102](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/deleteFederatedConnections.feature#L102)
- [apiOcm/deleteFederatedConnections.feature:92](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/deleteFederatedConnections.feature#L92)

#### [same href in REPORT request for all dav-path-version](https://github.com/owncloud/ocis/issues/7060)

Expand Down Expand Up @@ -332,5 +332,8 @@ The expected failures in this file are from features in the owncloud/ocis repo.
- [apiOcm/share.feature:1154](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1154)
- [apiOcm/share.feature:1174](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1174)

#### [OCM. delete-accepted-user endpoint always returns 200](https://github.com/owncloud/ocis/issues/10223)
- [apiOcm/deleteFederatedConnections.feature:123](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/deleteFederatedConnections.feature#L123)

Note: always have an empty line at the end of this file.
The bash script that processes this file requires that the last line has a newline on the end.
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,19 @@ Feature: delete federated connections

Background:
Given user "Alice" has been created with default attributes
And "Alice" has created the federation share invitation
And using server "REMOTE"
And user "Brian" has been created with default attributes
And "Brian" has accepted invitation


Scenario: federated user deletes the federated connection
Given using server "LOCAL"
And "Alice" has created the federation share invitation
And using server "REMOTE"
And "Brian" has accepted invitation
When user "Brian" deletes federated connection with user "Alice" using the Graph API
Then the HTTP status code should be "200"

@issue-10216
Scenario: users should not be able to find federated user after federated user has deleted connection
Given using server "LOCAL"
And "Alice" has created the federation share invitation
And using server "REMOTE"
And "Brian" has accepted invitation
And user "Brian" has deleted federated connection with user "Alice"
Given user "Brian" has deleted federated connection with user "Alice"
And using server "LOCAL"
When user "Alice" searches for federated user "Brian" using Graph API
Then the HTTP status code should be "200"
Expand Down Expand Up @@ -66,10 +60,6 @@ Feature: delete federated connections
@issue-10216
Scenario: federated user should not be able to find federated share after federated user has deleted connection
Given using server "LOCAL"
And "Alice" has created the federation share invitation
And using server "REMOTE"
And "Brian" has accepted invitation
And using server "LOCAL"
And user "Alice" has created folder "folderToShare"
And user "Alice" has sent the following resource share invitation to federated user:
| resource | folderToShare |
Expand Down Expand Up @@ -101,10 +91,6 @@ Feature: delete federated connections
@issue-10213
Scenario: federated user should not be able to find federated share after local user has deleted connection
Given using server "LOCAL"
And "Alice" has created the federation share invitation
And using server "REMOTE"
And "Brian" has accepted invitation
And using server "LOCAL"
And user "Alice" has created folder "folderToShare"
And user "Alice" has sent the following resource share invitation to federated user:
| resource | folderToShare |
Expand Down Expand Up @@ -132,3 +118,9 @@ Feature: delete federated connections
}
}
"""

@issue-10223
Scenario: federated user tries to delete previously deleted federated connection
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, try to test these behaviors if possible
#10223 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okeii.. I will make another follow-up PR. 👍

Given user "Brian" has deleted federated connection with user "Alice"
When user "Brian" tries to delete federated connection with user "Alice" using the Graph API
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would the behavior be same if Alice tries to delete the federated connection here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It gives 400 (Bad request) when Alice tries to delete the federated connection that has already been deleted by her. We can have test coverage for this scenario also. Will add in the follow-up PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to add in this PR, rather than follow-up

Then the HTTP status code should be "404"