Skip to content

Commit

Permalink
Merge pull request #37012 from owncloud/removeAllForLocalStorageMount
Browse files Browse the repository at this point in the history
[Tests-Only] Add acceptance test to remove all for local storage mount
  • Loading branch information
phil-davis committed Feb 25, 2020
2 parents b5473dd + f80017e commit 926c308
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/acceptance/features/bootstrap/OccContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,25 @@ public function theAdminAddsRemovesAsTheApplicableUserForMountUsingTheOccCommand
);
}

/**
* @When the administrator removes all from the applicable users and groups for local storage mount :localStorage using the occ command
*
* @param string $localStorage
*
* @return void
* @throws \Exception
*/
public function theAdminRemovesAllForTheMountUsingOccCommand($localStorage) {
$mountId = $this->featureContext->getStorageId($localStorage);
$this->featureContext->runOcc(
[
'files_external:applicable',
$mountId,
"--remove-all"
]
);
}

/**
* @Given /^the administrator has (added|removed) (user|group) "([^"]*)" (?:as|from) the applicable (?:user|group) for local storage mount "([^"]*)"$/
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,25 @@ Feature: create local storage from the command line
And the content of file "/local_storage2/file-in-local-storage2.txt" for user "user0" should be "this is a file of user0"
And as "user1" folder "/local_storage2" should exist
And the content of file "/local_storage2/file-in-local-storage2.txt" for user "user1" should be "this is a file in local storage2"

Scenario: users should get access if all the users and groups are removed from the applicable groups
And these users have been created with default attributes and skeleton files:
| username |
| user2 |
| user3 |
And these groups have been created:
| groupname |
| grp1 |
| grp2 |
And user "user1" has been added to group "grp1"
And user "user2" has been added to group "grp2"
And the administrator has created the local storage mount "local_storage2"
And the administrator has uploaded file with content "this is a file in local storage2" to "/local_storage2/file-in-local-storage2.txt"
And the administrator has added group "grp1" as the applicable group for local storage mount "local_storage2"
And the administrator has added group "grp2" as the applicable group for local storage mount "local_storage2"
And the administrator has added user "user3" as the applicable user for local storage mount "local_storage2"
When the administrator removes all from the applicable users and groups for local storage mount "local_storage2" using the occ command
Then as "user0" folder "/local_storage2" should exist
And as "user1" folder "/local_storage2" should exist
And as "user2" folder "/local_storage2" should exist
And as "user3" folder "/local_storage2" should exist

0 comments on commit 926c308

Please sign in to comment.