Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 1 | # Copyright 2016 Mirantis, Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | |
| 15 | import pytest |
| 16 | |
| 17 | from tcp_tests.managers import rallymanager |
| 18 | |
| 19 | |
| 20 | @pytest.fixture(scope='function') |
Dennis Dmitriev | 2d643bc | 2017-12-04 12:23:47 +0200 | [diff] [blame^] | 21 | def rally(request, config, underlay): |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 22 | """Fixture that provides various actions for TCP |
| 23 | |
Dennis Dmitriev | 2d643bc | 2017-12-04 12:23:47 +0200 | [diff] [blame^] | 24 | :param request: fixture provides pytest data |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 25 | :param config: fixture provides oslo.config |
| 26 | :param underlay: fixture provides underlay manager |
| 27 | :rtype: RallyManager |
| 28 | |
| 29 | For use in tests or fixtures to deploy a custom TCP |
| 30 | """ |
Dennis Dmitriev | 2d643bc | 2017-12-04 12:23:47 +0200 | [diff] [blame^] | 31 | with_rally = request.keywords.get('with_rally', None) |
| 32 | rally_node = "gtw01." |
| 33 | if with_rally: |
| 34 | rally_node = with_rally.kwargs.get("rally_node", "gtw01.") |
| 35 | |
| 36 | return rallymanager.RallyManager(underlay, rally_node) |