Commit Graph

525 Commits

Author SHA1 Message Date
Morris Jobke de8c15e1a4 Merge pull request #14764 from owncloud/shared-etag-propagate
Propagate etags across shared storages
2015-04-28 10:58:50 +02:00
Thomas Müller 7d0eba7a41 Merge pull request #15886 from owncloud/fix-15848-master
Adjust isLocal() on encryption wrapper
2015-04-27 15:06:26 +02:00
Thomas Müller 678b7d7e4d Merge pull request #15860 from owncloud/enc_fallback_old_encryption
[encryption] handle encrypted files correctly which where encrypted with a old version of ownCloud (<=oc6)
2015-04-27 14:32:19 +02:00
Thomas Müller 936d564058 fixes #15848 2015-04-27 14:26:05 +02:00
Robin Appelman be55a90323 dont use our now non existing hook 2015-04-27 14:07:15 +02:00
Bjoern Schiessle 27683f9442 fall back to the ownCloud default encryption module and aes128 if we read a encrypted file without a header 2015-04-27 13:01:18 +02:00
Joas Schilling 8f61fbb81f Fix new tests 2015-04-27 11:10:31 +02:00
Bjoern Schiessle 9a5783b284 fix unit tests 2015-04-24 16:47:27 +02:00
jknockaert 4554df2512 enable testWriteWriteRead 2015-04-24 16:44:00 +02:00
jknockaert 18a1225b0c enable testRewind 2015-04-24 16:44:00 +02:00
jknockaert 27ea23ea6b Update encryption.php 2015-04-24 16:44:00 +02:00
jknockaert d6841aa706 disable r+ test 2015-04-24 16:44:00 +02:00
jknockaert 7a34f75da6 add two tests
testRewind tests reading and writing after rewind on an encrypted stream; testWriteWriteRead tests r+ mode
2015-04-24 16:44:00 +02:00
Joas Schilling 4334e77035 Merge pull request #15839 from owncloud/enc_fix_moving_shared_files
[encryption] fix moving files to a shared folder
2015-04-24 15:07:36 +02:00
Joas Schilling 411f7893bf Add test "operation on keys failed" 2015-04-24 14:27:23 +02:00
Joas Schilling 781cfff221 Deduplicate data provider and fix method visibility 2015-04-24 13:12:45 +02:00
Bjoern Schiessle 24128d1384 only update share keys if the file was encrypted 2015-04-24 10:19:09 +02:00
Bjoern Schiessle 2646bccb83 update share keys if file gets copied 2015-04-23 17:18:48 +02:00
Bjoern Schiessle 2990b0e07e update share keys if a file is moved to a shared folder 2015-04-23 17:18:48 +02:00
Vincent Petry b88d0ba0ac Delete temp files after testing encryption stream wrapper 2015-04-23 13:42:18 +02:00
Vincent Petry 903d52d45f Merge pull request #15809 from owncloud/view-null-root
dont allow using null as view root
2015-04-22 18:10:26 +02:00
Robin Appelman e302213248 add unit tests for null handling in view 2015-04-22 16:24:25 +02:00
Thomas Müller 225cde2183 pass KeyStorage via ctor 2015-04-22 13:09:42 +02:00
Thomas Müller 987bc138df calling renameKeys() on directory level as well - fixes #15778 2015-04-22 12:12:27 +02:00
Thomas Müller fc4127dd62 add $encryptionModuleId to methods of Keys/IStorage 2015-04-22 11:53:05 +02:00
Björn Schießle 570718fb6b Merge pull request #15757 from owncloud/enc-fixfeofforlastblock
Fix encryption feof to not return too early
2015-04-22 11:32:21 +02:00
Bjoern Schiessle 19e8c4fcb1 get dirname from sharePath 2015-04-21 14:58:01 +02:00
Vincent Petry 76dad297ff Fix encryption feof to not return too early
This is because stream_read will pre-cache the next block which causes
feof($this->source) to return true prematurely. So we cannot rely on it.

Fixed encryption stream wrapper unit tests to actually simulate 6k/8k
blocks to make sure we cover the matching logic.

