fix: honor hardlinks across client mount topology
This commit is contained in:
@@ -62,6 +62,32 @@ class RouteDiscoveryTests(unittest.TestCase):
|
||||
self.assertEqual(routes[0].local_relative_path, "DownloadsSync")
|
||||
self.assertEqual(routes[0].state, route_pb2.ROUTE_STATE_DISCOVERED)
|
||||
|
||||
def test_discovery_accepts_a_safe_local_folder_override(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory)
|
||||
override = root / "qb/Sync"
|
||||
override.mkdir(parents=True)
|
||||
roots = RootMapping(
|
||||
PurePosixPath("/var/syncthing"),
|
||||
root / "sync",
|
||||
((PurePosixPath("/var/syncthing/DownloadsSync"), override),),
|
||||
)
|
||||
routes = discover_routes(
|
||||
{"folders": [{
|
||||
"id": "DownloadsSync",
|
||||
"path": "~/DownloadsSync",
|
||||
"type": "sendreceive",
|
||||
"devices": [
|
||||
{"deviceID": "LOCAL"},
|
||||
{"deviceID": "ARCHIVE"},
|
||||
],
|
||||
}]},
|
||||
"LOCAL",
|
||||
roots,
|
||||
True,
|
||||
)
|
||||
self.assertEqual([route.route_id for route in routes], ["DownloadsSync"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user