Skip to content

Commit

Permalink
new autotest to ensure that we delete folders despite blacklist errors
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
  • Loading branch information
mgallien committed Nov 7, 2022
1 parent f8fc720 commit 783cefe
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/testsyncmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,29 @@ private slots:
QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState());
}

void testRenameParallelismWithBlacklist()
{
constexpr auto testFileName = "blackListFile";
FakeFolder fakeFolder{ FileInfo{} };
fakeFolder.remoteModifier().mkdir("A");
fakeFolder.remoteModifier().insert("A/file");

QVERIFY(fakeFolder.syncOnce());
QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState());

fakeFolder.remoteModifier().insert(testFileName);
fakeFolder.serverErrorPaths().append(testFileName, 500); // will be blacklisted
QVERIFY(!fakeFolder.syncOnce());

fakeFolder.remoteModifier().mkdir("B");
fakeFolder.remoteModifier().rename("A/file", "B/file");
fakeFolder.remoteModifier().remove("A");

QVERIFY(!fakeFolder.syncOnce());
auto folderA = fakeFolder.currentLocalState().find("A");
QCOMPARE(folderA, nullptr);
}

void testMovedWithError_data()
{
QTest::addColumn<Vfs::Mode>("vfsMode");
Expand Down

0 comments on commit 783cefe

Please sign in to comment.