diff --git a/monasca_tempest_tests/tests/api/base.py b/monasca_tempest_tests/tests/api/base.py index d181e24f8..eaf10445b 100644 --- a/monasca_tempest_tests/tests/api/base.py +++ b/monasca_tempest_tests/tests/api/base.py @@ -30,40 +30,38 @@ class BaseMonascaTest(tempest.test.BaseTestCase): @classmethod def resource_setup(cls): super(BaseMonascaTest, cls).resource_setup() - # cls.os = clients.Manager() - # cls.monasca_client = cls.os.monasca_client - pass + cls.os = clients.Manager() + cls.monasca_client = cls.os.monasca_client @staticmethod def cleanup_resources(method, list_of_ids): - # for resource_id in list_of_ids: - # try: - # method(resource_id) - # except exceptions.NotFound: - # pass - pass + for resource_id in list_of_ids: + try: + method(resource_id) + except exceptions.NotFound: + pass @classmethod def resource_cleanup(cls): super(BaseMonascaTest, cls).resource_cleanup() -# resp, response_body = cls.monasca_client.list_alarm_definitions() -# elements = response_body['elements'] -# if elements: -# for element in elements: -# id = element['id'] -# cls.monasca_client.delete_alarm_definition(id) + resp, response_body = cls.monasca_client.list_alarm_definitions() + elements = response_body['elements'] + if elements: + for element in elements: + id = element['id'] + cls.monasca_client.delete_alarm_definition(id) -# resp, response_body = cls.monasca_client.list_notification_methods() -# elements = response_body['elements'] -# if elements: -# for element in elements: -# id = element['id'] -# cls.monasca_client.delete_notification_method(id) + resp, response_body = cls.monasca_client.list_notification_methods() + elements = response_body['elements'] + if elements: + for element in elements: + id = element['id'] + cls.monasca_client.delete_notification_method(id) + + resp, response_body = cls.monasca_client.list_alarms() + elements = response_body['elements'] + if elements: + for element in elements: + id = element['id'] + cls.monasca_client.delete_alarm(id) -# resp, response_body = cls.monasca_client.list_alarms() -# elements = response_body['elements'] -# if elements: -# for element in elements: -# id = element['id'] -# cls.monasca_client.delete_alarm(id) - pass diff --git a/monasca_tempest_tests_future/tests/api/test_alarm_definitions.py b/monasca_tempest_tests/tests/api/test_alarm_definitions.py similarity index 100% rename from monasca_tempest_tests_future/tests/api/test_alarm_definitions.py rename to monasca_tempest_tests/tests/api/test_alarm_definitions.py diff --git a/monasca_tempest_tests_future/tests/api/test_alarms.py b/monasca_tempest_tests/tests/api/test_alarms.py similarity index 100% rename from monasca_tempest_tests_future/tests/api/test_alarms.py rename to monasca_tempest_tests/tests/api/test_alarms.py diff --git a/monasca_tempest_tests_future/tests/api/test_alarms_state_history.py b/monasca_tempest_tests/tests/api/test_alarms_state_history.py similarity index 100% rename from monasca_tempest_tests_future/tests/api/test_alarms_state_history.py rename to monasca_tempest_tests/tests/api/test_alarms_state_history.py diff --git a/monasca_tempest_tests_future/tests/api/test_measurements.py b/monasca_tempest_tests/tests/api/test_measurements.py similarity index 100% rename from monasca_tempest_tests_future/tests/api/test_measurements.py rename to monasca_tempest_tests/tests/api/test_measurements.py diff --git a/monasca_tempest_tests_future/tests/api/test_metrics.py b/monasca_tempest_tests/tests/api/test_metrics.py similarity index 100% rename from monasca_tempest_tests_future/tests/api/test_metrics.py rename to monasca_tempest_tests/tests/api/test_metrics.py diff --git a/monasca_tempest_tests_future/tests/api/test_metrics_names.py b/monasca_tempest_tests/tests/api/test_metrics_names.py similarity index 100% rename from monasca_tempest_tests_future/tests/api/test_metrics_names.py rename to monasca_tempest_tests/tests/api/test_metrics_names.py diff --git a/monasca_tempest_tests_future/tests/api/test_notification_methods.py b/monasca_tempest_tests/tests/api/test_notification_methods.py similarity index 100% rename from monasca_tempest_tests_future/tests/api/test_notification_methods.py rename to monasca_tempest_tests/tests/api/test_notification_methods.py diff --git a/monasca_tempest_tests/tests/api/test_placeholder.py b/monasca_tempest_tests/tests/api/test_placeholder.py deleted file mode 100644 index 7cb54f694..000000000 --- a/monasca_tempest_tests/tests/api/test_placeholder.py +++ /dev/null @@ -1,33 +0,0 @@ -# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import datetime - -from oslo_serialization import jsonutils as json - -from monasca_tempest_tests.tests.api import base -from tempest import test - - -class TestPlaceholder(base.BaseMonascaTest): - - @classmethod - def resource_setup(cls): - super(TestPlaceholder, cls).resource_setup() - - @test.attr(type='gate') - def test_placeholder(self): - # Placeholder Test - self.assertTrue(1 == 1) - return diff --git a/monasca_tempest_tests_future/tests/api/test_statistics.py b/monasca_tempest_tests/tests/api/test_statistics.py similarity index 100% rename from monasca_tempest_tests_future/tests/api/test_statistics.py rename to monasca_tempest_tests/tests/api/test_statistics.py diff --git a/monasca_tempest_tests_future/tests/api/test_versions.py b/monasca_tempest_tests/tests/api/test_versions.py similarity index 100% rename from monasca_tempest_tests_future/tests/api/test_versions.py rename to monasca_tempest_tests/tests/api/test_versions.py