Remove scenario manager

As tempest.scenario.manager was announced stable interface in Tempest
27.0.0[1] it can be now reused in plugins.

Replaced methods:
    * setup_clients

Etherpad concerning this effort:
https://etherpad.opendev.org/p/tempest-scenario-manager-cleanup

[1] https://docs.openstack.org/releasenotes/tempest/v27.0.0.html#release-notes-27-0-0

Change-Id: I393866ccc2ada996d11586850fe5e6215a68d14c
This commit is contained in:
Roman Popelka 2022-04-14 15:19:34 +02:00 committed by Martin Kopec
parent 7acd228725
commit 7631272221
2 changed files with 8 additions and 64 deletions

View File

@ -30,9 +30,10 @@ from tempest.lib.common import api_microversion_fixture
from tempest.lib.common.utils import data_utils from tempest.lib.common.utils import data_utils
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest.scenario import manager
from watcher_tempest_plugin import infra_optim_clients as clients from watcher_tempest_plugin import infra_optim_clients as clients
from watcher_tempest_plugin.tests.scenario import manager
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
CONF = config.CONF CONF = config.CONF
@ -48,6 +49,12 @@ class BaseInfraOptimScenarioTest(manager.ScenarioTest):
# States where the object can only be DELETED (end of its life-cycle) # States where the object can only be DELETED (end of its life-cycle)
AP_FINISHED_STATES = ('FAILED', 'SUCCEEDED', 'CANCELLED', 'SUPERSEDED') AP_FINISHED_STATES = ('FAILED', 'SUCCEEDED', 'CANCELLED', 'SUPERSEDED')
@classmethod
def skip_checks(cls):
super(manager.ScenarioTest, cls).skip_checks()
if not CONF.service_available.watcher:
raise cls.skipException('Watcher support is required')
@classmethod @classmethod
def setup_credentials(cls): def setup_credentials(cls):
cls._check_network_config() cls._check_network_config()

View File

@ -1,63 +0,0 @@
# Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp.
# All Rights Reserved.
#
# 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.
from tempest import config
import tempest.scenario.manager
CONF = config.CONF
class ScenarioTest(tempest.scenario.manager.ScenarioTest):
"""Base class for scenario tests. Uses tempest own clients. """
credentials = ['primary', 'admin']
@classmethod
def skip_checks(cls):
super(ScenarioTest, cls).skip_checks()
if not CONF.service_available.watcher:
raise cls.skipException('Watcher support is required')
@classmethod
def setup_clients(cls):
super(ScenarioTest, cls).setup_clients()
# Clients (in alphabetical order)
cls.flavors_client = cls.os_primary.flavors_client
cls.compute_floating_ips_client = (
cls.os_primary.compute_floating_ips_client)
cls.image_client = cls.os_primary.image_client_v2
# Compute image client
cls.compute_images_client = cls.os_primary.compute_images_client
cls.keypairs_client = cls.os_primary.keypairs_client
# Nova security groups client
cls.compute_security_groups_client = (
cls.os_primary.compute_security_groups_client)
cls.compute_security_group_rules_client = (
cls.os_primary.compute_security_group_rules_client)
cls.servers_client = cls.os_primary.servers_client
cls.interface_client = cls.os_primary.interfaces_client
# Neutron network client
cls.networks_client = cls.os_primary.networks_client
cls.ports_client = cls.os_primary.ports_client
cls.routers_client = cls.os_primary.routers_client
cls.subnets_client = cls.os_primary.subnets_client
cls.floating_ips_client = cls.os_primary.floating_ips_client
cls.security_groups_client = cls.os_primary.security_groups_client
cls.security_group_rules_client = (
cls.os_primary.security_group_rules_client)
cls.volumes_client = cls.os_primary.volumes_client_latest
cls.snapshots_client = cls.os_primary.snapshots_client_latest