Commit graph

159 commits

Author SHA1 Message Date
Christian Kamm
276985f6c3 Fix perl tests for sync journal db name 2016-11-25 13:21:34 +01:00
Christian Kamm
9641c7a1e7 Rename sync journal to ._sync_xxx.db.
The added underscore means that older clients will also ignore the
file.
2016-11-23 16:48:15 +01:00
Christian Kamm
3e59a9b316 Merge branch 'master' into dbjournal_per_account 2016-11-23 16:47:56 +01:00
Olivier Goffart
a1dc4069c9 libsync: Don't store the remote URI in the csync or in the SyncEngine
We are going to change the webdav path depending on the capabilities.
But the SyncEngine and csync might have been created before the capabilities
are retrieved.

The main raison why we gave the path to the sync engine was to pass it to csync.
But the thing is that csync don't need anymore this url as everything is done by the
discovery classes in libsync that use the network jobs that use the account for the urls.
So csync do not need the remote URI.

shortenFilename in folderstatusmodel.cpp was useless because the string is the
_file of a SyncFileItem which is the relative file name, that name never
starts with owncloud://.

All the csync test creates the folder because csync use to check if the folder
exists. But we don't need to do that anymore
2016-11-21 08:09:11 +01:00
Christian Kamm
f1f27221a7 Conflicts: Use the local mtime for the conflict file name #5273
Otherwise local conflict files may be overridden in a restore
situation. See ticket for details.
2016-11-08 14:47:51 +01:00
Christian Kamm
598a7cec5d Merge remote-tracking branch 'origin/2.2' 2016-09-28 12:07:45 +02:00
Jocelyn Turcotte
2b274e9460 Fix the MSVC build
- Replace functions that are provided by MinGW with a Win32-based
  implementation
- Explicitly export needed symbols from ocsync.dll
- Rename share.h to sharemanager.h since the name clashes with one
  of the Windows headers and get included from there
- Remove the timestamp from the fallback csync stderr logging, it's
  not used since we always provide a log callback
2016-09-16 17:43:39 +02:00
Christian Kamm
3e1690ff7a Improvements to file recall 2016-09-14 15:42:19 +02:00
Christian Kamm
4abaee7736 Recall: Copy instead of move recalled file #5150
That was an unintentional change in
2662203fb7

Also expand the test case to cover this.

(cherry picked from commit af9c4d0e2f)
2016-09-12 14:09:12 +02:00
Christian Kamm
af9c4d0e2f Recall: Copy instead of move recalled file #5150
That was an unintentional change in
2662203fb7

Also expand the test case to cover this.
2016-09-06 10:42:59 +02:00
Klaas Freitag
6fd930908c csync_tests: Adopted to new cmocka API. 2016-09-02 15:49:54 +02:00
Jocelyn Turcotte
2507ba9818 tx.pl: Fix each put_to_dir taking 10 seconds
The open function expects a URL, passing only the directory name would
lead HTTP::DAV to try looking it as an hostname on the network and
only return after it timed out.
2016-08-15 15:35:53 +02:00
Christian Kamm
eadecc5802 Excludes: Fix a Windows specific bug #5039
It meant that almost nothing was being excluded.

Broken since 87b4693a9d
2016-07-19 15:38:57 +02:00
Christian Kamm
6d02d76cfd Fix compile warnings in tests 2016-06-07 09:43:04 +02:00
orion1024
9f3e576348
Adding CURL check in t6.pl
Aborts immediately if CURL not found, to avoid misleading errors later.
2016-04-30 11:44:16 +02:00
Christian Kamm
68126dcff6 Checksums: Skip uploads of .eml files only #4754
This is a workaround. A correct solution would still update file metadata
such as the mtime. See #4755.
2016-04-28 12:59:39 +02:00
Christian Kamm
e7f00339e6 Fix perl tests #4722
* The dav auth realm is "sabre/dav" for newer server versions
* Content checksums are enabled generally, so conflict detection
  is smarter
2016-04-28 10:44:37 +02:00
Christian Kamm
d7bd1300a8 Ignores: expand escapes #4568 2016-03-17 14:31:53 +01:00
Jocelyn Turcotte
b8227afcaa Move the csync_context creation in SyncEngine
The creation doesn't need to be separated from the SyncEngine anymore.
This allows the SyncEngine to be created in fewer steps if we want to
use it in tests.

This moves most of the direct csync code from Folder into the SyncEngine.
The exclude file logic for the context has been wrapped using the
existing ExcludedFiles class as well.
2016-02-25 20:53:13 +01:00
Jocelyn Turcotte
b8dee63d7a Remove superfluous error checking from csync_create and csync_init
Given that we control all call sites, the only way that this can fail is during
OOM. Also remove the code in csync itself to make sure that it's obvious that
any new error case wouldn't be handled by call sites.
2016-02-25 20:53:13 +01:00
Hefee
aa8b772bff Don't install tests and cmocka lib.
Neither tests nor the libcmocka needs to be installed globally.
2016-02-05 14:14:07 +01:00
Klaas Freitag
d89edc35d2 csync-tests: Added some directory wildcard tests.
This was to verify client issue #1558
2016-01-10 12:04:07 +01:00
Christian Kamm
1aa570326e Tests: Add a perl test for eml checksums #3235 2015-11-25 12:48:24 +01:00
Christian Kamm
a25f094c4c Checksums: Don't reupload if size and checksum are unchanged #3235
* Compute the content checksum (in addition to the optional
  transmission checksum) during upload (.eml files only)