Added two data files with 8192 and 8193 bytes.
2015-04-20 18:32:40 +02:00
Bjoern Schiessle b25c06f576 detect system wide mount points correctly 2015-04-16 14:15:04 +02:00
Björn Schießle 4f0437fbde Merge pull request #15598 from owncloud/fix-enc-file-size-master
Fix file size of encrypted files
2015-04-14 16:48:04 +02:00
Morris Jobke 82cab25762 Merge pull request #13360 from owncloud/cross-storage-move
Proper copy/move between multiple local storages
2015-04-14 14:35:08 +02:00
Thomas Müller cbe30f740e remove calculateUnencryptedSize() - not needed 2015-04-14 13:08:59 +02:00
Robin Appelman 01da6be4d6 upda tests 2015-04-13 17:10:02 +02:00
Robin Appelman d7b3a1a35a preserve cache data when doing a cross storage move 2015-04-13 17:10:01 +02:00
Robin Appelman 0772e3b4c1 Properly handle copy/move failures in cross storage copy/move 2015-04-13 15:13:03 +02:00
Robin Appelman 31e94708f8 Improve cross storage copy between local storages 2015-04-13 15:13:02 +02:00
Vincent Petry 2822d0579e Properly add trailing slash to mount point
Fixes resolving mount points when shared mount point's target name has
the same prefix as the source name
2015-04-13 12:36:47 +02:00
Jörn Friedrich Dreyer fafecd1c05 fix cherrypicking 2015-04-10 11:08:24 +02:00
Jörn Friedrich Dreyer a85bc5538f fix filesystem and encryption tests
Conflicts:
	apps/files_encryption/lib/util.php
	apps/files_encryption/tests/hooks.php
2015-04-10 09:12:37 +02:00
Thomas Müller 06a5a9d0c2 Fix mock object to return proper type 2015-04-09 18:30:45 +02:00
Thomas Müller 11c3741526 Fix mock object to return proper type 2015-04-09 17:45:57 +02:00
Vincent Petry f8cfc03f36 Replace originalStorage in tests with a proper teardown
The purpose of $originalStorage in unit tests was to remount the old
root.
However that storage itself is already wrapped by storage wrapper, so
remounting it would rewrap the storage several times.

