Aggiunge task scheduler XML

This commit is contained in:
2026-07-01 12:58:58 +02:00
parent 6232bb240c
commit 5afcdd128b
10 changed files with 170 additions and 34 deletions

View File

@@ -66,7 +66,7 @@ def test_migrate_legacy_rsync_config_to_robocopy_defaults() -> None:
assert data["backup"]["engine"] == "robocopy"
assert data["backup"]["robocopy_path"] == "robocopy"
assert data["backup"]["server_check"]["port"] == 445
assert data["backup"]["server_check"]["interval_seconds"] == 600
assert data["backup"]["server_check"]["interval_seconds"] == 1800
assert data["backup"]["remote_destinations"] == []

31
tests/test_task_xml.py Normal file
View File

@@ -0,0 +1,31 @@
from __future__ import annotations
import xml.etree.ElementTree as ET
from pathlib import Path
def test_task_xml_files_are_parseable() -> None:
task_dir = Path("tasks")
files = [
task_dir / "BakRestBackupOnLogoff.xml",
task_dir / "BakRestServerNotifierEvery30Minutes.xml",
]
for file in files:
ET.parse(file)
def test_notifier_task_runs_every_30_minutes() -> None:
xml = (Path("tasks") / "BakRestServerNotifierEvery30Minutes.xml").read_text(
encoding="utf-8"
)
assert "<Interval>PT30M</Interval>" in xml
assert "-m bakrest.server_notifier" in xml
def test_backup_task_uses_logoff_event_and_nogui_backup() -> None:
xml = (Path("tasks") / "BakRestBackupOnLogoff.xml").read_text(encoding="utf-8")
assert "EventID=4647" in xml
assert "-m bakrest.tray_app --nogui" in xml