From 821bde33d60a85d5a25aafefeab705e5d8ab575c Mon Sep 17 00:00:00 2001 From: vgusev Date: Wed, 15 Jun 2016 15:39:58 +0300 Subject: [PATCH] Add test with Heat notifications Change-Id: I6d238b75ab9bdb563d1db57906998f7f8b6ce308 --- stacklight_tests/toolchain/api.py | 34 +++++++++++++++++++ stacklight_tests/toolchain/test_functional.py | 21 ++++++++++++ 2 files changed, 55 insertions(+) diff --git a/stacklight_tests/toolchain/api.py b/stacklight_tests/toolchain/api.py index 3de419f..6f0bdff 100644 --- a/stacklight_tests/toolchain/api.py +++ b/stacklight_tests/toolchain/api.py @@ -245,3 +245,37 @@ class ToolchainApi(object): [hit["_source"]["event_type"] for hit in output["hits"]["hits"]])) self.helpers.check_notifications(notification_list, keystone_event_types) + + def check_heat_notifications(self): + heat_event_types = [ + "orchestration.stack.check.start", + "orchestration.stack.check.end", + "orchestration.stack.create.start", + "orchestration.stack.create.end", + "orchestration.stack.delete.start", + "orchestration.stack.delete.end", + "orchestration.stack.resume.start", + "orchestration.stack.resume.end", + "orchestration.stack.rollback.start", + "orchestration.stack.rollback.end", + "orchestration.stack.suspend.start", + "orchestration.stack.suspend.end" + ] + test_class_main = ('fuel_health.tests.tests_platform.test_heat.' + 'HeatSmokeTests') + + test_names = ['test_actions', 'test_advanced_actions', 'test_rollback'] + + test_classes = [] + + for test_name in test_names: + test_classes.append('{0}.{1}'.format(test_class_main, test_name)) + + for test_name in test_classes: + self.helpers.run_single_ostf( + test_sets=['smoke'], test_name=test_name) + output = self.ELASTICSEARCH_KIBANA.query_elasticsearch( + index_type="notification", query_filter="Logger:heat", size=500) + notification_list = list(set( + [hit["_source"]["event_type"] for hit in output["hits"]["hits"]])) + self.helpers.check_notifications(notification_list, heat_event_types) diff --git a/stacklight_tests/toolchain/test_functional.py b/stacklight_tests/toolchain/test_functional.py index 94c511b..5de92b9 100644 --- a/stacklight_tests/toolchain/test_functional.py +++ b/stacklight_tests/toolchain/test_functional.py @@ -170,3 +170,24 @@ class TestFunctionalToolchain(api.ToolchainApi): self.check_plugins_online() self.check_keystone_notifications() + + @test(depends_on_groups=["deploy_toolchain"], + groups=["check_heat_notifications_toolchain", "toolchain", + "functional", "query_elasticsearch"]) + @log_snapshot_after_test + def check_heat_notifications_toolchain(self): + """Check that Heat notifications are present in Elasticsearch + + Scenario: + 1. Revert snapshot with 3 deployed nodes + 2. Run OSTF Heat platform tests + 3. Check that Heat notifications are present in current + Elasticsearch index + + Duration 25m + """ + self.env.revert_snapshot("deploy_toolchain") + + self.check_plugins_online() + + self.check_heat_notifications()