From 6d36f4791a562b26fedc07fb389f3a3901b0a013 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Tue, 3 Nov 2015 10:42:52 -0700 Subject: [PATCH] Moved tempest tests back to monasca_tempest_tests folder Change-Id: I76cae8f3281fbb8c143115f2e61fa4fb7ecc3d72 --- monasca_tempest_tests/tests/api/base.py | 54 +++++++++---------- .../tests/api/test_alarm_definitions.py | 0 .../tests/api/test_alarms.py | 0 .../tests/api/test_alarms_state_history.py | 0 .../tests/api/test_measurements.py | 0 .../tests/api/test_metrics.py | 0 .../tests/api/test_metrics_names.py | 0 .../tests/api/test_notification_methods.py | 0 .../tests/api/test_placeholder.py | 33 ------------ .../tests/api/test_statistics.py | 0 .../tests/api/test_versions.py | 0 11 files changed, 26 insertions(+), 61 deletions(-) rename {monasca_tempest_tests_future => monasca_tempest_tests}/tests/api/test_alarm_definitions.py (100%) rename {monasca_tempest_tests_future => monasca_tempest_tests}/tests/api/test_alarms.py (100%) rename {monasca_tempest_tests_future => monasca_tempest_tests}/tests/api/test_alarms_state_history.py (100%) rename {monasca_tempest_tests_future => monasca_tempest_tests}/tests/api/test_measurements.py (100%) rename {monasca_tempest_tests_future => monasca_tempest_tests}/tests/api/test_metrics.py (100%) rename {monasca_tempest_tests_future => monasca_tempest_tests}/tests/api/test_metrics_names.py (100%) rename {monasca_tempest_tests_future => monasca_tempest_tests}/tests/api/test_notification_methods.py (100%) delete mode 100644 monasca_tempest_tests/tests/api/test_placeholder.py rename {monasca_tempest_tests_future => monasca_tempest_tests}/tests/api/test_statistics.py (100%) rename {monasca_tempest_tests_future => monasca_tempest_tests}/tests/api/test_versions.py (100%) 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