Commit graph

20 commits

Author SHA1 Message Date
Matthieu Gallien
608a435d38
context menu: do not recursively check pin and availability states
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-03-27 11:59:30 +01:00
alex-z
4672acb5a6 Unit tests for the type change.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2023-12-13 11:43:25 +01:00
Dimitri Papadopoulos
8a73a9a6f5 Fix new typos found by codespell
Signed-off-by: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>
2023-09-17 10:41:38 +02:00
alex-z
d26fc34c5c Tests for placeholder file metadata update.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2023-09-14 16:00:14 +02:00
Matthieu Gallien
aa55275cc8 add an automated test to check that locked files are read-only
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-08-21 12:57:16 +02:00
Dries Mys
fb21eb55cf Alter testUnexpectedNonPlaceholder to better reflect the actual use case
Signed-off-by: Dries Mys <dries.mys@my-dreams.be>
2023-07-26 11:05:50 +02:00
Dries Mys
984d06e82a Convert VFS file to placeholder again if needed
Note that Windows may convert a placeholder file to a regular file when
it is replaced by another file, even if the old and new file (inode,
modified time, file size) are identical.

WIN32_FIND_DATA::dwReserved0 is only initialised in case of
FILE_ATTRIBUTE_REPARSE_POINT is set. This field is not a bit set. Check
corrected to only include all cloud reparse points and not other special
reparse points.

Signed-off-by: Dries Mys <dries.mys@my-dreams.be>
2023-07-26 11:05:50 +02:00
Dries Mys
9256417612 Create placeholder while dehydrating if needed
When replacing an OnlineOnly file by another one, the file maintains it
OnlineOnly pin state, but it is converted to a regular file. So, the
dehydration should convert the regular file to a (dehydrated)
placeholder instead of trying to update the (non-existing) placeholder.

Closes #4274

Signed-off-by: Dries Mys <dries.mys@my-dreams.be>
2023-07-20 15:07:46 +02:00
Matthieu Gallien
baf9c8b631 add test for windows CfApi
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-03-08 09:45:09 +01:00
Matthieu Gallien
151d17aed4
fix ignored return values in windows specific code
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-02-22 16:50:21 +01:00
Christian Göttsche
1a83894074 Fix typo
Found by Lintian.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2022-12-13 09:22:58 +01:00
allexzander
5175d186a4 Do not ignore return values for SyncJournalDB in unit tests.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2022-09-17 09:47:15 +02:00
Matthieu Gallien
2cb88952fb fix build of windows virtual files automated tests
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-09-05 12:30:49 +02:00
alex-z
300446579c Fail build when Windows tests fail. Use GH Actions to build and run Windows tests. Create coverage and uppload it to codecov.io.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2022-06-10 15:18:54 +03:00
Kevin Ottens
ebfe51b7e7 Don't treat new folders in unpinned folders as files to dehydrate
This would only happen if the parent of the newly created folder would
be explicitly set to online only, hence why it went under the radar
previously.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-26 17:09:24 +00:00
Kevin Ottens
46a5bd6b25
Ensure we properly cancel hydration on server errors
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:59 +01:00
Kevin Ottens
90fbb7d322
Implement callback between wrapper and vfs object for hydration requests
This comes with a test simulating an open request coming from another
process (although in our case it's really just a thread). The actual
hydration works as expected by cfapi, handling of encrypted files is for
now missing.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:58 +01:00
Kevin Ottens
5d013accea
Improve test readability with a bunch of macros
Since we often checked the same file states to see if they were virtual,
non virtual or gone, let's factor this out. This way intent in tests is
clearer.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:58 +01:00
Kevin Ottens
691ab9a40a
Port the tests to the CfApiWrapper
This reduces code duplication and opportunities of mistakes between the
test and the implementation.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:58 +01:00
Kevin Ottens
423780bf79
Add initial version of the CfApi backend
For now this implements only the logic necessary to get a test suite
equivalent to the TestSyncVirtualFiles one to pass. It doesn't (yet)
honor request to fetch files from the system.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:58 +01:00