Make project docs and integration test generic
This commit is contained in:
@@ -12,7 +12,7 @@ def _settings(tmp_path):
|
||||
return {
|
||||
"setup_complete": False,
|
||||
"proxmox_node": "pve",
|
||||
"proxmox_storage": "hitachi",
|
||||
"proxmox_storage": "backup-store",
|
||||
"local_backup_dir": str(tmp_path),
|
||||
"rclone_path": "/usr/bin/rclone",
|
||||
"rclone_remote": "onedrive",
|
||||
@@ -31,12 +31,12 @@ def _job():
|
||||
return create_job(
|
||||
{
|
||||
"guest_vmid": 110,
|
||||
"guest_name": "adguard",
|
||||
"guest_name": "test-guest",
|
||||
"guest_type": "vm",
|
||||
"node": "pve",
|
||||
"enabled": True,
|
||||
"cron_schedule": "0 2 * * *",
|
||||
"proxmox_storage": "hitachi",
|
||||
"proxmox_storage": "backup-store",
|
||||
"backup_mode": "snapshot",
|
||||
"compression": "zstd",
|
||||
"retention_type": "latest",
|
||||
@@ -97,7 +97,7 @@ def test_pve_running_without_upid_fails_without_polling_none(isolated_db, no_not
|
||||
conn.execute(
|
||||
"""
|
||||
INSERT INTO backups(id, guest_vmid, guest_name, guest_type, node, state, started_at, updated_at)
|
||||
VALUES ('missing-upid', 110, 'adguard', 'lxc', 'astrid', 'pve_running', ?, ?)
|
||||
VALUES ('missing-upid', 110, 'test-guest', 'lxc', 'pve', 'pve_running', ?, ?)
|
||||
""",
|
||||
(utc_now(), utc_now()),
|
||||
)
|
||||
@@ -156,7 +156,7 @@ def test_retention_latest_selects_expired_remote_backups(
|
||||
id, job_id, guest_vmid, guest_name, guest_type, node, state,
|
||||
remote_path, started_at, completed_at, updated_at
|
||||
)
|
||||
VALUES (?, ?, 110, 'adguard', 'vm', 'pve', 'completed', ?, ?, ?, ?)
|
||||
VALUES (?, ?, 110, 'test-guest', 'vm', 'pve', 'completed', ?, ?, ?, ?)
|
||||
""",
|
||||
(
|
||||
backup_id,
|
||||
@@ -196,7 +196,7 @@ def test_startup_recovery_resumes_known_states(isolated_db, no_notifications, mo
|
||||
conn.execute(
|
||||
"""
|
||||
INSERT INTO backups(id, guest_vmid, guest_name, guest_type, node, state, started_at, updated_at)
|
||||
VALUES (?, 110, 'adguard', 'vm', 'pve', ?, ?, ?)
|
||||
VALUES (?, 110, 'test-guest', 'vm', 'pve', ?, ?, ?)
|
||||
""",
|
||||
(backup_id, state, utc_now(), utc_now()),
|
||||
)
|
||||
@@ -227,7 +227,7 @@ def test_retention_sweep_applies_all_jobs_with_completed_remote_backups(
|
||||
id, job_id, guest_vmid, guest_name, guest_type, node, state,
|
||||
remote_path, started_at, completed_at, updated_at
|
||||
)
|
||||
VALUES ('sweep-test', ?, 110, 'adguard', 'vm', 'pve', 'completed',
|
||||
VALUES ('sweep-test', ?, 110, 'test-guest', 'vm', 'pve', 'completed',
|
||||
'onedrive:pve-cloud-backup/sweep-test/archive.tar.zst', ?, ?, ?)
|
||||
""",
|
||||
(job["id"], utc_now(), utc_now(), utc_now()),
|
||||
@@ -260,7 +260,7 @@ def test_manual_backup_delete_removes_remote_and_known_local_file(
|
||||
id, guest_vmid, guest_name, guest_type, node, state,
|
||||
local_path, remote_path, started_at, completed_at, updated_at
|
||||
)
|
||||
VALUES ('manual-delete', 110, 'adguard', 'vm', 'pve', 'completed',
|
||||
VALUES ('manual-delete', 110, 'test-guest', 'vm', 'pve', 'completed',
|
||||
?, 'onedrive:pve-cloud-backup/manual-delete/archive.tar.zst', ?, ?, ?)
|
||||
""",
|
||||
(str(local_file), utc_now(), utc_now(), utc_now()),
|
||||
@@ -303,7 +303,7 @@ def test_manual_backup_delete_removes_empty_remote_folder_when_file_is_already_m
|
||||
id, guest_vmid, guest_name, guest_type, node, state,
|
||||
remote_path, started_at, completed_at, updated_at
|
||||
)
|
||||
VALUES ('missing-remote-file', 110, 'adguard', 'vm', 'pve', 'completed',
|
||||
VALUES ('missing-remote-file', 110, 'test-guest', 'vm', 'pve', 'completed',
|
||||
'onedrive:pve-cloud-backup/missing-remote-file/archive.tar.zst', ?, ?, ?)
|
||||
""",
|
||||
(utc_now(), utc_now(), utc_now()),
|
||||
@@ -327,7 +327,7 @@ def test_manual_backup_delete_refuses_active_backup(isolated_db, no_notification
|
||||
conn.execute(
|
||||
"""
|
||||
INSERT INTO backups(id, guest_vmid, guest_name, guest_type, node, state, started_at, updated_at)
|
||||
VALUES ('active-delete', 110, 'adguard', 'vm', 'pve', 'uploading', ?, ?)
|
||||
VALUES ('active-delete', 110, 'test-guest', 'vm', 'pve', 'uploading', ?, ?)
|
||||
""",
|
||||
(utc_now(), utc_now()),
|
||||
)
|
||||
@@ -346,7 +346,7 @@ def test_deleting_already_deleted_backup_purges_metadata_row(isolated_db, no_not
|
||||
id, guest_vmid, guest_name, guest_type, node, state,
|
||||
remote_path, started_at, deleted_at, updated_at
|
||||
)
|
||||
VALUES ('purge-deleted', 110, 'adguard', 'vm', 'pve', 'deleted',
|
||||
VALUES ('purge-deleted', 110, 'test-guest', 'vm', 'pve', 'deleted',
|
||||
'onedrive:pve-cloud-backup/purge-deleted/archive.tar.zst', ?, ?, ?)
|
||||
""",
|
||||
(utc_now(), utc_now(), utc_now()),
|
||||
@@ -380,7 +380,7 @@ def test_delete_job_deletes_backups_before_removing_job(
|
||||
conn.execute(
|
||||
"""
|
||||
INSERT INTO backups(id, job_id, guest_vmid, guest_name, guest_type, node, state, remote_path, started_at, completed_at, updated_at)
|
||||
VALUES ('job-delete-backup', ?, 110, 'adguard', 'vm', 'pve', 'completed',
|
||||
VALUES ('job-delete-backup', ?, 110, 'test-guest', 'vm', 'pve', 'completed',
|
||||
'onedrive:pve-cloud-backup/job-delete-backup/archive.tar.zst', ?, ?, ?)
|
||||
""",
|
||||
(job["id"], utc_now(), utc_now(), utc_now()),
|
||||
|
||||
Reference in New Issue
Block a user