blob: 67126a350239c87a25ca8774d4f7bbc0e010b12e [file] [log] [blame]
Solio Sarabia60095ff2017-02-28 18:18:26 -06001# Copyright 2012 OpenStack Foundation
2# Copyright 2013 IBM Corp.
3# All Rights Reserved.
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may
6# not use this file except in compliance with the License. You may obtain
7# a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations
15# under the License.
16
17# NOTE(soliosg) Do not edit this file. It will only stay temporarily
18# in ironic, while QA refactors the tempest.scenario interface. This
19# file was copied from openstack/tempest/tempest/scenario/manager.py,
20# openstack/tempest commit: 82a278e88c9e9f9ba49f81c1f8dba0bca7943daf
21
Solio Sarabia60095ff2017-02-28 18:18:26 -060022from oslo_log import log
Solio Sarabia60095ff2017-02-28 18:18:26 -060023from tempest import config
Roman Popelka082919c2022-03-17 11:44:31 +010024from tempest.scenario import manager
Solio Sarabia60095ff2017-02-28 18:18:26 -060025
26CONF = config.CONF
27
28LOG = log.getLogger(__name__)
29
30
Roman Popelka082919c2022-03-17 11:44:31 +010031class ScenarioTest(manager.ScenarioTest):
Solio Sarabia60095ff2017-02-28 18:18:26 -060032 """Base class for scenario tests. Uses tempest own clients. """
33
Julia Kreger3a07c4d2021-06-22 10:27:56 -070034 credentials = ['primary', 'admin', 'system_admin']
Solio Sarabia60095ff2017-02-28 18:18:26 -060035
Solio Sarabia60095ff2017-02-28 18:18:26 -060036 # ## Test functions library
37 #
38 # The create_[resource] functions only return body and discard the
39 # resp part which is not used in scenario tests
40
Solio Sarabia60095ff2017-02-28 18:18:26 -060041
Roman Popelka082919c2022-03-17 11:44:31 +010042class NetworkScenarioTest(manager.NetworkScenarioTest):
Solio Sarabia60095ff2017-02-28 18:18:26 -060043 """Base class for network scenario tests.
44
45 This class provide helpers for network scenario tests, using the neutron
46 API. Helpers from ancestor which use the nova network API are overridden
47 with the neutron API.
48
49 This Class also enforces using Neutron instead of novanetwork.
50 Subclassed tests will be skipped if Neutron is not enabled
51
52 """
53
Julia Kreger3a07c4d2021-06-22 10:27:56 -070054 credentials = ['primary', 'admin', 'system_admin']
Solio Sarabia60095ff2017-02-28 18:18:26 -060055
56 @classmethod
57 def skip_checks(cls):
58 super(NetworkScenarioTest, cls).skip_checks()
59 if not CONF.service_available.neutron:
60 raise cls.skipException('Neutron not available')