diff --git a/doc/source/plugins/implementation/context_plugin.rst b/doc/source/plugins/implementation/context_plugin.rst index 166b0dfa..0c80cc8d 100644 --- a/doc/source/plugins/implementation/context_plugin.rst +++ b/doc/source/plugins/implementation/context_plugin.rst @@ -40,7 +40,7 @@ implement the Context API: the *setup()* method that creates a flavor and the from rally.task import context from rally.common import logging from rally import consts - from rally import osclients + from rally.plugins.openstack import osclients LOG = logging.getLogger(__name__) diff --git a/doc/specs/implemented/verification_refactoring.rst b/doc/specs/implemented/verification_refactoring.rst index 9e72a04c..f01c889f 100644 --- a/doc/specs/implemented/verification_refactoring.rst +++ b/doc/specs/implemented/verification_refactoring.rst @@ -887,7 +887,7 @@ VerifierContext .. code-block:: python - from rally import osclients + from rally.plugins.openstack import osclients from rally.task import context diff --git a/rally/plugins/openstack/context/api_versions.py b/rally/plugins/openstack/context/api_versions.py index a6d50715..21526662 100644 --- a/rally/plugins/openstack/context/api_versions.py +++ b/rally/plugins/openstack/context/api_versions.py @@ -15,7 +15,7 @@ import random from rally.common import validation from rally import consts from rally import exceptions -from rally import osclients +from rally.plugins.openstack import osclients from rally.task import context diff --git a/rally/plugins/openstack/context/cinder/volume_types.py b/rally/plugins/openstack/context/cinder/volume_types.py index e8e54cf4..1bea9ff2 100644 --- a/rally/plugins/openstack/context/cinder/volume_types.py +++ b/rally/plugins/openstack/context/cinder/volume_types.py @@ -16,8 +16,8 @@ from rally.common import logging from rally.common import utils from rally.common import validation from rally import consts -from rally import osclients from rally.plugins.openstack.cleanup import manager as resource_manager +from rally.plugins.openstack import osclients from rally.plugins.openstack.services.storage import block from rally.task import context diff --git a/rally/plugins/openstack/context/cinder/volumes.py b/rally/plugins/openstack/context/cinder/volumes.py index ea1fcb8a..fe076761 100644 --- a/rally/plugins/openstack/context/cinder/volumes.py +++ b/rally/plugins/openstack/context/cinder/volumes.py @@ -14,8 +14,8 @@ from rally.common import utils as rutils from rally import consts -from rally import osclients from rally.plugins.openstack.cleanup import manager as resource_manager +from rally.plugins.openstack import osclients from rally.plugins.openstack.services.storage import block from rally.task import context diff --git a/rally/plugins/openstack/context/dataplane/heat.py b/rally/plugins/openstack/context/dataplane/heat.py index 8694e71d..a78828df 100644 --- a/rally/plugins/openstack/context/dataplane/heat.py +++ b/rally/plugins/openstack/context/dataplane/heat.py @@ -19,8 +19,8 @@ from rally.common import utils as rutils from rally.common import validation from rally import consts from rally import exceptions -from rally import osclients from rally.plugins.openstack.cleanup import manager as resource_manager +from rally.plugins.openstack import osclients from rally.plugins.openstack.scenarios.heat import utils as heat_utils from rally.task import context diff --git a/rally/plugins/openstack/context/ec2/servers.py b/rally/plugins/openstack/context/ec2/servers.py index 230ad7c9..6b23b5a7 100644 --- a/rally/plugins/openstack/context/ec2/servers.py +++ b/rally/plugins/openstack/context/ec2/servers.py @@ -15,8 +15,8 @@ from rally.common import logging from rally.common import utils as rutils from rally import consts -from rally import osclients from rally.plugins.openstack.cleanup import manager as resource_manager +from rally.plugins.openstack import osclients from rally.plugins.openstack.scenarios.ec2 import utils as ec2_utils from rally.plugins.openstack import types from rally.task import context diff --git a/rally/plugins/openstack/context/glance/images.py b/rally/plugins/openstack/context/glance/images.py index 03bb043d..53d2c7af 100644 --- a/rally/plugins/openstack/context/glance/images.py +++ b/rally/plugins/openstack/context/glance/images.py @@ -18,8 +18,8 @@ from rally.common import logging from rally.common import utils as rutils from rally.common import validation from rally import consts -from rally import osclients from rally.plugins.openstack.cleanup import manager as resource_manager +from rally.plugins.openstack import osclients from rally.plugins.openstack.services.image import image from rally.task import context diff --git a/rally/plugins/openstack/context/keystone/roles.py b/rally/plugins/openstack/context/keystone/roles.py index 13eabd78..1e4eb90b 100644 --- a/rally/plugins/openstack/context/keystone/roles.py +++ b/rally/plugins/openstack/context/keystone/roles.py @@ -20,7 +20,7 @@ from rally.common import logging from rally.common import validation from rally import consts from rally import exceptions -from rally import osclients +from rally.plugins.openstack import osclients from rally.plugins.openstack.services.identity import identity from rally.task import context diff --git a/rally/plugins/openstack/context/keystone/users.py b/rally/plugins/openstack/context/keystone/users.py index a2eab5fb..7bb1756d 100644 --- a/rally/plugins/openstack/context/keystone/users.py +++ b/rally/plugins/openstack/context/keystone/users.py @@ -25,8 +25,8 @@ from rally.common import utils as rutils from rally.common import validation from rally import consts from rally import exceptions -from rally import osclients from rally.plugins.openstack import credential +from rally.plugins.openstack import osclients from rally.plugins.openstack.services.identity import identity from rally.plugins.openstack.wrappers import network from rally.task import context diff --git a/rally/plugins/openstack/context/murano/murano_packages.py b/rally/plugins/openstack/context/murano/murano_packages.py index 2223abe7..38f428e9 100644 --- a/rally/plugins/openstack/context/murano/murano_packages.py +++ b/rally/plugins/openstack/context/murano/murano_packages.py @@ -21,8 +21,8 @@ from rally.common import utils from rally.common import validation from rally import consts from rally import exceptions -from rally import osclients from rally.plugins.openstack.cleanup import manager as resource_manager +from rally.plugins.openstack import osclients from rally.task import context diff --git a/rally/plugins/openstack/context/network/allow_ssh.py b/rally/plugins/openstack/context/network/allow_ssh.py index c4e1edb5..0a9c55d6 100644 --- a/rally/plugins/openstack/context/network/allow_ssh.py +++ b/rally/plugins/openstack/context/network/allow_ssh.py @@ -16,7 +16,7 @@ from rally.common import logging from rally.common import utils from rally.common import validation -from rally import osclients +from rally.plugins.openstack import osclients from rally.plugins.openstack.wrappers import network from rally.task import context diff --git a/rally/plugins/openstack/context/network/existing_network.py b/rally/plugins/openstack/context/network/existing_network.py index 2dcbb3e2..4c6fdbde 100644 --- a/rally/plugins/openstack/context/network/existing_network.py +++ b/rally/plugins/openstack/context/network/existing_network.py @@ -15,7 +15,7 @@ from rally.common import utils from rally.common import validation from rally import consts -from rally import osclients +from rally.plugins.openstack import osclients from rally.plugins.openstack.wrappers import network as network_wrapper from rally.task import context diff --git a/rally/plugins/openstack/context/network/networks.py b/rally/plugins/openstack/context/network/networks.py index d83f245e..26b572cc 100644 --- a/rally/plugins/openstack/context/network/networks.py +++ b/rally/plugins/openstack/context/network/networks.py @@ -17,7 +17,7 @@ from rally.common import logging from rally.common import utils from rally.common import validation from rally import consts -from rally import osclients +from rally.plugins.openstack import osclients from rally.plugins.openstack.wrappers import network as network_wrapper from rally.task import context diff --git a/rally/plugins/openstack/context/neutron/lbaas.py b/rally/plugins/openstack/context/neutron/lbaas.py index 347d4880..31f9cf68 100644 --- a/rally/plugins/openstack/context/neutron/lbaas.py +++ b/rally/plugins/openstack/context/neutron/lbaas.py @@ -14,7 +14,7 @@ from rally.common import logging from rally.common import utils from rally.common import validation from rally import consts -from rally import osclients +from rally.plugins.openstack import osclients from rally.plugins.openstack.wrappers import network as network_wrapper from rally.task import context diff --git a/rally/plugins/openstack/context/nova/flavors.py b/rally/plugins/openstack/context/nova/flavors.py index fb97c214..5b646a24 100644 --- a/rally/plugins/openstack/context/nova/flavors.py +++ b/rally/plugins/openstack/context/nova/flavors.py @@ -17,8 +17,8 @@ from rally.common import logging from rally.common import utils as rutils from rally.common import validation from rally import consts -from rally import osclients from rally.plugins.openstack.cleanup import manager as resource_manager +from rally.plugins.openstack import osclients from rally.task import context LOG = logging.getLogger(__name__) diff --git a/rally/plugins/openstack/context/nova/keypairs.py b/rally/plugins/openstack/context/nova/keypairs.py index a383d358..7ad344d7 100644 --- a/rally/plugins/openstack/context/nova/keypairs.py +++ b/rally/plugins/openstack/context/nova/keypairs.py @@ -14,8 +14,8 @@ # under the License. from rally.common import validation -from rally import osclients from rally.plugins.openstack.cleanup import manager as resource_manager +from rally.plugins.openstack import osclients from rally.task import context diff --git a/rally/plugins/openstack/context/nova/servers.py b/rally/plugins/openstack/context/nova/servers.py index ed44e894..590a8d0b 100755 --- a/rally/plugins/openstack/context/nova/servers.py +++ b/rally/plugins/openstack/context/nova/servers.py @@ -15,8 +15,8 @@ from rally.common import logging from rally.common import utils as rutils from rally.common import validation -from rally import osclients from rally.plugins.openstack.cleanup import manager as resource_manager +from rally.plugins.openstack import osclients from rally.plugins.openstack.scenarios.nova import utils as nova_utils from rally.plugins.openstack import types from rally.task import context diff --git a/rally/plugins/openstack/context/quotas/quotas.py b/rally/plugins/openstack/context/quotas/quotas.py index 429e2f49..642dfa44 100644 --- a/rally/plugins/openstack/context/quotas/quotas.py +++ b/rally/plugins/openstack/context/quotas/quotas.py @@ -16,12 +16,12 @@ from rally.common import logging from rally.common import validation from rally import consts -from rally import osclients from rally.plugins.openstack.context.quotas import cinder_quotas from rally.plugins.openstack.context.quotas import designate_quotas from rally.plugins.openstack.context.quotas import manila_quotas from rally.plugins.openstack.context.quotas import neutron_quotas from rally.plugins.openstack.context.quotas import nova_quotas +from rally.plugins.openstack import osclients from rally.task import context diff --git a/rally/plugins/openstack/context/sahara/sahara_image.py b/rally/plugins/openstack/context/sahara/sahara_image.py index 8883b7e4..9aa33fef 100644 --- a/rally/plugins/openstack/context/sahara/sahara_image.py +++ b/rally/plugins/openstack/context/sahara/sahara_image.py @@ -16,8 +16,8 @@ from rally.common import utils as rutils from rally.common import validation from rally import consts from rally import exceptions -from rally import osclients from rally.plugins.openstack.cleanup import manager as resource_manager +from rally.plugins.openstack import osclients from rally.plugins.openstack.scenarios.sahara import utils from rally.plugins.openstack.services.image import image as image_services from rally.task import context diff --git a/rally/plugins/openstack/context/sahara/sahara_input_data_sources.py b/rally/plugins/openstack/context/sahara/sahara_input_data_sources.py index 038eb4d5..6fc178c3 100644 --- a/rally/plugins/openstack/context/sahara/sahara_input_data_sources.py +++ b/rally/plugins/openstack/context/sahara/sahara_input_data_sources.py @@ -19,8 +19,8 @@ from six.moves.urllib import parse from rally.common import utils as rutils from rally.common import validation from rally import consts -from rally import osclients from rally.plugins.openstack.cleanup import manager as resource_manager +from rally.plugins.openstack import osclients from rally.plugins.openstack.scenarios.sahara import utils from rally.plugins.openstack.scenarios.swift import utils as swift_utils from rally.task import context diff --git a/rally/plugins/openstack/context/sahara/sahara_job_binaries.py b/rally/plugins/openstack/context/sahara/sahara_job_binaries.py index f5e82d5b..4bd6bc39 100644 --- a/rally/plugins/openstack/context/sahara/sahara_job_binaries.py +++ b/rally/plugins/openstack/context/sahara/sahara_job_binaries.py @@ -19,8 +19,8 @@ from rally.common import utils as rutils from rally.common import validation from rally import consts from rally import exceptions -from rally import osclients from rally.plugins.openstack.cleanup import manager as resource_manager +from rally.plugins.openstack import osclients from rally.plugins.openstack.scenarios.sahara import utils from rally.task import context diff --git a/rally/plugins/openstack/context/sahara/sahara_output_data_sources.py b/rally/plugins/openstack/context/sahara/sahara_output_data_sources.py index f0cdb867..8e4367fb 100644 --- a/rally/plugins/openstack/context/sahara/sahara_output_data_sources.py +++ b/rally/plugins/openstack/context/sahara/sahara_output_data_sources.py @@ -16,8 +16,8 @@ from rally.common import utils as rutils from rally.common import validation from rally import consts -from rally import osclients from rally.plugins.openstack.cleanup import manager as resource_manager +from rally.plugins.openstack import osclients from rally.plugins.openstack.scenarios.sahara import utils from rally.plugins.openstack.scenarios.swift import utils as swift_utils from rally.task import context diff --git a/rally/plugins/openstack/context/vm/custom_image.py b/rally/plugins/openstack/context/vm/custom_image.py index 15186528..2eb06660 100644 --- a/rally/plugins/openstack/context/vm/custom_image.py +++ b/rally/plugins/openstack/context/vm/custom_image.py @@ -21,7 +21,7 @@ from rally.common import broker from rally.common import logging from rally.common import utils from rally import consts -from rally import osclients +from rally.plugins.openstack import osclients from rally.plugins.openstack.scenarios.vm import vmtasks from rally.plugins.openstack.services.image import image from rally.plugins.openstack import types diff --git a/rally/plugins/openstack/context/watcher/audit_templates.py b/rally/plugins/openstack/context/watcher/audit_templates.py index 0a2f8a38..e53ee524 100644 --- a/rally/plugins/openstack/context/watcher/audit_templates.py +++ b/rally/plugins/openstack/context/watcher/audit_templates.py @@ -18,8 +18,8 @@ import six from rally.common import validation from rally import consts -from rally import osclients from rally.plugins.openstack.cleanup import manager as resource_manager +from rally.plugins.openstack import osclients from rally.plugins.openstack.scenarios.watcher import utils as watcher_utils from rally.plugins.openstack import types from rally.task import context diff --git a/rally/plugins/openstack/credential.py b/rally/plugins/openstack/credential.py index 6db45a5e..0880b7ff 100644 --- a/rally/plugins/openstack/credential.py +++ b/rally/plugins/openstack/credential.py @@ -16,7 +16,7 @@ from rally.common import logging from rally import consts from rally.deployment import credential -from rally import osclients +from rally.plugins.openstack import osclients LOG = logging.getLogger(__file__) diff --git a/rally/plugins/openstack/scenario.py b/rally/plugins/openstack/scenario.py index 5a37e835..eba56569 100644 --- a/rally/plugins/openstack/scenario.py +++ b/rally/plugins/openstack/scenario.py @@ -19,7 +19,7 @@ import random from oslo_config import cfg from osprofiler import profiler from rally.common.plugin import plugin -from rally import osclients +from rally.plugins.openstack import osclients from rally.task import context from rally.task import scenario diff --git a/rally/plugins/openstack/services/identity/keystone_common.py b/rally/plugins/openstack/services/identity/keystone_common.py index 49e6b9c7..2c2b2e9c 100644 --- a/rally/plugins/openstack/services/identity/keystone_common.py +++ b/rally/plugins/openstack/services/identity/keystone_common.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from rally import osclients +from rally.plugins.openstack import osclients from rally.plugins.openstack.services.identity import identity from rally.task import atomic diff --git a/rally/plugins/openstack/wrappers/network.py b/rally/plugins/openstack/wrappers/network.py index f9796464..6301bc28 100644 --- a/rally/plugins/openstack/wrappers/network.py +++ b/rally/plugins/openstack/wrappers/network.py @@ -67,7 +67,7 @@ class NetworkWrapper(object): def __init__(self, clients, owner, config=None): """Returns available network wrapper instance. - :param clients: rally.osclients.Clients instance + :param clients: rally.plugins.openstack.osclients.Clients instance :param owner: The object that owns resources created by this wrapper instance. It will be used to generate random names, so must implement @@ -378,7 +378,7 @@ class NeutronWrapper(NetworkWrapper): def wrap(clients, owner, config=None): """Returns available network wrapper instance. - :param clients: rally.osclients.Clients instance + :param clients: rally.plugins.openstack.osclients.Clients instance :param owner: The object that owns resources created by this wrapper instance. It will be used to generate random names, so must implement diff --git a/tests/unit/plugins/openstack/context/glance/test_images.py b/tests/unit/plugins/openstack/context/glance/test_images.py index d89654a0..1fc0af92 100644 --- a/tests/unit/plugins/openstack/context/glance/test_images.py +++ b/tests/unit/plugins/openstack/context/glance/test_images.py @@ -65,7 +65,7 @@ class ImageGeneratorTestCase(test.ScenarioTestCase): {"tenants": 3, "users_per_tenant": 2, "images_per_tenant": 5}, {"api_versions": {"glance": {"version": 2, "service_type": "image"}}}) @ddt.unpack - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test_setup(self, mock_clients, container_format="bare", disk_format="qcow2", image_url="http://example.com/fake/url", diff --git a/tests/unit/plugins/openstack/context/manila/test_manila_share_networks.py b/tests/unit/plugins/openstack/context/manila/test_manila_share_networks.py index 12296f5f..ec5423fe 100644 --- a/tests/unit/plugins/openstack/context/manila/test_manila_share_networks.py +++ b/tests/unit/plugins/openstack/context/manila/test_manila_share_networks.py @@ -24,8 +24,8 @@ from rally.plugins.openstack.context.manila import consts from rally.plugins.openstack.context.manila import manila_share_networks from tests.unit import test -MANILA_UTILS_PATH = ("rally.plugins.openstack.scenarios.manila.utils." - "ManilaScenario.") +MANILA_UTILS_PATH = ( + "rally.plugins.openstack.scenarios.manila.utils.ManilaScenario.") MOCK_USER_CREDENTIAL = mock.MagicMock() @@ -167,7 +167,7 @@ class ShareNetworksTestCase(test.TestCase): self.assertEqual(expected_ctxt, inst.context) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") @mock.patch(MANILA_UTILS_PATH + "_list_share_networks") def test_setup_use_existing_share_networks( self, mock_manila_scenario__list_share_networks, mock_clients): @@ -215,7 +215,7 @@ class ShareNetworksTestCase(test.TestCase): self.assertRaises(exceptions.ContextSetupFailure, inst.setup) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") @mock.patch(MANILA_UTILS_PATH + "_list_share_networks") def test_setup_use_existing_share_networks_sn_not_found( self, mock_manila_scenario__list_share_networks, mock_clients): @@ -237,7 +237,7 @@ class ShareNetworksTestCase(test.TestCase): self.assertRaises(exceptions.ContextSetupFailure, inst.setup) @ddt.data(True, False) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") @mock.patch(MANILA_UTILS_PATH + "_create_share_network") @mock.patch(MANILA_UTILS_PATH + "_add_security_service_to_share_network") def test_setup_autocreate_share_networks_with_security_services( @@ -295,7 +295,7 @@ class ShareNetworksTestCase(test.TestCase): for i in range(self.TENANTS_AMOUNT)]) @ddt.data(True, False) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") @mock.patch(MANILA_UTILS_PATH + "_create_share_network") @mock.patch(MANILA_UTILS_PATH + "_add_security_service_to_share_network") def test_setup_autocreate_share_networks_wo_security_services( @@ -332,7 +332,7 @@ class ShareNetworksTestCase(test.TestCase): mock_clients.assert_has_calls([mock.call(MOCK_USER_CREDENTIAL, {}) for i in range(self.TENANTS_AMOUNT)]) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") @mock.patch(MANILA_UTILS_PATH + "_create_share_network") @mock.patch(MANILA_UTILS_PATH + "_add_security_service_to_share_network") def test_setup_autocreate_share_networks_wo_networks( @@ -357,7 +357,7 @@ class ShareNetworksTestCase(test.TestCase): mock_clients.assert_has_calls([mock.call(MOCK_USER_CREDENTIAL, {}) for i in range(self.TENANTS_AMOUNT)]) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") @mock.patch(MANILA_UTILS_PATH + "_delete_share_network") @mock.patch(MANILA_UTILS_PATH + "_list_share_servers") @mock.patch(MANILA_UTILS_PATH + "_list_share_networks") diff --git a/tests/unit/plugins/openstack/context/network/test_network.py b/tests/unit/plugins/openstack/context/network/test_network.py index 1ca55883..b87fab66 100644 --- a/tests/unit/plugins/openstack/context/network/test_network.py +++ b/tests/unit/plugins/openstack/context/network/test_network.py @@ -37,7 +37,7 @@ class NetworkTestCase(test.TestCase): def test_START_CIDR_DFLT(self): netaddr.IPNetwork(network_context.Network.DEFAULT_CONFIG["start_cidr"]) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") @mock.patch(NET + "wrap", return_value="foo_service") def test__init__default(self, mock_wrap, mock_clients): context = network_context.Network(self.get_context()) @@ -46,7 +46,7 @@ class NetworkTestCase(test.TestCase): context.config["start_cidr"]) self.assertIsNone(context.config["dns_nameservers"]) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") @mock.patch(NET + "wrap", return_value="foo_service") def test__init__explicit(self, mock_wrap, mock_clients): context = network_context.Network( @@ -66,7 +66,7 @@ class NetworkTestCase(test.TestCase): @ddt.unpack @mock.patch(NET + "wrap") @mock.patch("rally.plugins.openstack.context.network.networks.utils") - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test_setup(self, mock_clients, mock_utils, mock_wrap, **dns_kwargs): mock_utils.iterate_per_tenants.return_value = [ ("foo_user", "foo_tenant"), @@ -102,7 +102,7 @@ class NetworkTestCase(test.TestCase): self.assertSequenceEqual(sorted(expected_networks), sorted(actual_networks)) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") @mock.patch(NET + "wrap") def test_cleanup(self, mock_wrap, mock_clients): net_context = network_context.Network(self.get_context()) diff --git a/tests/unit/plugins/openstack/context/neutron/test_existing_network.py b/tests/unit/plugins/openstack/context/neutron/test_existing_network.py index ee1da7cf..48268de8 100644 --- a/tests/unit/plugins/openstack/context/neutron/test_existing_network.py +++ b/tests/unit/plugins/openstack/context/neutron/test_existing_network.py @@ -45,7 +45,7 @@ class ExistingNetworkTestCase(test.TestCase): }, }) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") @mock.patch("rally.plugins.openstack.wrappers.network.wrap") def test_setup(self, mock_network_wrap, mock_clients): networks = [mock.Mock(), mock.Mock(), mock.Mock()] diff --git a/tests/unit/plugins/openstack/context/neutron/test_lbaas.py b/tests/unit/plugins/openstack/context/neutron/test_lbaas.py index be3cd592..3700113a 100644 --- a/tests/unit/plugins/openstack/context/neutron/test_lbaas.py +++ b/tests/unit/plugins/openstack/context/neutron/test_lbaas.py @@ -34,7 +34,7 @@ class LbaasTestCase(test.TestCase): "tenants": {"foo_tenant": foo_tenant, "bar_tenant": bar_tenant}} - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") @mock.patch(NET + "wrap", return_value="foo_service") def test__init__default(self, mock_wrap, mock_clients): context = lbaas_context.Lbaas(self.get_context()) @@ -48,7 +48,7 @@ class LbaasTestCase(test.TestCase): context.config["lbaas_version"], lbaas_context.Lbaas.DEFAULT_CONFIG["lbaas_version"]) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") @mock.patch(NET + "wrap", return_value="foo_service") def test__init__explicit(self, mock_wrap, mock_clients): context = lbaas_context.Lbaas( @@ -58,7 +58,7 @@ class LbaasTestCase(test.TestCase): @mock.patch(NET + "wrap") @mock.patch("rally.plugins.openstack.context.neutron.lbaas.utils") - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test_setup_with_lbaas(self, mock_clients, mock_utils, mock_wrap): mock_utils.iterate_per_tenants.return_value = [ ("foo_user", "foo_tenant"), @@ -96,7 +96,7 @@ class LbaasTestCase(test.TestCase): @mock.patch(NET + "wrap") @mock.patch("rally.plugins.openstack.context.neutron.lbaas.utils") - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test_setup_with_no_lbaas(self, mock_clients, mock_utils, mock_wrap): mock_utils.iterate_per_tenants.return_value = [ ("bar_user", "bar_tenant")] @@ -113,7 +113,7 @@ class LbaasTestCase(test.TestCase): @mock.patch(NET + "wrap") @mock.patch("rally.plugins.openstack.context.neutron.lbaas.utils") - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test_setup_with_lbaas_version_not_one(self, mock_clients, mock_utils, mock_wrap): mock_utils.iterate_per_tenants.return_value = [ @@ -126,7 +126,7 @@ class LbaasTestCase(test.TestCase): net_wrapper.supports_extension.return_value = (True, None) self.assertRaises(NotImplementedError, lb_context.setup) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") @mock.patch(NET + "wrap") def test_cleanup(self, mock_wrap, mock_clients): net_wrapper = mock_wrap(mock_clients.return_value) @@ -143,7 +143,7 @@ class LbaasTestCase(test.TestCase): net_wrapper.delete_v1_pool.assert_has_calls( [mock.call(pool["pool"]["id"]) for pool in expected_pools]) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") @mock.patch(NET + "wrap") def test_cleanup_lbaas_version_not_one(self, mock_wrap, mock_clients): fakeargs = {"lbaas_version": 2} diff --git a/tests/unit/plugins/openstack/context/nova/test_keypairs.py b/tests/unit/plugins/openstack/context/nova/test_keypairs.py index 564e7165..94c5e377 100644 --- a/tests/unit/plugins/openstack/context/nova/test_keypairs.py +++ b/tests/unit/plugins/openstack/context/nova/test_keypairs.py @@ -78,7 +78,7 @@ class KeyPairContextTestCase(test.TestCase): superclass=keypairs.Keypair, task_id=self.ctx_with_keys["task"]["uuid"]) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test_keypair_generate(self, mock_clients): mock_keypairs = mock_clients.return_value.nova.return_value.keypairs mock_keypair = mock_keypairs.create.return_value diff --git a/tests/unit/plugins/openstack/context/sahara/test_sahara_image.py b/tests/unit/plugins/openstack/context/sahara/test_sahara_image.py index 420f02bb..df512af8 100644 --- a/tests/unit/plugins/openstack/context/sahara/test_sahara_image.py +++ b/tests/unit/plugins/openstack/context/sahara/test_sahara_image.py @@ -87,7 +87,7 @@ class SaharaImageTestCase(test.ScenarioTestCase): @mock.patch("rally.plugins.openstack.services." "image.image.Image") @mock.patch("%s.resource_manager.cleanup" % CTX) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test_setup_and_cleanup_url_image(self, mock_clients, mock_cleanup, mock_image): diff --git a/tests/unit/plugins/openstack/context/swift/test_objects.py b/tests/unit/plugins/openstack/context/swift/test_objects.py index 394a82d3..f1b48971 100644 --- a/tests/unit/plugins/openstack/context/swift/test_objects.py +++ b/tests/unit/plugins/openstack/context/swift/test_objects.py @@ -22,7 +22,7 @@ from tests.unit import test class SwiftObjectGeneratorTestCase(test.TestCase): - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test_setup(self, mock_clients): containers_per_tenant = 2 objects_per_container = 7 @@ -64,7 +64,7 @@ class SwiftObjectGeneratorTestCase(test.TestCase): self.assertEqual(objects_per_container, len(container["objects"])) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") @mock.patch("rally.plugins.openstack.context.swift.utils." "swift_utils.SwiftScenario") def test_cleanup(self, mock_swift_scenario, mock_clients): @@ -114,7 +114,7 @@ class SwiftObjectGeneratorTestCase(test.TestCase): self.assertEqual(0, len(context["tenants"][tenant_id]["containers"])) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test_setup_failure_clients_put_container(self, mock_clients): context = test.get_test_context() context.update({ @@ -150,7 +150,7 @@ class SwiftObjectGeneratorTestCase(test.TestCase): "containers, expected 4 but got 1", objects_ctx.setup) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test_setup_failure_clients_put_object(self, mock_clients): context = test.get_test_context() context.update({ @@ -178,7 +178,7 @@ class SwiftObjectGeneratorTestCase(test.TestCase): "objects, expected 2 but got 1", objects_ctx.setup) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test_cleanup_failure_clients_delete_container(self, mock_clients): context = test.get_test_context() context.update({ @@ -199,7 +199,7 @@ class SwiftObjectGeneratorTestCase(test.TestCase): objects_ctx.cleanup() self.assertEqual(1, len(context["tenants"]["t1"]["containers"])) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test_cleanup_failure_clients_delete_object(self, mock_clients): context = test.get_test_context() context.update({ diff --git a/tests/unit/plugins/openstack/context/swift/test_utils.py b/tests/unit/plugins/openstack/context/swift/test_utils.py index 2a80a5df..49143524 100644 --- a/tests/unit/plugins/openstack/context/swift/test_utils.py +++ b/tests/unit/plugins/openstack/context/swift/test_utils.py @@ -21,7 +21,7 @@ from tests.unit import test class SwiftObjectMixinTestCase(test.TestCase): - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test__create_containers(self, mock_clients): tenants = 2 containers_per_tenant = 2 @@ -56,7 +56,7 @@ class SwiftObjectMixinTestCase(test.TestCase): container["user"]["credential"]) self.assertEqual(0, len(container["objects"])) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test__create_objects(self, mock_clients): tenants = 2 containers_per_tenant = 1 @@ -105,7 +105,7 @@ class SwiftObjectMixinTestCase(test.TestCase): self.assertEqual(objects_per_container, len(container["objects"])) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test__delete_containers(self, mock_clients): context = test.get_test_context() context.update({ @@ -145,7 +145,7 @@ class SwiftObjectMixinTestCase(test.TestCase): self.assertEqual(0, len(context["tenants"][tenant_id]["containers"])) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test__delete_objects(self, mock_clients): context = test.get_test_context() context.update({ diff --git a/tests/unit/plugins/openstack/context/test_api_versions.py b/tests/unit/plugins/openstack/context/test_api_versions.py index 648db7e8..dab771f4 100644 --- a/tests/unit/plugins/openstack/context/test_api_versions.py +++ b/tests/unit/plugins/openstack/context/test_api_versions.py @@ -25,7 +25,8 @@ class OpenStackServicesTestCase(test.TestCase): def setUp(self): super(OpenStackServicesTestCase, self).setUp() - self.mock_clients = mock.patch("rally.osclients.Clients").start() + self.mock_clients = mock.patch( + "rally.plugins.openstack.osclients.Clients").start() osclient_kc = self.mock_clients.return_value.keystone self.mock_kc = osclient_kc.return_value self.service_catalog = osclient_kc.service_catalog diff --git a/tests/unit/plugins/openstack/scenarios/cinder/test_utils.py b/tests/unit/plugins/openstack/scenarios/cinder/test_utils.py index 9afe4984..d2a9d611 100644 --- a/tests/unit/plugins/openstack/scenarios/cinder/test_utils.py +++ b/tests/unit/plugins/openstack/scenarios/cinder/test_utils.py @@ -17,7 +17,7 @@ import mock from oslo_config import cfg from rally import exceptions -from rally import osclients +from rally.plugins.openstack import osclients from rally.plugins.openstack.scenarios.cinder import utils from tests.unit import fakes from tests.unit import test diff --git a/tests/unit/plugins/openstack/services/identity/test_keystone_common.py b/tests/unit/plugins/openstack/services/identity/test_keystone_common.py index 565352c5..dac79f8e 100644 --- a/tests/unit/plugins/openstack/services/identity/test_keystone_common.py +++ b/tests/unit/plugins/openstack/services/identity/test_keystone_common.py @@ -265,7 +265,7 @@ class KeystoneMixinTestCase(test.TestCase): self.kc.ec2.delete.assert_called_once_with(user_id=user_id, access=access) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test_fetch_token(self, mock_clients): expected_token = mock_clients.return_value.keystone.auth_ref.auth_token self.assertEqual(expected_token, self.service.fetch_token()) diff --git a/tests/unit/plugins/openstack/test_credential.py b/tests/unit/plugins/openstack/test_credential.py index 5ec2e24f..bf7cb0b5 100644 --- a/tests/unit/plugins/openstack/test_credential.py +++ b/tests/unit/plugins/openstack/test_credential.py @@ -48,14 +48,14 @@ class OpenStackCredentialTestCase(test.TestCase): "profiler_hmac_key": None}, self.credential.to_dict()) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test_verify_connection_admin(self, mock_clients): self.credential.verify_connection() mock_clients.assert_called_once_with( self.credential, api_info=None, cache={}) mock_clients.return_value.verified_keystone.assert_called_once_with() - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test_verify_connection_user(self, mock_clients): self.credential.permission = consts.EndpointPermission.USER self.credential.verify_connection() @@ -63,7 +63,7 @@ class OpenStackCredentialTestCase(test.TestCase): self.credential, api_info=None, cache={}) mock_clients.return_value.keystone.assert_called_once_with() - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test_list_services(self, mock_clients): mock_clients.return_value.services.return_value = {"compute": "nova", "volume": "cinder"} @@ -74,7 +74,7 @@ class OpenStackCredentialTestCase(test.TestCase): self.assertEqual([{"name": "cinder", "type": "volume"}, {"name": "nova", "type": "compute"}], result) - @mock.patch("rally.osclients.Clients") + @mock.patch("rally.plugins.openstack.osclients.Clients") def test_clients(self, mock_clients): clients = self.credential.clients(api_info="fake_info") mock_clients.assert_called_once_with( diff --git a/tests/unit/plugins/openstack/test_osclients.py b/tests/unit/plugins/openstack/test_osclients.py index bc3b199b..40b0100d 100644 --- a/tests/unit/plugins/openstack/test_osclients.py +++ b/tests/unit/plugins/openstack/test_osclients.py @@ -19,8 +19,8 @@ from oslo_config import cfg from rally import consts from rally import exceptions -from rally import osclients from rally.plugins.openstack import credential as oscredential +from rally.plugins.openstack import osclients from tests.unit import fakes from tests.unit import test diff --git a/tests/unit/plugins/openstack/test_scenario.py b/tests/unit/plugins/openstack/test_scenario.py index bb3684e4..2527709a 100644 --- a/tests/unit/plugins/openstack/test_scenario.py +++ b/tests/unit/plugins/openstack/test_scenario.py @@ -37,7 +37,8 @@ CREDENTIAL_WITH_HMAC = OpenStackCredential( class OpenStackScenarioTestCase(test.TestCase): def setUp(self): super(OpenStackScenarioTestCase, self).setUp() - self.osclients = fixtures.MockPatch("rally.osclients.Clients") + self.osclients = fixtures.MockPatch( + "rally.plugins.openstack.osclients.Clients") self.useFixture(self.osclients) self.context = test.get_test_context() self.context.update({"foo": "bar"}) diff --git a/tests/unit/plugins/openstack/verification/tempest/test_config.py b/tests/unit/plugins/openstack/verification/tempest/test_config.py index b478ae5e..1abd4450 100644 --- a/tests/unit/plugins/openstack/verification/tempest/test_config.py +++ b/tests/unit/plugins/openstack/verification/tempest/test_config.py @@ -17,7 +17,7 @@ import ddt import mock from oslo_config import cfg -from rally import osclients +from rally.plugins.openstack import osclients from rally.plugins.openstack.verification.tempest import config from tests.unit import fakes from tests.unit import test diff --git a/tests/unit/test.py b/tests/unit/test.py index 7a714a50..f4edcf2f 100644 --- a/tests/unit/test.py +++ b/tests/unit/test.py @@ -192,7 +192,7 @@ class ContextTestCase(ScenarioTestCase): def get_client_mocks(self): return [ mock.patch( - "rally.osclients.Clients", + "rally.plugins.openstack.osclients.Clients", mock.Mock(side_effect=self.context_client)) ]