projects
/
osm
/
MON.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Adds support for storing and getting vim creds"
[osm/MON.git]
/
osm_mon
/
test
/
OpenStack
/
test_alarming.py
diff --git
a/osm_mon/test/OpenStack/test_alarming.py
b/osm_mon/test/OpenStack/test_alarming.py
index
92c21f6
..
effd920
100644
(file)
--- a/
osm_mon/test/OpenStack/test_alarming.py
+++ b/
osm_mon/test/OpenStack/test_alarming.py
@@
-204,18
+204,21
@@
class TestAlarming(unittest.TestCase):
values = {"severity": "warning",
"statistic": "COUNT",
"threshold_value": 12,
values = {"severity": "warning",
"statistic": "COUNT",
"threshold_value": 12,
- "operation": "GT"}
+ "operation": "GT",
+ "granularity": 300,
+ "resource_type": "generic"}
payload = self.alarming.check_payload(
payload = self.alarming.check_payload(
- values, "
my_metric
", "r_id", "alarm_name")
+ values, "
disk_write_ops
", "r_id", "alarm_name")
- self.assertEqual(
+ self.assert
Dict
Equal(
json.loads(payload), {"name": "alarm_name",
"gnocchi_resources_threshold_rule":
{"resource_id": "r_id",
json.loads(payload), {"name": "alarm_name",
"gnocchi_resources_threshold_rule":
{"resource_id": "r_id",
- "metric": "
my_metric
",
+ "metric": "
disk.disk_ops
",
"comparison_operator": "gt",
"aggregation_method": "count",
"threshold": 12,
"comparison_operator": "gt",
"aggregation_method": "count",
"threshold": 12,
+ "granularity": 300,
"resource_type": "generic"},
"severity": "low",
"state": "ok",
"resource_type": "generic"},
"severity": "low",
"state": "ok",
@@
-227,18
+230,21
@@
class TestAlarming(unittest.TestCase):
values = {"severity": "warning",
"statistic": "COUNT",
"threshold_value": 12,
values = {"severity": "warning",
"statistic": "COUNT",
"threshold_value": 12,
- "operation": "GT"}
+ "operation": "GT",
+ "granularity": 300,
+ "resource_type": "generic"}
payload = self.alarming.check_payload(
payload = self.alarming.check_payload(
- values, "
my_metric
", "r_id", "alarm_name", alarm_state="alarm")
+ values, "
disk_write_ops
", "r_id", "alarm_name", alarm_state="alarm")
self.assertEqual(
json.loads(payload), {"name": "alarm_name",
"gnocchi_resources_threshold_rule":
{"resource_id": "r_id",
self.assertEqual(
json.loads(payload), {"name": "alarm_name",
"gnocchi_resources_threshold_rule":
{"resource_id": "r_id",
- "metric": "
my_metric
",
+ "metric": "
disk.disk_ops
",
"comparison_operator": "gt",
"aggregation_method": "count",
"threshold": 12,
"comparison_operator": "gt",
"aggregation_method": "count",
"threshold": 12,
+ "granularity": 300,
"resource_type": "generic"},
"severity": "low",
"state": "alarm",
"resource_type": "generic"},
"severity": "low",
"state": "alarm",
@@
-270,4
+276,4
@@
class TestAlarming(unittest.TestCase):
self.alarming.check_for_metric(auth_token, "metric_name", "r_id")
perf_req.assert_called_with(
self.alarming.check_for_metric(auth_token, "metric_name", "r_id")
perf_req.assert_called_with(
- "gnocchi_endpoint/v1/metric
/
", auth_token, req_type="get")
+ "gnocchi_endpoint/v1/metric
?sort=name:asc
", auth_token, req_type="get")