From 7132e33590faed972b093f8229f67aad6b7b6ca9 Mon Sep 17 00:00:00 2001 From: Ivan Kolodyazhny Date: Sat, 22 Dec 2018 23:12:33 +0200 Subject: [PATCH] Delete unused code This patch removes some unused code and empty setUp/tearDown/etc methods. It's not required at this point but since I'm refactoring the code let's make our codebase a bit smaller. Change-Id: Id12d552e0635479cfa84af7bcb35fbe3529a5c31 --- vitrage_tempest_plugin/__init__.py | 15 ----------- vitrage_tempest_plugin/tests/__init__.py | 15 ----------- vitrage_tempest_plugin/tests/api/__init__.py | 15 ----------- .../tests/api/alarms/__init__.py | 15 ----------- .../tests/api/alarms/test_alarms.py | 6 ----- .../tests/api/event/__init__.py | 15 ----------- .../tests/api/event/base.py | 5 ---- .../tests/api/rca/__init__.py | 15 ----------- vitrage_tempest_plugin/tests/api/rca/base.py | 10 ------- .../tests/api/rca/test_rca.py | 6 ----- .../tests/api/resources/test_resources.py | 10 ------- .../tests/api/templates/__init__.py | 15 ----------- .../tests/api/templates/base.py | 10 ------- .../tests/api/templates/test_template.py | 6 ----- .../tests/api/templates/test_template_v2.py | 4 --- .../tests/api/topology/__init__.py | 15 ----------- .../tests/api/topology/base.py | 10 ------- .../tests/api/topology/test_topology.py | 10 ------- .../tests/api/webhook/__init__.py | 15 ----------- vitrage_tempest_plugin/tests/base.py | 17 +++--------- .../tests/common/__init__.py | 15 ----------- .../tests/common/ceilometer_utils.py | 1 + .../tests/common/vitrage_utils.py | 9 ++----- .../tests/datasources/__init__.py | 15 ----------- .../tests/datasources/test_aodh.py | 10 ------- .../tests/datasources/test_cinder_volume.py | 10 ------- .../tests/datasources/test_heat_stack.py | 10 ------- .../tests/datasources/test_neutron.py | 10 ------- .../tests/datasources/test_nova.py | 10 ------- .../tests/datasources/test_static.py | 10 ------- vitrage_tempest_plugin/tests/e2e/__init__.py | 15 ----------- .../tests/e2e/test_actions_base.py | 6 ----- .../tests/e2e/test_basic_actions.py | 6 ----- .../tests/e2e/test_basic_template_actions.py | 3 --- .../tests/e2e/test_e2e_webhook.py | 3 --- .../tests/e2e/test_overlapping_actions.py | 6 ----- .../tests/notifiers/__init__.py | 15 ----------- .../tests/notifiers/test_mistral_notifier.py | 6 ----- vitrage_tempest_plugin/tests/utils.py | 27 ------------------- 39 files changed, 6 insertions(+), 410 deletions(-) diff --git a/vitrage_tempest_plugin/__init__.py b/vitrage_tempest_plugin/__init__.py index dd32b85..e69de29 100644 --- a/vitrage_tempest_plugin/__init__.py +++ b/vitrage_tempest_plugin/__init__.py @@ -1,15 +0,0 @@ -# Copyright 2016 - Nokia -# -# 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. - -__author__ = 'stack' diff --git a/vitrage_tempest_plugin/tests/__init__.py b/vitrage_tempest_plugin/tests/__init__.py index dd32b85..e69de29 100644 --- a/vitrage_tempest_plugin/tests/__init__.py +++ b/vitrage_tempest_plugin/tests/__init__.py @@ -1,15 +0,0 @@ -# Copyright 2016 - Nokia -# -# 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. - -__author__ = 'stack' diff --git a/vitrage_tempest_plugin/tests/api/__init__.py b/vitrage_tempest_plugin/tests/api/__init__.py index dd32b85..e69de29 100644 --- a/vitrage_tempest_plugin/tests/api/__init__.py +++ b/vitrage_tempest_plugin/tests/api/__init__.py @@ -1,15 +0,0 @@ -# Copyright 2016 - Nokia -# -# 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. - -__author__ = 'stack' diff --git a/vitrage_tempest_plugin/tests/api/alarms/__init__.py b/vitrage_tempest_plugin/tests/api/alarms/__init__.py index dd32b85..e69de29 100644 --- a/vitrage_tempest_plugin/tests/api/alarms/__init__.py +++ b/vitrage_tempest_plugin/tests/api/alarms/__init__.py @@ -1,15 +0,0 @@ -# Copyright 2016 - Nokia -# -# 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. - -__author__ = 'stack' diff --git a/vitrage_tempest_plugin/tests/api/alarms/test_alarms.py b/vitrage_tempest_plugin/tests/api/alarms/test_alarms.py index a773eb9..e08e4bb 100644 --- a/vitrage_tempest_plugin/tests/api/alarms/test_alarms.py +++ b/vitrage_tempest_plugin/tests/api/alarms/test_alarms.py @@ -35,12 +35,6 @@ LOG = logging.getLogger(__name__) class TestAlarms(BaseAlarmsTest): """Alarms test class for Vitrage API tests.""" - def setUp(self): - super(TestAlarms, self).setUp() - - def tearDown(self): - super(TestAlarms, self).tearDown() - @classmethod def setUpClass(cls): super(TestAlarms, cls).setUpClass() diff --git a/vitrage_tempest_plugin/tests/api/event/__init__.py b/vitrage_tempest_plugin/tests/api/event/__init__.py index bf9f61d..e69de29 100644 --- a/vitrage_tempest_plugin/tests/api/event/__init__.py +++ b/vitrage_tempest_plugin/tests/api/event/__init__.py @@ -1,15 +0,0 @@ -# Copyright 2017 - Nokia -# -# 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. - -__author__ = 'stack' diff --git a/vitrage_tempest_plugin/tests/api/event/base.py b/vitrage_tempest_plugin/tests/api/event/base.py index a3cc9fb..322c7ae 100644 --- a/vitrage_tempest_plugin/tests/api/event/base.py +++ b/vitrage_tempest_plugin/tests/api/event/base.py @@ -22,11 +22,6 @@ LOG = logging.getLogger(__name__) class BaseTestEvents(TestActionsBase): """Test class for Vitrage event API""" - # noinspection PyPep8Naming - @classmethod - def setUpClass(cls): - super(BaseTestEvents, cls).setUpClass() - def _check_alarms(self): api_alarms = self.vitrage_client.alarm.list(vitrage_id='all', all_tenants=True) diff --git a/vitrage_tempest_plugin/tests/api/rca/__init__.py b/vitrage_tempest_plugin/tests/api/rca/__init__.py index dd32b85..e69de29 100644 --- a/vitrage_tempest_plugin/tests/api/rca/__init__.py +++ b/vitrage_tempest_plugin/tests/api/rca/__init__.py @@ -1,15 +0,0 @@ -# Copyright 2016 - Nokia -# -# 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. - -__author__ = 'stack' diff --git a/vitrage_tempest_plugin/tests/api/rca/base.py b/vitrage_tempest_plugin/tests/api/rca/base.py index fda2b29..0e2ea9d 100644 --- a/vitrage_tempest_plugin/tests/api/rca/base.py +++ b/vitrage_tempest_plugin/tests/api/rca/base.py @@ -45,16 +45,6 @@ VITRAGE_ALARM_NAME = 'instance_deduce' class BaseRcaTest(BaseAlarmsTest): - def setUp(self): - super(BaseRcaTest, self).setUp() - - def tearDown(self): - super(BaseRcaTest, self).tearDown() - - @classmethod - def setUpClass(cls): - super(BaseRcaTest, cls).setUpClass() - def _clean_all(self): nova_utils.delete_all_instances() aodh_utils.delete_all_aodh_alarms() diff --git a/vitrage_tempest_plugin/tests/api/rca/test_rca.py b/vitrage_tempest_plugin/tests/api/rca/test_rca.py index 7a0aaf7..361c08c 100644 --- a/vitrage_tempest_plugin/tests/api/rca/test_rca.py +++ b/vitrage_tempest_plugin/tests/api/rca/test_rca.py @@ -32,12 +32,6 @@ LOG = logging.getLogger(__name__) class TestRca(BaseRcaTest): """RCA test class for Vitrage API tests.""" - def setUp(self): - super(TestRca, self).setUp() - - def tearDown(self): - super(TestRca, self).tearDown() - @classmethod def setUpClass(cls): super(TestRca, cls).setUpClass() diff --git a/vitrage_tempest_plugin/tests/api/resources/test_resources.py b/vitrage_tempest_plugin/tests/api/resources/test_resources.py index caaf254..95c4319 100644 --- a/vitrage_tempest_plugin/tests/api/resources/test_resources.py +++ b/vitrage_tempest_plugin/tests/api/resources/test_resources.py @@ -43,16 +43,6 @@ class TestResource(BaseVitrageTempest): VProps.STATE, VProps.VITRAGE_AGGREGATED_STATE) - def setUp(self): - super(TestResource, self).setUp() - - def tearDown(self): - super(TestResource, self).tearDown() - - @classmethod - def setUpClass(cls): - super(TestResource, cls).setUpClass() - @utils.tempest_logger def test_compare_cli_vs_api_resource_list(self): """resource list """ diff --git a/vitrage_tempest_plugin/tests/api/templates/__init__.py b/vitrage_tempest_plugin/tests/api/templates/__init__.py index dd32b85..e69de29 100644 --- a/vitrage_tempest_plugin/tests/api/templates/__init__.py +++ b/vitrage_tempest_plugin/tests/api/templates/__init__.py @@ -1,15 +0,0 @@ -# Copyright 2016 - Nokia -# -# 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. - -__author__ = 'stack' diff --git a/vitrage_tempest_plugin/tests/api/templates/base.py b/vitrage_tempest_plugin/tests/api/templates/base.py index 47fbb63..3a83330 100644 --- a/vitrage_tempest_plugin/tests/api/templates/base.py +++ b/vitrage_tempest_plugin/tests/api/templates/base.py @@ -40,16 +40,6 @@ class BaseTemplateTest(BaseVitrageTempest): OK_STATUS = 'validation OK' OK_MSG = 'Template validation is OK' - def setUp(self): - super(BaseTemplateTest, self).setUp() - - def tearDown(self): - super(BaseTemplateTest, self).tearDown() - - @classmethod - def setUpClass(cls): - super(BaseTemplateTest, cls).setUpClass() - def _compare_template_lists(self, api_templates, cli_templates): self.assertThat(api_templates, IsNotEmpty(), 'The template list taken from api is empty') diff --git a/vitrage_tempest_plugin/tests/api/templates/test_template.py b/vitrage_tempest_plugin/tests/api/templates/test_template.py index c6ecbcf..56fd4a9 100644 --- a/vitrage_tempest_plugin/tests/api/templates/test_template.py +++ b/vitrage_tempest_plugin/tests/api/templates/test_template.py @@ -42,12 +42,6 @@ FAKE_UUID = 'ade68276-0fe9-42cd-9ec2-e7f20470a771' class TestValidate(BaseTemplateTest): """Template test class for Vitrage API tests.""" - def setUp(self): - super(TestValidate, self).setUp() - - def tearDown(self): - super(TestValidate, self).tearDown() - @classmethod def setUpClass(cls): super(TestValidate, cls).setUpClass() diff --git a/vitrage_tempest_plugin/tests/api/templates/test_template_v2.py b/vitrage_tempest_plugin/tests/api/templates/test_template_v2.py index 0748190..64b6b8d 100644 --- a/vitrage_tempest_plugin/tests/api/templates/test_template_v2.py +++ b/vitrage_tempest_plugin/tests/api/templates/test_template_v2.py @@ -30,10 +30,6 @@ FAKE_UUID = 'ade68276-0fe9-42cd-9ec2-e7f20470a771' class TestValidateV2(BaseTemplateTest): """Template test class for Vitrage API tests.""" - @classmethod - def setUpClass(cls): - super(TestValidateV2, cls).setUpClass() - def test_templates_validate_no_type_templates(self): try: path = self.TEST_PATH + NO_TYPE_TEMPLATE diff --git a/vitrage_tempest_plugin/tests/api/topology/__init__.py b/vitrage_tempest_plugin/tests/api/topology/__init__.py index dd32b85..e69de29 100644 --- a/vitrage_tempest_plugin/tests/api/topology/__init__.py +++ b/vitrage_tempest_plugin/tests/api/topology/__init__.py @@ -1,15 +0,0 @@ -# Copyright 2016 - Nokia -# -# 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. - -__author__ = 'stack' diff --git a/vitrage_tempest_plugin/tests/api/topology/base.py b/vitrage_tempest_plugin/tests/api/topology/base.py index 1b73556..784bc4b 100644 --- a/vitrage_tempest_plugin/tests/api/topology/base.py +++ b/vitrage_tempest_plugin/tests/api/topology/base.py @@ -28,16 +28,6 @@ from vitrage_tempest_plugin.tests.common import nova_utils class BaseTopologyTest(BaseVitrageTempest): """Topology test class for Vitrage API tests.""" - def setUp(self): - super(BaseTopologyTest, self).setUp() - - def tearDown(self): - super(BaseTopologyTest, self).tearDown() - - @classmethod - def setUpClass(cls): - super(BaseTopologyTest, cls).setUpClass() - def _rollback_to_default(self): self._delete_entities() api_graph = self.vitrage_client.topology.get( diff --git a/vitrage_tempest_plugin/tests/api/topology/test_topology.py b/vitrage_tempest_plugin/tests/api/topology/test_topology.py index 5ed94aa..2988f9f 100644 --- a/vitrage_tempest_plugin/tests/api/topology/test_topology.py +++ b/vitrage_tempest_plugin/tests/api/topology/test_topology.py @@ -42,16 +42,6 @@ class TestTopology(BaseTopologyTest): NUM_INSTANCE = 3 NUM_VOLUME = 1 - def setUp(self): - super(TestTopology, self).setUp() - - def tearDown(self): - super(TestTopology, self).tearDown() - - @classmethod - def setUpClass(cls): - super(TestTopology, cls).setUpClass() - def _get_root_vertex_id(self): items = self.vitrage_client.resource.list( resource_type=OPENSTACK_CLUSTER, all_tenants=True) diff --git a/vitrage_tempest_plugin/tests/api/webhook/__init__.py b/vitrage_tempest_plugin/tests/api/webhook/__init__.py index bf9f61d..e69de29 100644 --- a/vitrage_tempest_plugin/tests/api/webhook/__init__.py +++ b/vitrage_tempest_plugin/tests/api/webhook/__init__.py @@ -1,15 +0,0 @@ -# Copyright 2017 - Nokia -# -# 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. - -__author__ = 'stack' diff --git a/vitrage_tempest_plugin/tests/base.py b/vitrage_tempest_plugin/tests/base.py index 8570e57..eeccb01 100644 --- a/vitrage_tempest_plugin/tests/base.py +++ b/vitrage_tempest_plugin/tests/base.py @@ -14,11 +14,9 @@ from datetime import datetime import json -from networkx.readwrite import json_graph import six -import sys -import traceback +from networkx.readwrite import json_graph from oslo_log import log as logging from oslo_utils import timeutils from oslotest import base @@ -76,18 +74,10 @@ class BaseVitrageTempest(base.BaseTestCase): ADMIN_PROJECT_NAME = 'admin' def assert_list_equal(self, l1, l2): - if tuple(sys.version_info)[0:2] < (2, 7): - # for python 2.6 compatibility - self.assertEqual(l1, l2) - else: - super(BaseVitrageTempest, self).assertListEqual(l1, l2) + self.assertListEqual(l1, l2) def assert_dict_equal(self, d1, d2, message): - if tuple(sys.version_info)[0:2] < (2, 7): - # for python 2.6 compatibility - self.assertEqual(d1, d2) - else: - super(BaseVitrageTempest, self).assertDictEqual(d1, d2, message) + self.assertDictEqual(d1, d2, message) def assert_timestamp_equal(self, first, second, msg=None): """Checks that two timestamps are equals. @@ -353,7 +343,6 @@ class BaseVitrageTempest(base.BaseTestCase): LOG.info('Entity Graph: \n%s', json.dumps(node_link_data)) def _handle_exception(self, exception): - traceback.print_exc() LOG.exception(exception) self._print_entity_graph() diff --git a/vitrage_tempest_plugin/tests/common/__init__.py b/vitrage_tempest_plugin/tests/common/__init__.py index bf9f61d..e69de29 100644 --- a/vitrage_tempest_plugin/tests/common/__init__.py +++ b/vitrage_tempest_plugin/tests/common/__init__.py @@ -1,15 +0,0 @@ -# Copyright 2017 - Nokia -# -# 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. - -__author__ = 'stack' diff --git a/vitrage_tempest_plugin/tests/common/ceilometer_utils.py b/vitrage_tempest_plugin/tests/common/ceilometer_utils.py index 2ab6363..e4da1b5 100644 --- a/vitrage_tempest_plugin/tests/common/ceilometer_utils.py +++ b/vitrage_tempest_plugin/tests/common/ceilometer_utils.py @@ -13,6 +13,7 @@ # under the License. import random import time + from vitrage_tempest_plugin.tests.common.tempest_clients import TempestClients diff --git a/vitrage_tempest_plugin/tests/common/vitrage_utils.py b/vitrage_tempest_plugin/tests/common/vitrage_utils.py index e7367a8..8f61fc8 100644 --- a/vitrage_tempest_plugin/tests/common/vitrage_utils.py +++ b/vitrage_tempest_plugin/tests/common/vitrage_utils.py @@ -51,13 +51,8 @@ def generate_fake_host_alarm(hostname, event_type, enabled=True): def get_first_host(**kwargs): - try: - hosts = TempestClients.vitrage().resource.list( - NOVA_HOST_DATASOURCE, all_tenants=True) - except Exception as e: - LOG.exception("get_first_host failed with %s", e) - hosts = TempestClients.vitrage().resource.list( - NOVA_HOST_DATASOURCE, all_tenants=True) + hosts = TempestClients.vitrage().resource.list( + NOVA_HOST_DATASOURCE, all_tenants=True) return g_utils.first_match(hosts, **kwargs) diff --git a/vitrage_tempest_plugin/tests/datasources/__init__.py b/vitrage_tempest_plugin/tests/datasources/__init__.py index dd32b85..e69de29 100644 --- a/vitrage_tempest_plugin/tests/datasources/__init__.py +++ b/vitrage_tempest_plugin/tests/datasources/__init__.py @@ -1,15 +0,0 @@ -# Copyright 2016 - Nokia -# -# 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. - -__author__ = 'stack' diff --git a/vitrage_tempest_plugin/tests/datasources/test_aodh.py b/vitrage_tempest_plugin/tests/datasources/test_aodh.py index d84564f..92925c1 100644 --- a/vitrage_tempest_plugin/tests/datasources/test_aodh.py +++ b/vitrage_tempest_plugin/tests/datasources/test_aodh.py @@ -27,16 +27,6 @@ class TestAodhAlarm(BaseAlarmsTest): NUM_INSTANCE = 1 NUM_ALARM = 1 - def setUp(self): - super(TestAodhAlarm, self).setUp() - - def tearDown(self): - super(TestAodhAlarm, self).tearDown() - - @classmethod - def setUpClass(cls): - super(TestAodhAlarm, cls).setUpClass() - @utils.tempest_logger def test_alarm_with_resource_id(self): try: diff --git a/vitrage_tempest_plugin/tests/datasources/test_cinder_volume.py b/vitrage_tempest_plugin/tests/datasources/test_cinder_volume.py index ea9af04..1358c06 100644 --- a/vitrage_tempest_plugin/tests/datasources/test_cinder_volume.py +++ b/vitrage_tempest_plugin/tests/datasources/test_cinder_volume.py @@ -23,16 +23,6 @@ class TestCinderVolume(BaseTopologyTest): NUM_INSTANCE = 3 NUM_VOLUME = 1 - def setUp(self): - super(TestCinderVolume, self).setUp() - - def tearDown(self): - super(TestCinderVolume, self).tearDown() - - @classmethod - def setUpClass(cls): - super(TestCinderVolume, cls).setUpClass() - @utils.tempest_logger def test_volume(self): try: diff --git a/vitrage_tempest_plugin/tests/datasources/test_heat_stack.py b/vitrage_tempest_plugin/tests/datasources/test_heat_stack.py index cc7c74f..f382503 100644 --- a/vitrage_tempest_plugin/tests/datasources/test_heat_stack.py +++ b/vitrage_tempest_plugin/tests/datasources/test_heat_stack.py @@ -28,16 +28,6 @@ LOG = logging.getLogger(__name__) class TestHeatStack(BaseTopologyTest): NUM_STACKS = 1 - def setUp(self): - super(TestHeatStack, self).setUp() - - def tearDown(self): - super(TestHeatStack, self).tearDown() - - @classmethod - def setUpClass(cls): - super(TestHeatStack, cls).setUpClass() - @utils.tempest_logger def test_nested_heat_stack(self): self._test_heat_stack(nested=True, diff --git a/vitrage_tempest_plugin/tests/datasources/test_neutron.py b/vitrage_tempest_plugin/tests/datasources/test_neutron.py index c7084e3..5fc63ca 100644 --- a/vitrage_tempest_plugin/tests/datasources/test_neutron.py +++ b/vitrage_tempest_plugin/tests/datasources/test_neutron.py @@ -27,16 +27,6 @@ LOG = logging.getLogger(__name__) class TestNeutron(BaseTopologyTest): NUM_INSTANCE = 3 - def setUp(self): - super(TestNeutron, self).setUp() - - def tearDown(self): - super(TestNeutron, self).tearDown() - - @classmethod - def setUpClass(cls): - super(TestNeutron, cls).setUpClass() - @utils.tempest_logger def test_neutron(self): """neutron test diff --git a/vitrage_tempest_plugin/tests/datasources/test_nova.py b/vitrage_tempest_plugin/tests/datasources/test_nova.py index b448cf9..8d309e2 100644 --- a/vitrage_tempest_plugin/tests/datasources/test_nova.py +++ b/vitrage_tempest_plugin/tests/datasources/test_nova.py @@ -22,16 +22,6 @@ LOG = logging.getLogger(__name__) class TestNova(BaseTopologyTest): NUM_INSTANCE = 3 - def setUp(self): - super(TestNova, self).setUp() - - def tearDown(self): - super(TestNova, self).tearDown() - - @classmethod - def setUpClass(cls): - super(TestNova, cls).setUpClass() - @utils.tempest_logger def test_nova_entities(self): try: diff --git a/vitrage_tempest_plugin/tests/datasources/test_static.py b/vitrage_tempest_plugin/tests/datasources/test_static.py index 12a0d66..40f12d3 100644 --- a/vitrage_tempest_plugin/tests/datasources/test_static.py +++ b/vitrage_tempest_plugin/tests/datasources/test_static.py @@ -29,16 +29,6 @@ class TestStatic(BaseVitrageTempest): NUM_SWITCH = 1 NUM_NIC = 1 - def setUp(self): - super(TestStatic, self).setUp() - - def tearDown(self): - super(TestStatic, self).tearDown() - - @classmethod - def setUpClass(cls): - super(TestStatic, cls).setUpClass() - @utils.tempest_logger def test_switches(self): try: diff --git a/vitrage_tempest_plugin/tests/e2e/__init__.py b/vitrage_tempest_plugin/tests/e2e/__init__.py index bf9f61d..e69de29 100644 --- a/vitrage_tempest_plugin/tests/e2e/__init__.py +++ b/vitrage_tempest_plugin/tests/e2e/__init__.py @@ -1,15 +0,0 @@ -# Copyright 2017 - Nokia -# -# 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. - -__author__ = 'stack' diff --git a/vitrage_tempest_plugin/tests/e2e/test_actions_base.py b/vitrage_tempest_plugin/tests/e2e/test_actions_base.py index 674df00..d50d569 100644 --- a/vitrage_tempest_plugin/tests/e2e/test_actions_base.py +++ b/vitrage_tempest_plugin/tests/e2e/test_actions_base.py @@ -27,12 +27,6 @@ LOG = logging.getLogger(__name__) class TestActionsBase(BaseVitrageTempest): - def setUp(self): - super(TestActionsBase, self).setUp() - - def tearDown(self): - super(TestActionsBase, self).tearDown() - @classmethod def setUpClass(cls): super(TestActionsBase, cls).setUpClass() diff --git a/vitrage_tempest_plugin/tests/e2e/test_basic_actions.py b/vitrage_tempest_plugin/tests/e2e/test_basic_actions.py index f29f229..301d826 100644 --- a/vitrage_tempest_plugin/tests/e2e/test_basic_actions.py +++ b/vitrage_tempest_plugin/tests/e2e/test_basic_actions.py @@ -55,12 +55,6 @@ class TestBasicActions(TestActionsBase): super(TestBasicActions, cls).setUpClass() cls._template = v_utils.add_template("e2e_test_basic_actions.yaml") - def setUp(self): - super(TestBasicActions, self).setUp() - - def tearDown(self): - super(TestBasicActions, self).tearDown() - @classmethod def tearDownClass(cls): if cls._template is not None: diff --git a/vitrage_tempest_plugin/tests/e2e/test_basic_template_actions.py b/vitrage_tempest_plugin/tests/e2e/test_basic_template_actions.py index f0b342e..73ff75d 100644 --- a/vitrage_tempest_plugin/tests/e2e/test_basic_template_actions.py +++ b/vitrage_tempest_plugin/tests/e2e/test_basic_template_actions.py @@ -58,9 +58,6 @@ class TestTemplateActions(TestActionsBase): super(TestTemplateActions, self).__init__(*args, **kwds) self.added_template = None - def setUp(self): - super(TestTemplateActions, self).setUp() - def tearDown(self): super(TestTemplateActions, self).tearDown() time.sleep(10) diff --git a/vitrage_tempest_plugin/tests/e2e/test_e2e_webhook.py b/vitrage_tempest_plugin/tests/e2e/test_e2e_webhook.py index 3541a24..1665b88 100644 --- a/vitrage_tempest_plugin/tests/e2e/test_e2e_webhook.py +++ b/vitrage_tempest_plugin/tests/e2e/test_e2e_webhook.py @@ -88,9 +88,6 @@ class TestWebhook(TestActionsBase): if cls._template is not None: v_utils.delete_template(cls._template['uuid']) - def setUp(self): - super(TestWebhook, self).setUp() - def tearDown(self): super(TestWebhook, self).tearDown() del messages[:] diff --git a/vitrage_tempest_plugin/tests/e2e/test_overlapping_actions.py b/vitrage_tempest_plugin/tests/e2e/test_overlapping_actions.py index e7ae3a9..a8f1ff6 100644 --- a/vitrage_tempest_plugin/tests/e2e/test_overlapping_actions.py +++ b/vitrage_tempest_plugin/tests/e2e/test_overlapping_actions.py @@ -62,12 +62,6 @@ class TestOverlappingActions(TestActionsBase): cls._template = v_utils.add_template( 'e2e_test_overlapping_actions.yaml') - def setUp(self): - super(TestOverlappingActions, self).setUp() - - def tearDown(self): - super(TestOverlappingActions, self).tearDown() - @classmethod def tearDownClass(cls): if cls._template is not None: diff --git a/vitrage_tempest_plugin/tests/notifiers/__init__.py b/vitrage_tempest_plugin/tests/notifiers/__init__.py index bf9f61d..e69de29 100644 --- a/vitrage_tempest_plugin/tests/notifiers/__init__.py +++ b/vitrage_tempest_plugin/tests/notifiers/__init__.py @@ -1,15 +0,0 @@ -# Copyright 2017 - Nokia -# -# 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. - -__author__ = 'stack' diff --git a/vitrage_tempest_plugin/tests/notifiers/test_mistral_notifier.py b/vitrage_tempest_plugin/tests/notifiers/test_mistral_notifier.py index 03bc5fd..0b7df6e 100644 --- a/vitrage_tempest_plugin/tests/notifiers/test_mistral_notifier.py +++ b/vitrage_tempest_plugin/tests/notifiers/test_mistral_notifier.py @@ -49,12 +49,6 @@ class TestMistralNotifier(BaseTestEvents): TRIGGER_ALARM_2 = "notifiers.mistral.trigger.alarm.2" TRIGGER_ALARM_FOR_FUNCTION = "notifiers.mistral.trigger.alarm.for.function" - def setUp(self): - super(TestMistralNotifier, self).setUp() - - def tearDown(self): - super(TestMistralNotifier, self).tearDown() - @classmethod def setUpClass(cls): super(TestMistralNotifier, cls).setUpClass() diff --git a/vitrage_tempest_plugin/tests/utils.py b/vitrage_tempest_plugin/tests/utils.py index c3e7ce0..5d7095c 100644 --- a/vitrage_tempest_plugin/tests/utils.py +++ b/vitrage_tempest_plugin/tests/utils.py @@ -21,7 +21,6 @@ from oslo_config.cfg import NoSuchOptError from oslo_log import log as logging import os -import re import subprocess LOG = logging.getLogger(__name__) @@ -29,13 +28,6 @@ LOG = logging.getLogger(__name__) TIMESTAMP_FORMAT = '%Y-%m-%dT%H:%M:%SZ' -def get_from_terminal(command): - proc = os.popen(command) - text_out = proc.read() - proc.close() - return text_out - - def run_vitrage_command(command, conf): # AUTH_URL local_ip = '127.0.0.1' @@ -118,25 +110,6 @@ def get_property_value(environment_name, conf_name, default_value, conf): return default_value -def run_from_terminal(command): - proc = os.popen(command) - proc.close() - - -def change_terminal_dir(path): - os.chdir(path) - LOG.debug("The path is : " + path) - - -def get_regex_result(pattern, text): - p = re.compile(pattern) - m = p.search(text) - if m: - LOG.debug("The regex value is " + m.group(1)) - return m.group(1) - return None - - def uni2str(text): return text.encode('ascii', 'ignore')