This fix makes use of "loginAsUser()" and "logout()" from the TestCase
class to properly initialize and cleanup the FS as expected.
2015-04-08 12:45:38 +02:00
Thomas Müller 2d2cb09715 fixing unit test - expected value change due to different size being stored in cache table 2015-04-07 14:30:01 +02:00
Thomas Müller 268d346b36 fixing unit tests 2015-04-07 13:30:31 +02:00
Thomas Müller fce42a3161 fixing unit test execution - test dummy module was behaving wrong 2015-04-07 13:30:31 +02:00
Thomas Müller 870c53ee37 fixing unit test execution 2015-04-07 13:30:31 +02:00
Thomas Müller 3e3226da4c Properly set size and unencrypted size in the stream unit tests 2015-04-07 13:30:31 +02:00
Thomas Müller b3c5ef3afe Adding unit test for read and write of big file 2015-04-07 13:30:31 +02:00
Thomas Müller 104d11ec4c Fixing encryption storage wrapper tests 2015-04-07 13:30:30 +02:00
Thomas Müller e8e5bd61ae fixing unit tests for encryption stream wrapper seek 2015-04-07 13:30:30 +02:00
Thomas Müller 8ffa6db110 fixing unit tests for stream wrapper 2015-04-07 13:30:30 +02:00
Thomas Müller e0ab2c34ea update unit tests after ctor signature change of \OC\Encryption\Util 2015-04-07 13:30:28 +02:00
Thomas Müller 00338f9dca Removing files_encryption left overs 2015-04-07 13:30:28 +02:00
Bjoern Schiessle 0eee3a2618 remove unencrypted_size from the cache, size will contain the unencrypted size 2015-04-07 13:30:28 +02:00
Thomas Müller 498625ea3a adding unit tests for stream wrapper 2015-04-07 13:30:28 +02:00
Thomas Müller a905f641b3 various fixes & start to unit test the encryption storage wrapper 2015-04-07 13:30:28 +02:00
Vincent Petry 5c9998179f Properly quote file names in listFiles query for GDrive 2015-03-31 15:14:03 +02:00
Lukas Reschke 53f67fc65d Revert "Properly quote file names in listFiles query for GDrive" 2015-03-31 15:12:35 +02:00
Frank Karlitschek b216b3fad0 Merge pull request #15215 from owncloud/ext-gdrivelistfilequoting
Properly quote file names in listFiles query for GDrive
2015-03-31 09:08:59 -04:00
Thomas Müller 722e50a112 Merge pull request #15240 from owncloud/storage-wrapper-priority
add priority to storage wrappers
2015-03-27 15:18:44 +01:00
Robin Appelman cb9ead7dde add priority to storage wrappers 2015-03-26 21:26:38 +01:00
Vincent Petry 43588fe2f7 Properly quote file names in listFiles query for GDrive 2015-03-26 12:15:02 +01:00
Vincent Petry ec2d7cff2f SQLite autoincrement test 2015-03-25 18:33:21 +01:00
Robin Appelman d11f01fa0f Add `getNonExistingName()` to the node api 2015-03-24 15:00:36 +01:00
Robin Appelman 73874ca27f Merge pull request #14704 from owncloud/storage-wrapper-mount
pass mountpoint to storage wrapper callback
2015-03-19 16:20:38 +01:00
Joas Schilling f2f7f178a5 Add test for backticks in path and etag 2015-03-18 13:29:39 +01:00
Vincent Petry e50f13d46b Add positive test for path verification 2015-03-17 18:17:30 +01:00
Robin Appelman 7ab919256b fix test 2015-03-16 14:13:56 +01:00
Thomas Müller 80ef53eff0 verify the file name length not to exceed 255 characters + verify path during rename 2015-03-12 10:47:47 +01:00
Robin Appelman 169031d1c5 fix factory test 2015-03-11 15:07:59 +01:00
Robin Appelman e1f2a6df94 Allow setting the watcher policy as mount option 2015-03-11 15:07:23 +01:00
Robin Appelman 7adda88786 Copy mount options to the storage 2015-03-11 15:06:48 +01:00
Robin Appelman 82a62fd249 Add test for storage factory 2015-03-11 15:06:12 +01:00
Thomas Müller 3623f14e73 no translation service in common storage class 2015-03-09 10:38:38 +01:00
Thomas Müller 4bac595068 adding storage specific filename verification - refs #13640 2015-03-09 10:38:37 +01:00
Joas Schilling 294724b5da Add a test for ObjectStore\NoopScanner 2015-03-04 11:48:31 +01:00
Robin Appelman 89735ab22b add some tests for disabled updater 2015-02-27 17:14:17 +01:00
Robin Appelman fc027bceb7 Fix cache update when doing a rename that overwrites the target 2015-02-27 16:39:58 +01:00
Thomas Müller 7fe07e93fe Merge pull request #14437 from owncloud/node-check-fileinfo
Check if we have a proper fileinfo
2015-02-27 02:56:13 -08:00
Lukas Reschke 9baf758150 Merge pull request #14503 from owncloud/quota-preventdatalossforfailedmove
Fix file move/copy when storage space is not enough
2015-02-26 16:35:13 +01:00
Vincent Petry 232de3bdc0 Delete target file for unsuccessful copy/rename 2015-02-26 15:11:37 +01:00
Robin Appelman 541c8c092d Add unit test 2015-02-26 12:20:20 +01:00
Vincent Petry 20738d287e Properly detect streamCopy errors
Now checking whether the written bytes match the number of read bytes.
2015-02-25 16:03:15 +01:00
Joas Schilling 993d89b3cc Extend the class so the Filesystem is cleaned up 2015-02-25 16:03:10 +01:00
Lukas Reschke 41e5850450 Prevent directory traversals in ctr of \OC\Files\View
This prevents a misusage of \OC\Files\View by calling it with user-supplied input. In such cases an exception is now thrown.
2015-02-18 18:17:33 +01:00
Robin Appelman 6ecfcde954 update test 2015-02-13 15:01:05 +01:00
Robin Appelman 134243d3e5 Dont lower the mtime of a folder when propagating changes 2015-02-13 14:30:05 +01:00
Lukas Reschke 4d91fa4c93 Normalize before processing 2015-02-06 15:03:29 +01:00
Bjoern Schiessle 21c45925fe detect root of mountpoint also if the trailing slash is missed 2015-02-04 12:47:04 +01:00
Robin Appelman 2124540d1d Dont remove a file from cache if the delete operation failed 2015-01-29 15:39:56 +01:00
Robin Appelman ddee63fa00 Fix resolving paths for views rooted in a file 2015-01-29 12:47:11 +01:00
Robin Appelman cec43df0f0 Add unit test 2015-01-28 13:44:39 +01:00
Morris Jobke 752b94d363 Merge pull request #13717 from owncloud/storage-donotwrapnullstorage
Prevent wrapping null storage
2015-01-28 01:00:20 +01:00
Vincent Petry 6d8985b671 Prevent wrapping null storage
Can happen when trying to instantiate external storages that have
incomplete config, where the constructor throws an exception (the
exception is caught in createStorage())
2015-01-27 17:40:08 +01:00
Robin Appelman 87a1b2bdc4 Preserve mtime when doing cross storage move 2015-01-23 15:11:27 +01:00
Robin Appelman 0a3e0a1665 Additional unit test for recursive remove 2015-01-15 18:47:05 +01:00
Thomas Müller 337c43ce92 Merge pull request #13317 from owncloud/partfile-fileinfo
Return valid fileinfo objects for part files
2015-01-14 22:39:19 +01:00
Robin Appelman 96dff341e2 Return valid fileinfo objects for part files 2015-01-13 13:59:28 +01:00
Vincent Petry fcc3b3d5f7 Fix searchCommon to properly match path name
The internal path was matched without the last "/" which caused
"files_trashbin" to also match when the internal path was "files".

