diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-08-31 11:43:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-31 11:43:17 +0200 |
commit | fc242e38484b093541475b7a3fe942869b07af2f (patch) | |
tree | 8c6610bcc945b4d4caa25d22402d17c4c37a5a1d | |
parent | aa90e69b660be2382848792811ff7a859769da88 (diff) | |
parent | 84c742b95e338ebd61e8c4b829cf61913ad386dc (diff) | |
download | nextcloud-server-fc242e38484b093541475b7a3fe942869b07af2f.tar.gz nextcloud-server-fc242e38484b093541475b7a3fe942869b07af2f.zip |
Merge pull request #1196 from nextcloud/oc-integration_tests_local_external_storage
Integration test on a local storage
-rw-r--r-- | build/integration/features/bootstrap/BasicStructure.php | 24 | ||||
-rw-r--r-- | build/integration/features/external-storage.feature | 26 | ||||
-rw-r--r-- | build/integration/features/provisioning-v1.feature | 13 | ||||
-rwxr-xr-x | build/integration/run.sh | 15 |
4 files changed, 72 insertions, 6 deletions
diff --git a/build/integration/features/bootstrap/BasicStructure.php b/build/integration/features/bootstrap/BasicStructure.php index e9e20c047aa..e6da74601ba 100644 --- a/build/integration/features/bootstrap/BasicStructure.php +++ b/build/integration/features/bootstrap/BasicStructure.php @@ -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); + } + } } diff --git a/build/integration/features/external-storage.feature b/build/integration/features/external-storage.feature new file mode 100644 index 00000000000..9e53b01346e --- /dev/null +++ b/build/integration/features/external-storage.feature @@ -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 | + + diff --git a/build/integration/features/provisioning-v1.feature b/build/integration/features/provisioning-v1.feature index 38ed5213b19..785b795bf35 100644 --- a/build/integration/features/provisioning-v1.feature +++ b/build/integration/features/provisioning-v1.feature @@ -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" diff --git a/build/integration/run.sh b/build/integration/run.sh index eccb378eec4..cf42ed75e4c 100755 --- a/build/integration/run.sh +++ b/build/integration/run.sh @@ -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 |