From c2bf87596f5bc084430d6888d4728136b516b405 Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Mon, 12 Oct 2026 00:24:40 +0200 Subject: [PATCH] test(acceptance): remove the local-only symlink the mirror-copy case leaves "move never loses a mirror copy Drive lacks" puts a symlink in a mirror folder to prove a move does not lose what sync never uploads, and left it there. The next mode pairing switches that folder to on-demand, which the daemon refuses because the link exists only on this computer, so the account run stopped after pairing 2 of 4. The case now removes the link wherever the move left it, whether it passes or fails. --- scripts/fuse-acceptance.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/fuse-acceptance.py b/scripts/fuse-acceptance.py index 29bfdef..65269f5 100755 --- a/scripts/fuse-acceptance.py +++ b/scripts/fuse-acceptance.py @@ -4388,6 +4388,21 @@ def test_move_refuses_a_mirror_copy_drive_lacks(mc: MoveContext) -> None: # Sync skips symlinks, so Drive never gets this one: removing the local # copy after a move would lose it. os.symlink("data.txt", source.root / name / "link") + try: + _move_keeps_what_drive_lacks(mc, source, dest, name, files) + finally: + # The link stays local-only wherever it ended up, and a mirror folder + # holding one refuses the switch to on-demand that the next mode + # pairing makes. + for location in (source, dest): + link = location.root / name / "link" + if os.path.lexists(link): + os.unlink(link) + + +def _move_keeps_what_drive_lacks( + mc: MoveContext, source: Location, dest: Location, name: str, files: dict[Path, bytes] +) -> None: source.settle() if dest.mode == "mirror" and os.stat(source.folder).st_dev == os.stat(dest.folder).st_dev: # Between two mirrors on one filesystem the local copy is renamed