* Add hook to compute and compare the checksum in csync_update

* Add content checksum to database, remove transmission checksum
2015-11-23 11:59:56 +01:00
Christian Kamm
beb970646b Fix csync_exclude test
The exclude file was reorganized in
b6aa18bfbc
2015-11-11 09:42:31 +01:00
Markus Goetz
a6c9e8c5b4 Merge branch 'kill_legacy_propagator' 2015-10-28 11:06:50 +01:00
Christian Kamm
c81b02c7d9 csync tests: Remove unused function 2015-10-28 10:04:15 +01:00
Olivier Goffart
f18b40f7e7 csync_vio: reuse the information from readdir in stat
On unix we don't safe much (otherwise csync would have been
designed differently).
On windows however, the readdir already fetch all the info, so we
can as well use it.

We still have to query for the file id but we might optimize that later
2015-10-22 18:46:41 +02:00
Olivier Goffart
71827549d6 csync_exclude: Use PathMatchSpecA instead of PathMatchSpecW
So we avoid lots of memory allocation.
We can work with char* directly since both the pattern and the file
name are in UTF-8 and there is no need to understand unicode for
such pattern.

(In fact, '?' would not match anyore non-ascii characters, but I
don't think that's a problem. I don't think anyone use '?' in its
exclude list. And the two allocations per call to csync_fnmatch are
really worth getting rid of)
2015-10-20 18:38:47 +02:00
Markus Goetz
c8590c4468 Remove legacy propagator and neon
The code was already uneeded/unbuilt on Windows and OS X.
2015-10-20 17:57:43 +02:00
Christian Kamm
c832a9eee5 csync io: Fix UNC path conversion on Win #3748
Paths that were already in UNC form don't need to be prefixed.
2015-09-04 15:57:21 +02:00
Christian Kamm
07ca0be3c5 csync_excluded: Another speedup #3638
Build a list of path components outside of the exclude pattern loop.
2015-08-24 15:08:06 +02:00
Christian Kamm
fe49255bff csync_excluded: Add fast _traversal() function #3638
This function only checks the full path and the basename and is thus
around 7x faster. It is very useful in a csync_update context where
we know that the leading dirs have already been checked for exclusion.
2015-08-24 15:08:06 +02:00
Christian Kamm
20f4ec6b67 csync_exclude: Speed up siginificantly #3638
The performance test indicates a speedup of around 3x for paths
with around 12 components.
2015-08-24 15:08:06 +02:00
Olivier Goffart
499e13377d check_vio_ext.c: assert_string_equal is a macro and we cannot have #ifdef in it 2015-08-06 10:02:12 +02:00
Olivier Goffart
157f59d44a Csync tests: fix on linux
Linux do not iconv to decode filenames
2015-08-05 11:09:27 +02:00
Markus Goetz
f6cd2c79d5 CSync: Proper error for invalid filenames #2777 #3128 #2240 2015-08-04 22:13:38 +02:00
Markus Goetz
a7b0f7b42e check_vio_ext: Fix on OS X 2015-08-04 17:25:48 +02:00
Klaas Freitag
3b510969a2 Fix test, make it independent on the sort order of readdir. 2015-07-27 13:28:21 +02:00
Klaas Freitag
a280007dc2 Added another test case with content in the deep path (also win32). 2015-07-08 18:13:40 +02:00
Klaas Freitag
d9b44b3a69 Created two functions c_utf8_string_to_locale and c_utf8_path_to_locale.
Before we only had c_utf8_to_locale, but now functionality is needed to
convert a path to UNC before converting it. That does c_utf8_path_to_locale
now, while c_utf8_string_to_locale only converts the plain string, ie.
to generate wide char strings for output.
2015-07-08 18:13:39 +02:00
Klaas Freitag
5214189eb2 Moved the makeWinLongPath function to c_path and rename to c_path_to_UNC
Other cleanups like streamlined allocation and more.
2015-07-08 18:13:39 +02:00
Klaas Freitag
2e04eba74b Long Win Pathes: Added test to test dir traversal with long pathes. 2015-07-08 18:13:39 +02:00
Klaas Freitag
2cce8065ab CMocka Testing: Install the cmocka library 2015-07-08 18:13:39 +02:00
Klaas Freitag
b9b5e1cf33 Long win pathes: Make makeLongWinPath function return the num of alloc bytes.
This enables the calling function to free these accordingly. That is needed
because the makeLongWinPath for efficiency reasons does not always realloc
the original string.
2015-07-08 18:13:39 +02:00
Klaas Freitag
2f0a404116 Unit test for the long filename conversion on win32 2015-07-08 18:13:38 +02:00
Christian Kamm
e88ce41f4f test: Fix compile of check_csync_update. 2015-07-02 10:04:20 +02:00
Olivier Goffart
575ca50aac csync: Do not ignore hard links anymore
There is no reason to ignore them. Downloading a file that is hardlinked
will break the link.

Will solve syncing NTFS directories #3241
2015-07-01 13:05:08 +02:00
Olivier Goffart
289800c1ba Recall: make it work even if it is not in the root directory 2015-05-21 16:06:53 +02:00
Olivier Goffart
49fb37fefc t_recall.pl: add a test for the recall feature 2015-05-21 16:06:53 +02:00