Exercise backup validation without bypassing empty-node protection

The initial control is already protected when saved Proxmox nodes block an empty replacement. Model an installation with no Proxmox nodes, where invalid envelopes can reach the settings and credential writes. Keep the existing empty-node safeguard intact and use that legitimate empty inventory for legacy compatibility controls.

Change-source: pulse-maintainer
This commit is contained in:
pulse-triage[bot]
2026-10-25 05:25:28 +00:00
parent cc105e261b
commit 38a8b01ca3
@@ -81,7 +81,10 @@ func encryptImportValidationData(t *testing.T, data []byte) string {
func seedImportValidationState(t *testing.T) *ConfigPersistence {
t.Helper()
cp := NewConfigPersistence(t.TempDir())
if err := cp.SaveNodesConfig([]PVEInstance{{Name: "keep-node", Host: "https://keep.invalid:8006", TokenValue: "synthetic-node-secret", Disabled: true, VerifySSL: true}}, nil, nil); err != nil {
// Agent-only, Docker, VMware and NAS installations can legitimately have
// no Proxmox nodes. The separate existing empty-node deletion guard does
// not protect their credentials, settings and metadata from this path.
if err := cp.SaveNodesConfig(nil, nil, nil); err != nil {
t.Fatal(err)
}
settings := DefaultSystemSettings()