Solio Sarabia | 60095ff | 2017-02-28 18:18:26 -0600 | [diff] [blame] | 1 | # 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 Sarabia | 60095ff | 2017-02-28 18:18:26 -0600 | [diff] [blame] | 22 | from oslo_log import log |
Solio Sarabia | 60095ff | 2017-02-28 18:18:26 -0600 | [diff] [blame] | 23 | from tempest import config |
Roman Popelka | 082919c | 2022-03-17 11:44:31 +0100 | [diff] [blame] | 24 | from tempest.scenario import manager |
Solio Sarabia | 60095ff | 2017-02-28 18:18:26 -0600 | [diff] [blame] | 25 | |
| 26 | CONF = config.CONF |
| 27 | |
| 28 | LOG = log.getLogger(__name__) |
| 29 | |
| 30 | |
Roman Popelka | 082919c | 2022-03-17 11:44:31 +0100 | [diff] [blame] | 31 | class ScenarioTest(manager.ScenarioTest): |
Solio Sarabia | 60095ff | 2017-02-28 18:18:26 -0600 | [diff] [blame] | 32 | """Base class for scenario tests. Uses tempest own clients. """ |
| 33 | |
Julia Kreger | 3a07c4d | 2021-06-22 10:27:56 -0700 | [diff] [blame] | 34 | credentials = ['primary', 'admin', 'system_admin'] |
Solio Sarabia | 60095ff | 2017-02-28 18:18:26 -0600 | [diff] [blame] | 35 | |
Solio Sarabia | 60095ff | 2017-02-28 18:18:26 -0600 | [diff] [blame] | 36 | # ## 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 Sarabia | 60095ff | 2017-02-28 18:18:26 -0600 | [diff] [blame] | 41 | |
Roman Popelka | 082919c | 2022-03-17 11:44:31 +0100 | [diff] [blame] | 42 | class NetworkScenarioTest(manager.NetworkScenarioTest): |
Solio Sarabia | 60095ff | 2017-02-28 18:18:26 -0600 | [diff] [blame] | 43 | """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 Kreger | 3a07c4d | 2021-06-22 10:27:56 -0700 | [diff] [blame] | 54 | credentials = ['primary', 'admin', 'system_admin'] |
Solio Sarabia | 60095ff | 2017-02-28 18:18:26 -0600 | [diff] [blame] | 55 | |
| 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') |