Skip to content

Commit

Permalink
Fix alert unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Deezzir committed Dec 13, 2024
1 parent 2ec2541 commit 57eedfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unit/test_alert_rules/test_smart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ tests:
- interval: 1m
input_series:
- series: 'smartctl_device_attribute{device="sda", attribute_id="5", attribute_name="Reallocated_Sectors_Count", instance="ubuntu-2"}'
- series: 'smartctl_device_attribute{device="sda", attribute_id="5", attribute_name="Reallocated_Sectors_Count", instance="ubuntu-2", attribute_value_type="raw"}'
values: '2x10'

alert_rule_test:
Expand All @@ -187,7 +187,7 @@ tests:
SMART raw value for attribute "Reallocated_Sectors_Count" with id "5"
on device "sda" is greater than 0.
VALUE = 2
LABELS = map[__name__:smartctl_device_attribute attribute_id:5 attribute_name:Reallocated_Sectors_Count device:sda instance:ubuntu-2]
LABELS = map[__name__:smartctl_device_attribute attribute_id:5 attribute_name:Reallocated_Sectors_Count device:sda instance:ubuntu-2 attribute_value_type:raw]
- interval: 1m
input_series:
Expand Down Expand Up @@ -230,4 +230,4 @@ tests:
The NVMe drive has reached 90% of its estimated lifetime.
Note: A value of 100 does not indicate failure. For more details, visit https://charmhub.io/hardware-observer/docs/metrics-and-alerts-smart
VALUE = 95
LABELS = map[__name__:smartctl_device_percentage_used device:nvme instance:ubuntu-4]
LABELS = map[__name__:smartctl_device_percentage_used device:nvme instance:ubuntu-4]

0 comments on commit 57eedfe

Please sign in to comment.