controller v0.268.0: the undo finds volumes by definition; a held app names only a whole copy; one press = one tested step (R-658, R-659, R-660, R-651; 09 §6.4 part 5)
gates / gates (push) Successful in 27s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
2026-09-24 08:15:27 +02:00
parent 80e6ad8c47
commit 206b0357d1
36 changed files with 2201 additions and 40 deletions
@@ -0,0 +1,29 @@
package backup
import (
"io"
"log"
"testing"
"gitea.dooplex.hu/admin/felhom-controller/internal/settings"
)
// R-660 — UpdateHeldStacks names the apps an UPDATE hold stops, and never an R-379 restore hold (that
// hold has no event of its own; the app-down alarm stays its voice).
func TestR660_UpdateHeldStacksIsUpdateHoldsOnly(t *testing.T) {
sett := slice4Settings(t)
m := &Manager{logger: log.New(io.Discard, "", 0), settings: sett}
if got := m.UpdateHeldStacks(); len(got) != 0 {
t.Fatalf("no holds → %v", got)
}
_ = sett.SetRestoreHold(settings.RestoreHold{Stack: "nextcloud", At: "2026-09-23T21:42:39Z", Reason: settings.HoldReasonUpdateFailed})
_ = sett.SetRestoreHold(settings.RestoreHold{Stack: "docmost", At: "2026-08-22T14:00:00Z"})
got := m.UpdateHeldStacks()
if !got["nextcloud"] || got["docmost"] || len(got) != 1 {
t.Fatalf("got %v, want exactly {nextcloud}", got)
}
var nilM *Manager
if nilM.UpdateHeldStacks() != nil {
t.Fatal("a nil manager must answer nil")
}
}