diff --git a/vitrage_tempest_plugin/tests/e2e/test_basic_actions.py b/vitrage_tempest_plugin/tests/e2e/test_basic_actions.py index d71c9c6..26932ba 100644 --- a/vitrage_tempest_plugin/tests/e2e/test_basic_actions.py +++ b/vitrage_tempest_plugin/tests/e2e/test_basic_actions.py @@ -41,6 +41,7 @@ TRIGGER_ALARM_2_V3 = 'e2e.test_basic_actions.trigger.alarm2.v3' TRIGGER_ALARM_3_V3 = 'e2e.test_basic_actions.trigger.alarm3.v3' TRIGGER_ALARM_4_V3 = 'e2e.test_basic_actions.trigger.alarm4.v3' TRIGGER_ALARM_5_V3 = 'e2e.test_basic_actions.trigger.alarm5.v3' +TRIGGER_ALARM_6_V3 = 'e2e.test_basic_actions.trigger.alarm6.v3' DEDUCED_V3 = 'e2e.test_basic_actions.deduced.alarm.v3' TRIGGER_ALARM_2_PROPS = { @@ -55,6 +56,12 @@ TRIGGER_ALARM_2_PROPS_V3 = { VProps.VITRAGE_TYPE: DOCTOR_DATASOURCE, } +TRIGGER_ALARM_6_PROPS_V3 = { + VProps.NAME: TRIGGER_ALARM_6_V3, + VProps.VITRAGE_CATEGORY: EntityCategory.ALARM, + VProps.VITRAGE_TYPE: DOCTOR_DATASOURCE, +} + DEDUCED_PROPS = { VProps.NAME: DEDUCED, VProps.VITRAGE_CATEGORY: EntityCategory.ALARM, @@ -249,6 +256,12 @@ class TestBasicActions(TestActionsBase): DEDUCED_PROPS_V3, TRIGGER_ALARM_2_PROPS_V3) + @utils.tempest_logger + def test_action_add_raise_alarm_with_causing_alarm(self): + self._do_test_action_add_causal_relationship(TRIGGER_ALARM_6_V3, + DEDUCED_PROPS_V3, + TRIGGER_ALARM_6_PROPS_V3) + def _do_test_action_add_causal_relationship(self, trigger_name, deduced_props, diff --git a/vitrage_tempest_plugin/tests/resources/templates/api/e2e_test_basic_actions_v3.yaml b/vitrage_tempest_plugin/tests/resources/templates/api/e2e_test_basic_actions_v3.yaml index 357c08b..5084941 100644 --- a/vitrage_tempest_plugin/tests/resources/templates/api/e2e_test_basic_actions_v3.yaml +++ b/vitrage_tempest_plugin/tests/resources/templates/api/e2e_test_basic_actions_v3.yaml @@ -14,6 +14,8 @@ entities: name: e2e.test_basic_actions.trigger.alarm4.v3 trigger_alarm_5: name: e2e.test_basic_actions.trigger.alarm5.v3 + trigger_alarm_6: + name: e2e.test_basic_actions.trigger.alarm6.v3 deduced_alarm: name: e2e.test_basic_actions.deduced.alarm.v3 type: vitrage @@ -37,7 +39,6 @@ scenarios: target: host alarm_name: e2e.test_basic_actions.deduced.alarm.v3 severity: WARNING -# causing_alarm: trigger_alarm_2 - condition: trigger_alarm_2 [ on ] host AND deduced_alarm [on] host actions: - add_causal_relationship: @@ -52,3 +53,10 @@ scenarios: actions: - mark_down: target: instance + - condition: trigger_alarm_6 [ on ] host + actions: + - raise_alarm: + target: host + alarm_name: e2e.test_basic_actions.deduced.alarm.v3 + severity: WARNING + causing_alarm: trigger_alarm_6