Compute PBS retention depth
This commit is contained in:
@@ -26,6 +26,7 @@ from pve_backup_report.report_pdf import format_last_backup
|
||||
from pve_backup_report.report_pdf import format_size
|
||||
from pve_backup_report.report_pdf import pbs_datastore_usage_row
|
||||
from pve_backup_report.report_pdf import pbs_access_user_row
|
||||
from pve_backup_report.report_pdf import retention_policy_depth
|
||||
from pve_backup_report.report_pdf import retention_policy_row
|
||||
from pve_backup_report.report_pdf import add_table_of_contents
|
||||
from pve_backup_report.report_pdf import unique_report_path
|
||||
@@ -171,10 +172,32 @@ def test_retention_policy_row_splits_columns() -> None:
|
||||
8,
|
||||
3,
|
||||
1,
|
||||
0,
|
||||
"29",
|
||||
]
|
||||
|
||||
|
||||
def test_retention_policy_depth_sums_keep_values() -> None:
|
||||
policy = PbsRetentionPolicy(
|
||||
policy_id="prune-prod",
|
||||
server_name="PBS01",
|
||||
keep_last=1,
|
||||
keep_hourly=2,
|
||||
keep_daily=14,
|
||||
keep_weekly=8,
|
||||
keep_monthly=3,
|
||||
keep_yearly=1,
|
||||
max_depth=0,
|
||||
)
|
||||
|
||||
assert retention_policy_depth(policy) == 29
|
||||
|
||||
|
||||
def test_retention_policy_row_displays_unspecified_depth_without_keep_values() -> None:
|
||||
policy = PbsRetentionPolicy(policy_id="prune-empty", server_name="PBS01", max_depth=0)
|
||||
|
||||
assert retention_policy_row(policy)[-1] == "non renseigne"
|
||||
|
||||
|
||||
def test_find_snapshot_summary_matches_storage_namespace_and_guest() -> None:
|
||||
guest = Guest(vmid=100, name="srv", guest_type="qemu")
|
||||
item = BackupCoverage(
|
||||
|
||||
Reference in New Issue
Block a user