This adds the missing slash for the comparison.
2015-01-12 19:33:00 +01:00
Lukas Reschke 05615bfd47 Simplify isValidPath and add unit tests
The check for invalid paths is actually over-complicated and performed twice resulting in a performance penalty. Additionally, I decided to add unit-tests to that function.

Part of https://github.com/owncloud/core/issues/13221
2015-01-10 00:40:21 +01:00
Vincent Petry aa821ecc00 Trim leading or trailing slashes in file cache paths 2015-01-08 19:43:02 +01:00
Thomas Müller fe6f4a1404 Merge pull request #11810 from owncloud/hhvm-autotest
Adding autotest-hhvm.sh [WIP]
2014-12-22 14:12:03 +01:00
Andreas Fischer 48d6724a6f HHVM sets stream meta datum wrapper_type to 'File' instead of 'user-space'. 2014-12-19 00:58:37 +01:00
Robin Appelman fd85424742 Add getMountPoint to FileInfo 2014-12-17 14:03:50 +01:00
Vincent Petry 5007289422 Sort results to make sure assert work on consistent order 2014-12-15 11:32:32 +01:00
Vincent Petry 4b57892c4e Merge pull request #12778 from owncloud/searchbytags2
Added searchByTags to view, storage and cache
2014-12-12 14:27:19 +01:00
Vincent Petry 15ecb28d50 Make $userId mandatory for searchByTags
$userId is now a mandatory parameter for searchByTags.

