88b0a2e761
gates / gates (push) Successful in 30s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
24 lines
969 B
Go
24 lines
969 B
Go
package notify
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gitea.dooplex.hu/admin/felhom-hub/internal/osupdates"
|
|
)
|
|
|
|
// Every OS-update event except the household's own line is operator-only (`11` §5.7, §8.3). An operator alarm left
|
|
// off this list reaches the customer as raw operator English. Red-proof: delete one alarm line from
|
|
// operatorOnlyEvents and this fails naming it.
|
|
func TestOSUpdateEvents_OperatorOnlyExceptApplied(t *testing.T) {
|
|
for _, e := range []string{osupdates.EventFailed, osupdates.EventHealthFailed, osupdates.EventReleaseApprove,
|
|
osupdates.EventApprovedNow, osupdates.EventSettings, osupdates.EventStale, osupdates.EventRebootNeeded,
|
|
osupdates.EventRing0Stalled, osupdates.EventNotCovered, "tunnel_down", "tunnel_recovered"} {
|
|
if !operatorOnlyEvents[e] {
|
|
t.Errorf("%s is not operator-only", e)
|
|
}
|
|
}
|
|
if operatorOnlyEvents[osupdates.EventApplied] {
|
|
t.Errorf("%s is the household's line and must NOT be operator-only", osupdates.EventApplied)
|
|
}
|
|
}
|