mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-26 05:29:45 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user