Also fixed some places in the code where the argument was missing (Node
API and View)
2014-12-12 11:18:35 +01:00
Vincent Petry 25dde7e93b Added searchByTags to view, storage and cache 2014-12-11 17:38:50 +01:00
Thomas Müller 6143232da6 Merge pull request #12746 from owncloud/skip-longpath-test-again
skip testLongPath()
2014-12-10 17:22:04 +01:00
Vincent Petry ebba54d490 Fix numeric storage id for cache wrapper 2014-12-10 13:05:31 +01:00
Thomas Müller d648b548eb skip testLongPath() 2014-12-10 12:20:30 +01:00
Robin Appelman f4701d7721 Add public api for mount configurations 2014-12-04 16:47:27 +01:00
Morris Jobke f3213571bb Merge pull request #12616 from owncloud/node-fileinfo
make \OC\Files\Node\Node implement the FileInfo interface
2014-12-04 16:34:30 +01:00
Robin Appelman 672495a1a3 make \OC\Files\Node\Node implement the FileInfo interface 2014-12-04 13:27:08 +01:00
Morris Jobke 2c5e4b3d3f Remove last traces of travis integration 2014-12-04 10:09:13 +01:00
Joas Schilling ea4c25609d Replace uniqid calls with $this->getUniqueID so tests pass again on windows 2014-12-03 12:10:55 +01:00
Robin Appelman 33b64868d7 Add storage and cache wrappers to apply a permissions mask to a storage 2014-11-27 15:25:57 +01:00
Robin Appelman abb6e89c5d Add storage and cache wrappers to jail a storage to a subfolder 2014-11-27 15:25:53 +01:00
Joas Schilling 2c39aec8cb Replace deprecated constant with new class constant 2014-11-25 16:30:21 +01:00
Joas Schilling 76ebd3a050 Make apps/ extend the \Test\TestCase and fix overwritten methods 2014-11-19 14:52:09 +01:00
Joas Schilling bb540722cd Use base class to reset the file mapper 2014-11-19 14:52:07 +01:00
Lukas Reschke 8071657cd5 Merge pull request #12234 from owncloud/normalizepath-absolute-tests
Add tests for normalizePath() with absolute paths on windows
2014-11-18 10:24:46 +01:00
Joas Schilling ccc1001138 Add tests for absolute paths on windows 2014-11-17 16:59:11 +01:00
Joas Schilling 806284f06c Refactor tests to use a dataProvider method 2014-11-17 16:52:45 +01:00
Morris Jobke 146cb920c9 Merge pull request #12218 from owncloud/issue/10991-fixes
Issue/10991 Make unit tests pass on windows
2014-11-17 16:44:45 +01:00
Joas Schilling 6625d5c88f Correctly restore previous root mount point after testing 2014-11-17 10:48:19 +01:00
Joas Schilling 53318c4bb5 Fix Files\Storage\Home::testRoot() 2014-11-17 10:48:16 +01:00
Joas Schilling a3a064fe96 Skip some more tests on Windows which just can not work at all 2014-11-17 10:48:06 +01:00
Adam Williamson e0ae87051f storage test: use new file for testTouchCreateFile()
this test would never succeed, because the previous test -
testFOpen() - creates the file 'foo', but testTouchCreateFile()
starts out by asserting it doesn't exist. Change the test to
use a file called 'touch' instead (which does not previously
exist).
2014-11-10 17:49:35 -08:00
Robin Appelman d26a427f92 Also propagate etag changes when the watcher finds a changed file 2014-11-07 12:56:09 +01:00
Vincent Petry 106b9eb55c Merge pull request #11409 from owncloud/watcher-reuse
Pass the cached data to the filesystem watcher
2014-10-29 16:38:16 +01:00
Thomas Müller d0ce600eec On Windows platform we have no stable etag generation - yet 2014-10-27 20:48:47 +01:00
Robin Appelman 283c10f010 Generate stable etags for local files 2014-10-24 16:47:58 +02:00
Robin Appelman 16cfca6a5f Better reuse of cache data for getFolderContents 2014-10-24 12:33:54 +02:00
Thomas Müller 770f643e5c Merge pull request #11259 from owncloud/fix-windows-max-depth-test
fixing windows max depth test
2014-10-23 14:34:39 +02:00
Jörn Friedrich Dreyer 27bb968ffa make some storage tests explain what went wrong 2014-10-08 18:49:52 +02:00
Clark Tomlinson 6de8531ace fixing windows max depth test 2014-09-30 16:04:49 -04:00
Clark Tomlinson 55d56f2f0f Resolves cache tests failing if the directory length is longer than 64 2014-09-17 16:24:43 -04:00
Robin Appelman 0878f722db Fix contructor in test 2014-09-10 17:59:32 +02:00
Lukas Reschke c3d90b96c8 Merge pull request #10922 from owncloud/explicit-scan-transactions
Use bigger transactions when doing explicit file system scans
2014-09-09 23:32:32 +02:00
Jörn Friedrich Dreyer ed2414fd0d Merge pull request #10886 from owncloud/keep_fileid_on_move_in_objectstore
Keep fileid on move in objectstore, fixes #10848
2014-09-09 10:25:10 +02:00
Jörn Friedrich Dreyer 5943b7ac0d w͢͢͝h͡o͢͡ ̸͢k̵͟n̴͘ǫw̸̛s͘ ̀́w͘͢ḩ̵a҉̡͢t ̧̕h́o̵r͏̵rors̡ ̶͡͠lį̶e͟͟ ̶͝in͢ ͏t̕h̷̡͟e ͟͟d̛a͜r̕͡k̢̨ ͡h̴e͏a̷̢̡rt́͏ ̴̷͠ò̵̶f̸ u̧͘ní̛͜c͢͏o̷͏d̸͢e̡͝ 2014-09-08 15:26:41 +02:00
Robin Appelman 644755df66 Use bigger transactions when doing explicit file system scans 2014-09-08 14:15:41 +02:00
Jörn Friedrich Dreyer c362c78d76 make objectstore tests check fileid on rename 2014-09-08 12:53:52 +02:00
Robin Appelman 58a1540587 remove unstable test 2014-09-05 11:53:24 +02:00
Robin Appelman 3d92f963f4 Fix unit test 2014-09-05 11:53:23 +02:00
Robin Appelman 65d24c3cd5 Improve unit tests for Cache\Updater 2014-09-05 11:53:23 +02:00
Robin Appelman 850542c5d6 Refactor Cache\Updater to work outside of the users home 2014-09-05 11:53:23 +02:00
Vincent Petry d261ca616b Merge pull request #10244 from owncloud/utf8-folder-test
add utf8 folder test
2014-09-04 13:42:17 +02:00
Joas Schilling 6a7be8a36a Use a data provider instead of calling the function manually everytime 2014-08-25 15:06:09 +02:00