Migra configurazione robocopy a porta SMB

This commit is contained in:
2026-07-01 12:48:39 +02:00
parent fa556ffbd4
commit 3573b4c149
3 changed files with 59 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ from __future__ import annotations
from pathlib import Path
from bakrest.config import parse_config
from bakrest.config import migrate_config_data, parse_config
from bakrest.filters import WatchFilter
@@ -51,6 +51,24 @@ def test_parse_config_ignores_legacy_rsync_destination_for_robocopy(tmp_path: Pa
assert config.backup.remote_destinations == ()
def test_migrate_legacy_rsync_config_to_robocopy_defaults() -> None:
data = {
"backup": {
"server_host": "backup-server",
"remote_destination": "utente@backup-server:/backup/bak-rest/",
"server_check": {"type": "tcp", "port": 22},
}
}
changed = migrate_config_data(data)
assert changed
assert data["backup"]["engine"] == "robocopy"
assert data["backup"]["robocopy_path"] == "robocopy"
assert data["backup"]["server_check"]["port"] == 445
assert data["backup"]["remote_destinations"] == []
def test_filter_accepts_included_extension(tmp_path: Path) -> None:
config = parse_config(
{