Commit Graph

1111 Commits

Author SHA1 Message Date
Florian Mounier
c95437367f This is very important 2016-08-12 15:05:05 +02:00
Florian Mounier
416f9ddef1 Add an upload_all method for subsequent optimizations. 2016-08-12 14:58:32 +02:00
Guillaume Ayoub
8d863e52b2 Re-enable properties storage on al collections
Fix #475.
2016-08-11 12:07:19 +02:00
Guillaume Ayoub
d3d29802ad Merge pull request #474 from Unrud/patch-31
PROPFIND rights checking
2016-08-11 11:44:43 +02:00
Guillaume Ayoub
e66a35e996 Merge pull request #476 from Unrud/closelockfile
Add option to close lock file
2016-08-11 11:43:40 +02:00
Guillaume Ayoub
f395e256ff Merge pull request #478 from Unrud/patch-33
Correctly write line endings to files
2016-08-11 11:43:18 +02:00
Guillaume Ayoub
f6ebccec57 Merge pull request #477 from Unrud/patch-32
Remove etags from raw data
2016-08-11 11:41:47 +02:00
Unrud
9e84b459ae Correctly write line endings to files
vobject uses \r\n as line endings. Writing this to a file is not a problem on Linux and newer versions of MacOS. On Windows \r\r\n gets written to disk and on older versions of MacOS \r\r gets written to disk, because python replaces \n by the system depended line ending.
2016-08-11 05:43:18 +02:00
Unrud
7a01f905de Enable close_lock_file for tests 2016-08-11 05:20:31 +02:00
Unrud
3f5dd70580 Add option to close lock file
Close the lock file, when no more clients are waiting.
This option is not very useful in general, but on Windows files that are opened cannot be deleted. This causes tests to fail, because the deletion of the temporary filesystem folder fails.
2016-08-11 05:19:23 +02:00
Unrud
0060130c3b Remove etags from raw data
Remove all etags that are directly calculated from data that's read from files.
1. They are not used anywhere (luckily).
2. Etags that are send to clients are calculated from the output of vobject's serialize method. If files are edited externally and vobject normalizes them (like wrapping long lines or replacing all line endings by \r\n), the etags that are sent to the client and the etags that are calculated from raw data will never match. If a new version of vobject is released and the formatting changes slightly, the checks will also always fail.
2016-08-11 05:05:10 +02:00
Guillaume Ayoub
35d12ee97e Merge pull request #472 from Unrud/patch-30
Use os.replace instead of os.rename
2016-08-11 04:23:56 +02:00
Guillaume Ayoub
69386410e5 Merge pull request #473 from Unrud/tests
Tests
2016-08-11 04:23:23 +02:00
Guillaume Ayoub
ac556f2bcc Merge pull request #471 from Unrud/logger
Fix logger
2016-08-11 04:22:41 +02:00
Unrud
4eb04e3526 PROPFIND rights checking
Return 404 and 403 only when it's appropriate. Don't ask users for passwords if an item just doesn't exist (e.g. mistyped URL).
2016-08-11 02:19:48 +02:00
Unrud
30b3273efa Test that the requests fails if the hook fails 2016-08-11 00:37:19 +02:00
Unrud
2b45cffa0e Test that hook gets executed when the principal collection is created
Test for ee5b8facda
2016-08-11 00:37:19 +02:00
Unrud
080ed31d27 Test that storage is locked when hook runs
Test for 65af0592d3
2016-08-11 00:37:19 +02:00
Unrud
952609deee Test that hook gets executed on write accesses 2016-08-11 00:37:19 +02:00
Unrud
893051645e Test fsync
Enable syncing for at least one test.
Test for 5c2075cb6c.
2016-08-11 00:37:19 +02:00
Unrud
6d80b70b8c Test that the root collection always exists
Test for 6c3e59fd11
2016-08-11 00:37:19 +02:00
Unrud
97edacd71a Test implicit creation of principal collection
Test for 81b04890f1
2016-08-11 00:37:19 +02:00
Unrud
62892e3423 Test PROPPATCH 2016-08-11 00:37:13 +02:00
Unrud
51bf95f00d Don't run all tests twice
Only verify that custom backend loading works with a simple test.
2016-08-11 00:32:24 +02:00
Unrud
c8e8993ec2 Refactor: Move common code into BaseFileSystemTest 2016-08-11 00:32:24 +02:00
Unrud
e2b87d145f Cosmetics: Don't use % for logging 2016-08-10 23:43:32 +02:00
Unrud
9192a7751b Remove incorrect argument
In rare cases this can cause a crash.
2016-08-10 23:41:19 +02:00
Unrud
b8126f8d24 Use os.replace instead of os.rename
On Windows os.replace sets the MOVEFILE_REPLACE_EXISTING flag for MoveFileEx.
On POSIX it's the same as os.rename.
2016-08-10 19:26:07 +02:00
Guillaume Ayoub
5c2075cb6c Fix _atomic_write 2016-08-08 14:55:01 +02:00
Guillaume Ayoub
5e5b8b844f Cosmetics 2016-08-08 13:39:01 +02:00
Guillaume Ayoub
1e5c9f63a0 Merge pull request #468 from Unrud/disablefsync
Add option to disable syncing to disk
2016-08-08 13:00:12 +02:00
Guillaume Ayoub
c4cf918bf2 Merge pull request #470 from Unrud/readcontent
Read content after access checks
2016-08-08 12:57:59 +02:00
Guillaume Ayoub
94ac2c5c8a Merge pull request #469 from Unrud/atomicput
Atomic replacement of whole collection by PUT
2016-08-08 12:52:05 +02:00
Unrud
a9b89be5c7 Read content after access checks
Unauthorized users can't fill up RAM with crap anymore.
2016-08-08 07:00:24 +02:00
Unrud
f294b1cf17 Add access check to PROPFIND 2016-08-08 06:59:15 +02:00
Unrud
eb15de0c5b Test PUT with whole collection 2016-08-08 06:09:24 +02:00
Unrud
68286faa63 Atomic replacement of whole collection by PUT 2016-08-08 06:08:52 +02:00
Unrud
0675328a02 Replace collection in Collection.create_collection 2016-08-08 06:08:01 +02:00
Unrud
6d85a731e5 Disable syncing to disk for tests
This reduces test time by almost 70%.
2016-08-08 05:30:16 +02:00
Unrud
f5f52582a1 Add option to disable syncing to disk
Disabling syncing increases the risk of data loss when the system crashes or power fails. On the positive it can increase the performance to a great extent.
2016-08-08 05:20:25 +02:00
Unrud
c336e0581e Remove atomicwrites
Unfortunately the library doesn't support disabling of disk syncing, fortunately we only need a small subset of it's functionality which is easy to implement.
2016-08-08 05:02:36 +02:00
Unrud
3c736cade8 Refactor: Move sync_directory into Collection class
This is not used anywhere else.
2016-08-08 04:07:01 +02:00
Guillaume Ayoub
9f2cbb81a3 Merge pull request #466 from Unrud/fixpath
Set correct path for child collections
2016-08-07 18:43:41 +02:00
Guillaume Ayoub
8f05bea8ea Merge pull request #465 from Unrud/patch-29
Always use wrapper to lock collection
2016-08-07 18:42:27 +02:00
Unrud
ce0a2fd01d Test PROPFIND
Regression test for cfa8c7d8b4
2016-08-07 18:08:10 +02:00
Unrud
cfa8c7d8b4 Set correct path for child collections 2016-08-07 17:50:31 +02:00
Unrud
4f37e90e20 Some clients expect collections to end with /
Compatibility with InfCloud/CalDavZAP/CardDavMATE
2016-08-07 17:50:04 +02:00
Unrud
ee5b8facda Always use wrapper to lock collection
Also run the hook after creation of the principal collection.
2016-08-07 17:14:47 +02:00
Guillaume Ayoub
4236077b04 Document _makedirs_synced and remove exist_ok 2016-08-06 14:08:21 +02:00
Guillaume Ayoub
4549d1b2db Merge pull request #462 from Unrud/durabledirs
Durable creation of directories and make sure that the root colleciton exists.
2016-08-06 14:02:41 +02:00