diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-12-09 18:11:46 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2021-12-13 20:53:56 +0300 |
commit | f776818cf599a55df4431dc21a20173e6a9d11bf (patch) | |
tree | 28ca5559ceb05a2fba1b217d6f9ba7c7099f8780 /test | |
parent | f100deb90127fa169b5d25e380569dadbf6fdf07 (diff) |
Handle local errors with the ignore list
Fixes: #9208, #9133
Diffstat (limited to 'test')
-rw-r--r-- | test/testblacklist.cpp | 8 | ||||
-rw-r--r-- | test/testchunkingng.cpp | 1 | ||||
-rw-r--r-- | test/testdownload.cpp | 2 | ||||
-rw-r--r-- | test/testlockedfiles.cpp | 2 | ||||
-rw-r--r-- | test/testsyncengine.cpp | 4 |
5 files changed, 13 insertions, 4 deletions
diff --git a/test/testblacklist.cpp b/test/testblacklist.cpp index 3a4fe93be..4c16c0703 100644 --- a/test/testblacklist.cpp +++ b/test/testblacklist.cpp @@ -73,7 +73,7 @@ private slots: auto entry = fakeFolder.syncJournal().errorBlacklistEntry(testFileName); QVERIFY(entry.isValid()); - QCOMPARE(entry._errorCategory, SyncJournalErrorBlacklistRecord::Normal); + QCOMPARE(entry._errorCategory, SyncJournalErrorBlacklistRecord::Category::Normal); QCOMPARE(entry._retryCount, 1); QCOMPARE(counter, 1); QVERIFY(entry._ignoreDuration > 0); @@ -94,7 +94,7 @@ private slots: auto entry = fakeFolder.syncJournal().errorBlacklistEntry(testFileName); QVERIFY(entry.isValid()); - QCOMPARE(entry._errorCategory, SyncJournalErrorBlacklistRecord::Normal); + QCOMPARE(entry._errorCategory, SyncJournalErrorBlacklistRecord::Category::Normal); QCOMPARE(entry._retryCount, 1); QCOMPARE(counter, 1); QVERIFY(entry._ignoreDuration > 0); @@ -121,7 +121,7 @@ private slots: auto entry = fakeFolder.syncJournal().errorBlacklistEntry(testFileName); QVERIFY(entry.isValid()); - QCOMPARE(entry._errorCategory, SyncJournalErrorBlacklistRecord::Normal); + QCOMPARE(entry._errorCategory, SyncJournalErrorBlacklistRecord::Category::Normal); QCOMPARE(entry._retryCount, 2); QCOMPARE(counter, 2); QVERIFY(entry._ignoreDuration > 0); @@ -143,7 +143,7 @@ private slots: auto entry = fakeFolder.syncJournal().errorBlacklistEntry(testFileName); QVERIFY(entry.isValid()); - QCOMPARE(entry._errorCategory, SyncJournalErrorBlacklistRecord::Normal); + QCOMPARE(entry._errorCategory, SyncJournalErrorBlacklistRecord::Category::Normal); QCOMPARE(entry._retryCount, 3); QCOMPARE(counter, 3); QVERIFY(entry._ignoreDuration > 0); diff --git a/test/testchunkingng.cpp b/test/testchunkingng.cpp index 0cab9a090..50f248690 100644 --- a/test/testchunkingng.cpp +++ b/test/testchunkingng.cpp @@ -438,6 +438,7 @@ private slots: QCOMPARE(fakeFolder.uploadState().children.count(), 1); // We did not clean the chunks at this point // Now we will download the server file and create a conflict + fakeFolder.syncJournal().wipeErrorBlacklist(); QVERIFY(fakeFolder.syncOnce()); auto localState = fakeFolder.currentLocalState(); diff --git a/test/testdownload.cpp b/test/testdownload.cpp index b37cb807d..ec10b37d7 100644 --- a/test/testdownload.cpp +++ b/test/testdownload.cpp @@ -86,6 +86,7 @@ private slots: } return nullptr; }); + fakeFolder.syncJournal().wipeErrorBlacklist(); QVERIFY(fakeFolder.syncOnce()); // now this succeeds QCOMPARE(ranges, QByteArray("bytes=" + QByteArray::number(stopAfter) + "-")); QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); @@ -197,6 +198,7 @@ private slots: QTest::qFail("There shouldn't be any download", __FILE__, __LINE__); return nullptr; }); + fakeFolder.syncJournal().wipeErrorBlacklist(); QVERIFY(fakeFolder.syncOnce()); // The a1 file is still tere and have the right content diff --git a/test/testlockedfiles.cpp b/test/testlockedfiles.cpp index a96dbea64..02a0972f4 100644 --- a/test/testlockedfiles.cpp +++ b/test/testlockedfiles.cpp @@ -136,6 +136,7 @@ private slots: fakeFolder.syncEngine().setLocalDiscoveryOptions(LocalDiscoveryStyle::DatabaseAndFilesystem, tracker.localDiscoveryPaths()); tracker.startSyncPartialDiscovery(); + fakeFolder.syncJournal().wipeErrorBlacklist(); QVERIFY(fakeFolder.syncOnce()); QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); @@ -159,6 +160,7 @@ private slots: fakeFolder.syncEngine().setLocalDiscoveryOptions(LocalDiscoveryStyle::DatabaseAndFilesystem, tracker.localDiscoveryPaths()); tracker.startSyncPartialDiscovery(); + fakeFolder.syncJournal().wipeErrorBlacklist(); QVERIFY(fakeFolder.syncOnce()); QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); } diff --git a/test/testsyncengine.cpp b/test/testsyncengine.cpp index a0f69c0ef..702e47d57 100644 --- a/test/testsyncengine.cpp +++ b/test/testsyncengine.cpp @@ -524,6 +524,7 @@ private slots: // Good OC-Checksum checksumValue = "SHA1:19b1928d58a2030d08023f3d7054516dbc186f20"; // printf 'A%.0s' {1..16} | sha1sum - + fakeFolder.syncJournal().wipeErrorBlacklist(); QVERIFY(fakeFolder.syncOnce()); QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); checksumValue = QByteArray(); @@ -535,6 +536,7 @@ private slots: // Good Content-MD5 contentMd5Value = "d8a73157ce10cd94a91c2079fc9a92c8"; // printf 'A%.0s' {1..16} | md5sum - + fakeFolder.syncJournal().wipeErrorBlacklist(); QVERIFY(fakeFolder.syncOnce()); QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); @@ -547,6 +549,7 @@ private slots: fakeFolder.remoteModifier().create("A/a7", 16, 'A'); QVERIFY(!fakeFolder.syncOnce()); contentMd5Value.clear(); + fakeFolder.syncJournal().wipeErrorBlacklist(); QVERIFY(fakeFolder.syncOnce()); QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); @@ -555,6 +558,7 @@ private slots: fakeFolder.remoteModifier().create("A/a8", 16, 'A'); QVERIFY(!fakeFolder.syncOnce()); // Since the supported SHA1 checksum is invalid, no download checksumValue = "Unsupported:XXXX SHA1:19b1928d58a2030d08023f3d7054516dbc186f20 Invalid:XxX"; + fakeFolder.syncJournal().wipeErrorBlacklist(); QVERIFY(fakeFolder.syncOnce()); // The supported SHA1 checksum is valid now, so the file are downloaded QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); } |