don't forget to test alerts themselves

This commit is contained in:
Alex 2024-11-09 14:06:43 +03:00
parent 92ce59d6a3
commit 6fc68c20c5

View file

@ -201,6 +201,15 @@ def raid_check() -> list[alerts.Alert]:
)
continue
if IS_TESTING:
alert_list.append(
alerts.Alert(
alert_type=alerts.AlertType.RAID,
message=f"Test alert: LV {lv} health is {lv_attr.health}",
severity=alerts.Severity.INFO,
)
)
match lv_attr.health:
case LVAttr.Health.PARTIAL:
alert_list.append(
@ -255,7 +264,7 @@ def disk_wearout_check() -> list[alerts.Alert]:
logging.error(traceback.format_exc())
continue
if wearout_reading.current_reading < wearout_reading.threshold_reading:
if IS_TESTING or wearout_reading.current_reading < wearout_reading.threshold_reading:
match wearout_reading.indicator:
case WearoutIndicator.REALLOCATED_SECTORS:
message = f"Disk {disk['name']} has reallocated sectors (curr {wearout_reading.current_reading}, thresh {wearout_reading.threshold_reading})"