Files
felhom.eu/hub/internal/notify/os_alarms_operator_test.go
T

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)
}
}