blob: 335ab88ae4d4e0ccf6ecae3ea36da359981d6bad [file] [log] [blame]
Dennis Dmitriev6f59add2016-10-18 13:45:27 +03001# 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
15import pytest
16
17from tcp_tests.managers import rallymanager
18
19
20@pytest.fixture(scope='function')
Dennis Dmitriev2d643bc2017-12-04 12:23:47 +020021def rally(request, config, underlay):
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030022 """Fixture that provides various actions for TCP
23
Dennis Dmitriev2d643bc2017-12-04 12:23:47 +020024 :param request: fixture provides pytest data
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030025 :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 Dmitriev2d643bc2017-12-04 12:23:47 +020031 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)