From 29acaa5b08e5bbe6b1d9f38f992b99a7ed606cab Mon Sep 17 00:00:00 2001 From: Kevin Janssen Date: Fri, 20 Nov 2026 12:48:37 +0100 Subject: [PATCH] Pin backup evaluation to the report of the Proxmox VE 9.2 test host Co-Authored-By: Claude Opus 5.5 --- .../domain/src/inventory_document/proxmox.rs | 12 ++++ .../proxmox_pve92_fixture.json | 72 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 crates/domain/src/inventory_document/proxmox_pve92_fixture.json diff --git a/crates/domain/src/inventory_document/proxmox.rs b/crates/domain/src/inventory_document/proxmox.rs index 510185b..84ae7da 100644 --- a/crates/domain/src/inventory_document/proxmox.rs +++ b/crates/domain/src/inventory_document/proxmox.rs @@ -242,6 +242,18 @@ mod tests { assert_eq!(status["last_success_at"]["100"], 1050); } + /// Observation reported by the Proxmox VE 9.2 test host on 2026-11-20. + #[test] + fn real_proxmox_92_report_validates_and_counts_the_due_run() { + let data: Value = serde_json::from_str(include_str!("proxmox_pve92_fixture.json")).unwrap(); + validate(&data).unwrap(); + let status = backup_status(&data).unwrap(); + assert_eq!(status["jobs"][0]["id"], "backup-debian"); + assert_eq!(status["jobs"][0]["status"], "ok"); + assert_eq!(status["all_scheduled_backups_ran"], true); + assert_eq!(data["not_backed_up"], json!([101])); + } + #[test] fn missing_and_running_runs_are_distinguished() { let mut doc = sample(); diff --git a/crates/domain/src/inventory_document/proxmox_pve92_fixture.json b/crates/domain/src/inventory_document/proxmox_pve92_fixture.json new file mode 100644 index 0000000..7bf2a0e --- /dev/null +++ b/crates/domain/src/inventory_document/proxmox_pve92_fixture.json @@ -0,0 +1,72 @@ +{ + "backup_jobs": [ + { + "covered_vmids": [ + 100 + ], + "enabled": true, + "id": "backup-debian", + "last_expected_run": 1795172400, + "mode": "snapshot", + "next_run": 1795179600, + "schedule": "*/2:00", + "selection": "vmid", + "storage": "local" + } + ], + "backup_runs": [ + { + "ended_at": 1795172488, + "guests": [ + { + "result": "ok", + "vmid": 100 + } + ], + "message": null, + "started_at": 1795172468, + "status": "ok", + "upid": "UPID:pve:00000C75:000030ED:6B002874:vzdump:100:root@pam:" + } + ], + "cluster": null, + "guests": [ + { + "cpus": 1, + "disk_bytes": 8589934592, + "kind": "qemu", + "macs": [ + "bc:24:11:88:35:97" + ], + "memory_bytes": 1073741824, + "name": "debian-guest", + "pool": null, + "smbios_uuid": "787f4ae9-446f-4fac-b3d8-4074170bf823", + "status": "running", + "template": false, + "uptime_seconds": 2716, + "vmid": 100 + }, + { + "cpus": 1, + "disk_bytes": 1020702720, + "kind": "lxc", + "macs": [ + "bc:24:11:b7:4c:99" + ], + "memory_bytes": 134217728, + "name": "alpine-ct", + "pool": null, + "smbios_uuid": null, + "status": "running", + "template": false, + "uptime_seconds": 2714, + "vmid": 101 + } + ], + "node": "pve", + "not_backed_up": [ + 101 + ], + "version": "9.2.2" +} \ No newline at end of file