diff --git a/test/testsyncmove.cpp b/test/testsyncmove.cpp index 0cd86047daaf7..6a99af7c777eb 100644 --- a/test/testsyncmove.cpp +++ b/test/testsyncmove.cpp @@ -1176,6 +1176,44 @@ private slots: QCOMPARE(counter.nMOVE, 0); QCOMPARE(counter.nMKCOL, 5); } + + void testAllowRenameChildFolderFromGroupFolder() + { + FakeFolder fakeFolder{{}}; + fakeFolder.syncEngine().account()->setServerVersion("29.0.2.0"); + + fakeFolder.remoteModifier().mkdir("FolA"); + auto groupFolderRoot = fakeFolder.remoteModifier().find("FolA"); + groupFolderRoot->extraDavProperties = "true"; + setAllPerm(groupFolderRoot, RemotePermissions::fromServerString("WDNVCKRM")); + fakeFolder.remoteModifier().mkdir("FolA/FolB"); + fakeFolder.remoteModifier().mkdir("FolA/FolB/FolC"); + fakeFolder.remoteModifier().mkdir("FolA/FolB/FolC/FolD"); + fakeFolder.remoteModifier().mkdir("FolA/FolB/FolC/FolD/FolE"); + fakeFolder.remoteModifier().insert("FolA/FileA.txt"); + fakeFolder.remoteModifier().insert("FolA/FolB/FileB.txt"); + fakeFolder.remoteModifier().insert("FolA/FolB/FolC/FileC.txt"); + fakeFolder.remoteModifier().insert("FolA/FolB/FolC/FolD/FileD.txt"); + fakeFolder.remoteModifier().insert("FolA/FolB/FolC/FolD/FolE/FileE.txt"); + QVERIFY(fakeFolder.syncOnce()); + + OperationCounter counter; + fakeFolder.setServerOverride(counter.functor()); + + fakeFolder.localModifier().insert("FolA/FileA2.txt"); + fakeFolder.localModifier().insert("FolA/FolB/FileB2.txt"); + fakeFolder.localModifier().insert("FolA/FolB/FolC/FileC2.txt"); + fakeFolder.localModifier().insert("FolA/FolB/FolC/FolD/FileD2.txt"); + fakeFolder.localModifier().insert("FolA/FolB/FolC/FolD/FolE/FileE2.txt"); + fakeFolder.localModifier().rename("FolA/FolB", "FolA/FolB_Renamed"); + fakeFolder.localModifier().rename("FolA/FileA.txt", "FolA/FileA_Renamed.txt"); + QVERIFY(fakeFolder.syncOnce()); + QCOMPARE(counter.nDELETE, 0); + QCOMPARE(counter.nGET, 0); + QCOMPARE(counter.nPUT, 5); + QCOMPARE(counter.nMOVE, 2); + QCOMPARE(counter.nMKCOL, 0); + } }; QTEST_GUILESS_MAIN(TestSyncMove)