Merge pull request #1196 from nextcloud/oc-integration_tests_local_external_storage
Integration test on a local storage
This commit is contained in:
commit
fc242e3848
4 changed files with 72 additions and 6 deletions
|
@ -344,4 +344,28 @@ trait BasicStructure {
|
|||
rmdir("../../core/skeleton/PARENT");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @BeforeScenario @local_storage
|
||||
*/
|
||||
public static function removeFilesFromLocalStorageBefore(){
|
||||
$dir = "./work/local_storage/";
|
||||
$di = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS);
|
||||
$ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST);
|
||||
foreach ( $ri as $file ) {
|
||||
$file->isDir() ? rmdir($file) : unlink($file);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @AfterScenario @local_storage
|
||||
*/
|
||||
public static function removeFilesFromLocalStorageAfter(){
|
||||
$dir = "./work/local_storage/";
|
||||
$di = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS);
|
||||
$ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST);
|
||||
foreach ( $ri as $file ) {
|
||||
$file->isDir() ? rmdir($file) : unlink($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
26
build/integration/features/external-storage.feature
Normal file
26
build/integration/features/external-storage.feature
Normal file
|
@ -0,0 +1,26 @@
|
|||
Feature: external-storage
|
||||
Background:
|
||||
Given using api version "1"
|
||||
Given using dav path "remote.php/webdav"
|
||||
|
||||
@local_storage
|
||||
Scenario: Share by link a file inside a local external storage
|
||||
Given user "user0" exists
|
||||
And user "user1" exists
|
||||
And As an "user0"
|
||||
And user "user0" created a folder "/local_storage/foo"
|
||||
And User "user0" moved file "/textfile0.txt" to "/local_storage/foo/textfile0.txt"
|
||||
And folder "/local_storage/foo" of user "user0" is shared with user "user1"
|
||||
And As an "user1"
|
||||
When creating a share with
|
||||
| path | foo |
|
||||
| shareType | 3 |
|
||||
Then the OCS status code should be "100"
|
||||
And the HTTP status code should be "200"
|
||||
And Share fields of last share match with
|
||||
| id | A_NUMBER |
|
||||
| url | AN_URL |
|
||||
| token | A_TOKEN |
|
||||
| mimetype | httpd/unix-directory |
|
||||
|
||||
|
|
@ -295,6 +295,7 @@ Feature: provisioning
|
|||
| theming |
|
||||
| updatenotification |
|
||||
| workflowengine |
|
||||
| files_external |
|
||||
|
||||
Scenario: get app info
|
||||
Given As an "admin"
|
||||
|
@ -304,19 +305,19 @@ Feature: provisioning
|
|||
|
||||
Scenario: enable an app
|
||||
Given As an "admin"
|
||||
And app "files_external" is disabled
|
||||
When sending "POST" to "/cloud/apps/files_external"
|
||||
And app "testing" is disabled
|
||||
When sending "POST" to "/cloud/apps/testing"
|
||||
Then the OCS status code should be "100"
|
||||
And the HTTP status code should be "200"
|
||||
And app "files_external" is enabled
|
||||
And app "testing" is enabled
|
||||
|
||||
Scenario: disable an app
|
||||
Given As an "admin"
|
||||
And app "files_external" is enabled
|
||||
When sending "DELETE" to "/cloud/apps/files_external"
|
||||
And app "testing" is enabled
|
||||
When sending "DELETE" to "/cloud/apps/testing"
|
||||
Then the OCS status code should be "100"
|
||||
And the HTTP status code should be "200"
|
||||
And app "files_external" is disabled
|
||||
And app "testing" is disabled
|
||||
|
||||
Scenario: disable an user
|
||||
Given As an "admin"
|
||||
|
|
|
@ -36,12 +36,27 @@ echo $PHPPID_FED
|
|||
export TEST_SERVER_URL="http://localhost:$PORT/ocs/"
|
||||
export TEST_SERVER_FED_URL="http://localhost:$PORT_FED/ocs/"
|
||||
|
||||
#Enable external storage app
|
||||
../../occ app:enable files_external
|
||||
|
||||
mkdir -p work/local_storage
|
||||
OUTPUT_CREATE_STORAGE=`../../occ files_external:create local_storage local null::null -c datadir=./build/integration/work/local_storage`
|
||||
|
||||
ID_STORAGE=`echo $OUTPUT_CREATE_STORAGE | awk {'print $5'}`
|
||||
|
||||
../../occ files_external:option $ID_STORAGE enable_sharing true
|
||||
|
||||
vendor/bin/behat -f junit -f pretty $SCENARIO_TO_RUN
|
||||
RESULT=$?
|
||||
|
||||
kill $PHPPID
|
||||
kill $PHPPID_FED
|
||||
|
||||
../../occ files_external:delete -y $ID_STORAGE
|
||||
|
||||
#Disable external storage app
|
||||
../../occ app:disable files_external
|
||||
|
||||
if [ -z $HIDE_OC_LOGS ]; then
|
||||
tail "../../data/nextcloud.log"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue