mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-24 22:15:57 +03:00
add a new automated test for virtual files and data restoration
add a test that will try to upload pure virtual files becase restoration after server data fingerprint has changed this is illegal and should not happen Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
b8bebab2eb
commit
9afd7265bb
1 changed files with 26 additions and 0 deletions
|
@ -1880,6 +1880,32 @@ private slots:
|
|||
conflicts = findCaseClashConflicts(*fakeFolder.currentLocalState().find("a/b"));
|
||||
QCOMPARE(conflicts.size(), shouldHaveCaseClashConflict ? 1 : 0);
|
||||
}
|
||||
|
||||
void testDataFingerPrint()
|
||||
{
|
||||
FakeFolder fakeFolder{ FileInfo{} };
|
||||
setupVfs(fakeFolder);
|
||||
|
||||
fakeFolder.remoteModifier().mkdir("a");
|
||||
fakeFolder.remoteModifier().mkdir("a/b");
|
||||
fakeFolder.remoteModifier().mkdir("a/b/d");
|
||||
fakeFolder.remoteModifier().insert("a/b/otherFile.txt");
|
||||
|
||||
//Server support finger print, but none is set.
|
||||
fakeFolder.remoteModifier().extraDavProperties = "<oc:data-fingerprint></oc:data-fingerprint>";
|
||||
|
||||
fakeFolder.syncEngine().setLocalDiscoveryOptions(OCC::LocalDiscoveryStyle::DatabaseAndFilesystem);
|
||||
QVERIFY(fakeFolder.syncOnce());
|
||||
|
||||
fakeFolder.remoteModifier().remove("a/b/otherFile.txt");
|
||||
fakeFolder.remoteModifier().remove("a/b/d");
|
||||
fakeFolder.remoteModifier().extraDavProperties = "<oc:data-fingerprint>initial_finger_print</oc:data-fingerprint>";
|
||||
|
||||
fakeFolder.syncEngine().setLocalDiscoveryOptions(OCC::LocalDiscoveryStyle::DatabaseAndFilesystem);
|
||||
QVERIFY(fakeFolder.syncOnce());
|
||||
|
||||
QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState());
|
||||
}
|
||||
};
|
||||
|
||||
QTEST_GUILESS_MAIN(TestSyncVirtualFiles)
|
||||
|
|
Loading…
Reference in a new issue