diff --git a/rally/api.py b/rally/api.py index dc3d068ff2..b7d073cad0 100644 --- a/rally/api.py +++ b/rally/api.py @@ -24,7 +24,7 @@ import jsonschema from rally.common.i18n import _ from rally.common import log as logging from rally import consts -from rally.deploy import engine as deploy_engine +from rally.deployment import engine as deploy_engine from rally import exceptions from rally import objects from rally.task import engine diff --git a/rally/cli/commands/info.py b/rally/cli/commands/info.py index f0145be45e..82340d2bd9 100644 --- a/rally/cli/commands/info.py +++ b/rally/cli/commands/info.py @@ -52,8 +52,8 @@ from __future__ import print_function from rally.cli import cliutils from rally.common.plugin import discover from rally.common import utils -from rally.deploy import engine -from rally.deploy.serverprovider import provider +from rally.deployment import engine +from rally.deployment.serverprovider import provider from rally import exceptions from rally.task.scenarios import base as scenario_base from rally.task import sla diff --git a/rally/common/plugin/discover.py b/rally/common/plugin/discover.py index 6f755005e8..2463347c02 100644 --- a/rally/common/plugin/discover.py +++ b/rally/common/plugin/discover.py @@ -45,7 +45,7 @@ def itersubclasses(cls, seen=None): def import_modules_from_package(package): """Import modules from package and append into sys.modules - :param: package - Full package name. For example: rally.deploy.engines + :param: package - Full package name. For example: rally.deployment.engines """ path = [os.path.dirname(rally.__file__), ".."] + package.split(".") path = os.path.join(*path) diff --git a/rally/deploy/__init__.py b/rally/deployment/__init__.py similarity index 78% rename from rally/deploy/__init__.py rename to rally/deployment/__init__.py index b889c0ac4d..c776e099cc 100644 --- a/rally/deploy/__init__.py +++ b/rally/deployment/__init__.py @@ -13,9 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. -from rally.deploy.engine import * # noqa +from rally.deployment.engine import * # noqa from rally.common.plugin import discover -discover.import_modules_from_package("rally.deploy.engines") -discover.import_modules_from_package("rally.deploy.serverprovider") +discover.import_modules_from_package("rally.deployment.engines") +discover.import_modules_from_package("rally.deployment.serverprovider") diff --git a/rally/deploy/engine.py b/rally/deployment/engine.py similarity index 97% rename from rally/deploy/engine.py rename to rally/deployment/engine.py index 18aeeaf565..ed17c4b6ee 100644 --- a/rally/deploy/engine.py +++ b/rally/deployment/engine.py @@ -23,7 +23,7 @@ from rally.common import log as logging from rally.common.plugin import plugin from rally.common import utils from rally import consts -from rally.deploy.serverprovider import provider +from rally.deployment.serverprovider import provider from rally import exceptions @@ -45,7 +45,7 @@ class EngineFactory(plugin.Plugin): It's a base class with self-discovery of subclasses. Each subclass has to implement deploy() and cleanup() methods. By default, each engine - located as a submodule of the package rally.deploy.engines is + located as a submodule of the package rally.deployment.engines is auto-discovered. Example of usage with a simple engine: diff --git a/rally/deploy/engines/__init__.py b/rally/deployment/engines/__init__.py similarity index 100% rename from rally/deploy/engines/__init__.py rename to rally/deployment/engines/__init__.py diff --git a/rally/deploy/engines/devstack.py b/rally/deployment/engines/devstack.py similarity index 98% rename from rally/deploy/engines/devstack.py rename to rally/deployment/engines/devstack.py index c40406b906..80719a78eb 100644 --- a/rally/deploy/engines/devstack.py +++ b/rally/deployment/engines/devstack.py @@ -21,8 +21,8 @@ from rally.common.i18n import _ from rally.common import log as logging from rally.common import utils from rally import consts -from rally.deploy import engine -from rally.deploy.serverprovider import provider +from rally.deployment import engine +from rally.deployment.serverprovider import provider from rally import objects diff --git a/rally/deploy/engines/devstack/install.sh b/rally/deployment/engines/devstack/install.sh similarity index 100% rename from rally/deploy/engines/devstack/install.sh rename to rally/deployment/engines/devstack/install.sh diff --git a/rally/deploy/engines/existing.py b/rally/deployment/engines/existing.py similarity index 99% rename from rally/deploy/engines/existing.py rename to rally/deployment/engines/existing.py index 24307099b1..3541a54853 100644 --- a/rally/deploy/engines/existing.py +++ b/rally/deployment/engines/existing.py @@ -14,7 +14,7 @@ # under the License. from rally import consts -from rally.deploy import engine +from rally.deployment import engine from rally import objects diff --git a/rally/deploy/engines/fuel.py b/rally/deployment/engines/fuel.py similarity index 98% rename from rally/deploy/engines/fuel.py rename to rally/deployment/engines/fuel.py index 5fd881de19..5fdb5ea111 100644 --- a/rally/deploy/engines/fuel.py +++ b/rally/deployment/engines/fuel.py @@ -15,8 +15,8 @@ from rally.common.i18n import _ from rally import consts -from rally.deploy import engine -from rally.deploy.fuel import fuelclient +from rally.deployment import engine +from rally.deployment.fuel import fuelclient from rally import exceptions from rally import objects diff --git a/rally/deploy/engines/lxc.py b/rally/deployment/engines/lxc.py similarity index 97% rename from rally/deploy/engines/lxc.py rename to rally/deployment/engines/lxc.py index 4717f6d013..3c1a479b1e 100644 --- a/rally/deploy/engines/lxc.py +++ b/rally/deployment/engines/lxc.py @@ -21,9 +21,9 @@ import six from rally.common.i18n import _ from rally.common import log as logging from rally.common import utils -from rally.deploy import engine -from rally.deploy.serverprovider import provider -from rally.deploy.serverprovider.providers import lxc +from rally.deployment import engine +from rally.deployment.serverprovider import provider +from rally.deployment.serverprovider.providers import lxc from rally import exceptions from rally import objects diff --git a/rally/deploy/engines/lxc/start.sh b/rally/deployment/engines/lxc/start.sh similarity index 100% rename from rally/deploy/engines/lxc/start.sh rename to rally/deployment/engines/lxc/start.sh diff --git a/rally/deploy/engines/multihost.py b/rally/deployment/engines/multihost.py similarity index 98% rename from rally/deploy/engines/multihost.py rename to rally/deployment/engines/multihost.py index a2275dd8fe..792f2e035e 100644 --- a/rally/deploy/engines/multihost.py +++ b/rally/deployment/engines/multihost.py @@ -20,7 +20,7 @@ from six.moves.urllib import parse import rally from rally import consts from rally import db -from rally.deploy import engine +from rally.deployment import engine from rally import objects diff --git a/rally/deploy/fuel/__init__.py b/rally/deployment/fuel/__init__.py similarity index 100% rename from rally/deploy/fuel/__init__.py rename to rally/deployment/fuel/__init__.py diff --git a/rally/deploy/fuel/fuelclient.py b/rally/deployment/fuel/fuelclient.py similarity index 100% rename from rally/deploy/fuel/fuelclient.py rename to rally/deployment/fuel/fuelclient.py diff --git a/rally/deploy/serverprovider/__init__.py b/rally/deployment/serverprovider/__init__.py similarity index 100% rename from rally/deploy/serverprovider/__init__.py rename to rally/deployment/serverprovider/__init__.py diff --git a/rally/deploy/serverprovider/__main__.py b/rally/deployment/serverprovider/__main__.py similarity index 100% rename from rally/deploy/serverprovider/__main__.py rename to rally/deployment/serverprovider/__main__.py diff --git a/rally/deploy/serverprovider/provider.py b/rally/deployment/serverprovider/provider.py similarity index 98% rename from rally/deploy/serverprovider/provider.py rename to rally/deployment/serverprovider/provider.py index c65ccb958f..a7f6b805a7 100644 --- a/rally/deploy/serverprovider/provider.py +++ b/rally/deployment/serverprovider/provider.py @@ -103,7 +103,7 @@ class ProviderFactory(plugin.Plugin): It's a base class with self-discovery of subclasses. Each subclass has to implement create_servers() and destroy_servers() methods. By default, each server provider located as a submodule of the package - rally.deploy.serverprovider.providers is auto-discovered. + rally.deployment.serverprovider.providers is auto-discovered. Each provider supervises its own resources using a ResourceManager. diff --git a/rally/deploy/serverprovider/providers/__init__.py b/rally/deployment/serverprovider/providers/__init__.py similarity index 100% rename from rally/deploy/serverprovider/providers/__init__.py rename to rally/deployment/serverprovider/providers/__init__.py diff --git a/rally/deploy/serverprovider/providers/existing.py b/rally/deployment/serverprovider/providers/existing.py similarity index 97% rename from rally/deploy/serverprovider/providers/existing.py rename to rally/deployment/serverprovider/providers/existing.py index 866b20c625..fe465947a1 100644 --- a/rally/deploy/serverprovider/providers/existing.py +++ b/rally/deployment/serverprovider/providers/existing.py @@ -14,7 +14,7 @@ # under the License. -from rally.deploy.serverprovider import provider +from rally.deployment.serverprovider import provider @provider.configure(name="ExistingServers") diff --git a/rally/deploy/serverprovider/providers/lxc.py b/rally/deployment/serverprovider/providers/lxc.py similarity index 99% rename from rally/deploy/serverprovider/providers/lxc.py rename to rally/deployment/serverprovider/providers/lxc.py index a02abe07d5..3479727699 100644 --- a/rally/deploy/serverprovider/providers/lxc.py +++ b/rally/deployment/serverprovider/providers/lxc.py @@ -24,7 +24,7 @@ from six import moves from rally.common.i18n import _ from rally.common import log as logging from rally.common import utils -from rally.deploy.serverprovider import provider +from rally.deployment.serverprovider import provider from rally import exceptions diff --git a/rally/deploy/serverprovider/providers/lxc/configure_container.sh b/rally/deployment/serverprovider/providers/lxc/configure_container.sh similarity index 100% rename from rally/deploy/serverprovider/providers/lxc/configure_container.sh rename to rally/deployment/serverprovider/providers/lxc/configure_container.sh diff --git a/rally/deploy/serverprovider/providers/lxc/lxc-install.sh b/rally/deployment/serverprovider/providers/lxc/lxc-install.sh similarity index 100% rename from rally/deploy/serverprovider/providers/lxc/lxc-install.sh rename to rally/deployment/serverprovider/providers/lxc/lxc-install.sh diff --git a/rally/deploy/serverprovider/providers/lxc/tunnel-local.sh b/rally/deployment/serverprovider/providers/lxc/tunnel-local.sh similarity index 100% rename from rally/deploy/serverprovider/providers/lxc/tunnel-local.sh rename to rally/deployment/serverprovider/providers/lxc/tunnel-local.sh diff --git a/rally/deploy/serverprovider/providers/lxc/tunnel-remote.sh b/rally/deployment/serverprovider/providers/lxc/tunnel-remote.sh similarity index 100% rename from rally/deploy/serverprovider/providers/lxc/tunnel-remote.sh rename to rally/deployment/serverprovider/providers/lxc/tunnel-remote.sh diff --git a/rally/deploy/serverprovider/providers/openstack.py b/rally/deployment/serverprovider/providers/openstack.py similarity index 99% rename from rally/deploy/serverprovider/providers/openstack.py rename to rally/deployment/serverprovider/providers/openstack.py index 4c5420fdde..2c0c92f574 100644 --- a/rally/deploy/serverprovider/providers/openstack.py +++ b/rally/deployment/serverprovider/providers/openstack.py @@ -20,7 +20,7 @@ import novaclient.exceptions from rally.common.i18n import _ from rally.common import log as logging -from rally.deploy.serverprovider import provider +from rally.deployment.serverprovider import provider from rally import exceptions from rally import objects from rally import osclients diff --git a/rally/deploy/serverprovider/providers/virsh.py b/rally/deployment/serverprovider/providers/virsh.py similarity index 98% rename from rally/deploy/serverprovider/providers/virsh.py rename to rally/deployment/serverprovider/providers/virsh.py index dadca131bc..16bc4db883 100644 --- a/rally/deploy/serverprovider/providers/virsh.py +++ b/rally/deployment/serverprovider/providers/virsh.py @@ -20,7 +20,7 @@ import uuid import netaddr -from rally.deploy.serverprovider import provider +from rally.deployment.serverprovider import provider @provider.configure(name="VirshProvider") diff --git a/rally/deploy/serverprovider/providers/virsh/get_domain_ip.sh b/rally/deployment/serverprovider/providers/virsh/get_domain_ip.sh similarity index 100% rename from rally/deploy/serverprovider/providers/virsh/get_domain_ip.sh rename to rally/deployment/serverprovider/providers/virsh/get_domain_ip.sh diff --git a/tests/unit/cli/commands/test_info.py b/tests/unit/cli/commands/test_info.py index 2e9dfbc1cd..3090bc7409 100644 --- a/tests/unit/cli/commands/test_info.py +++ b/tests/unit/cli/commands/test_info.py @@ -16,10 +16,11 @@ import mock from rally.cli.commands import info -from rally.deploy import engine -from rally.deploy.engines import existing as existing_cloud -from rally.deploy.serverprovider import provider -from rally.deploy.serverprovider.providers import existing as existing_servers +from rally.deployment import engine +from rally.deployment.engines import existing as existing_cloud +from rally.deployment.serverprovider import provider +from rally.deployment.serverprovider.providers import ( + existing as existing_servers) from rally import exceptions from rally.plugins.common.scenarios.dummy import dummy from rally.plugins.common.sla import failure_rate diff --git a/tests/unit/deploy/__init__.py b/tests/unit/deployment/__init__.py similarity index 100% rename from tests/unit/deploy/__init__.py rename to tests/unit/deployment/__init__.py diff --git a/tests/unit/deploy/engines/__init__.py b/tests/unit/deployment/engines/__init__.py similarity index 100% rename from tests/unit/deploy/engines/__init__.py rename to tests/unit/deployment/engines/__init__.py diff --git a/tests/unit/deploy/engines/test_devstack.py b/tests/unit/deployment/engines/test_devstack.py similarity index 88% rename from tests/unit/deploy/engines/test_devstack.py rename to tests/unit/deployment/engines/test_devstack.py index 8cac0e8585..30f03539c2 100644 --- a/tests/unit/deploy/engines/test_devstack.py +++ b/tests/unit/deployment/engines/test_devstack.py @@ -16,7 +16,7 @@ import jsonschema import mock -from rally.deploy.engines import devstack +from rally.deployment.engines import devstack from tests.unit import test @@ -54,7 +54,7 @@ class DevstackEngineTestCase(test.TestCase): def test_construct(self): self.assertEqual(self.engine.localrc["ADMIN_PASSWORD"], "secret") - @mock.patch("rally.deploy.engines.devstack.open", create=True) + @mock.patch("rally.deployment.engines.devstack.open", create=True) def test_prepare_server(self, mock_open): mock_open.return_value = "fake_file" server = mock.Mock() @@ -66,15 +66,15 @@ class DevstackEngineTestCase(test.TestCase): ] self.assertEqual(calls, server.ssh.run.mock_calls) filename = mock_open.mock_calls[0][1][0] - self.assertTrue(filename.endswith("rally/deploy/engines/" + self.assertTrue(filename.endswith("rally/deployment/engines/" "devstack/install.sh")) self.assertEqual([mock.call(filename, "rb")], mock_open.mock_calls) - @mock.patch("rally.deploy.engine.EngineFactory.get_provider") - @mock.patch("rally.deploy.engines.devstack.get_updated_server") - @mock.patch("rally.deploy.engines.devstack.get_script") - @mock.patch("rally.deploy.serverprovider.provider.Server") - @mock.patch("rally.deploy.engines.devstack.objects.Endpoint") + @mock.patch("rally.deployment.engine.EngineFactory.get_provider") + @mock.patch("rally.deployment.engines.devstack.get_updated_server") + @mock.patch("rally.deployment.engines.devstack.get_script") + @mock.patch("rally.deployment.serverprovider.provider.Server") + @mock.patch("rally.deployment.engines.devstack.objects.Endpoint") def test_deploy(self, mock_endpoint, mock_server, mock_get_script, mock_get_updated_server, mock_engine_factory_get_provider): mock_engine_factory_get_provider.return_value = fake_provider = ( diff --git a/tests/unit/deploy/engines/test_existing.py b/tests/unit/deployment/engines/test_existing.py similarity index 96% rename from tests/unit/deploy/engines/test_existing.py rename to tests/unit/deployment/engines/test_existing.py index 773dde91f0..7a91929583 100644 --- a/tests/unit/deploy/engines/test_existing.py +++ b/tests/unit/deployment/engines/test_existing.py @@ -18,8 +18,8 @@ import jsonschema from rally import consts -from rally.deploy import engine as deploy_engine -from rally.deploy.engines import existing +from rally.deployment import engine as deploy_engine +from rally.deployment.engines import existing from tests.unit import test diff --git a/tests/unit/deploy/engines/test_fuel.py b/tests/unit/deployment/engines/test_fuel.py similarity index 94% rename from tests/unit/deploy/engines/test_fuel.py rename to tests/unit/deployment/engines/test_fuel.py index a351c3e09b..ffc00d8c32 100644 --- a/tests/unit/deploy/engines/test_fuel.py +++ b/tests/unit/deployment/engines/test_fuel.py @@ -14,7 +14,7 @@ # under the License. from rally import consts -from rally.deploy.engines import fuel +from rally.deployment.engines import fuel from rally import exceptions from tests.unit import fakes from tests.unit import test @@ -83,8 +83,8 @@ class FuelEngineTestCase(test.TestCase): engine.client.get_releases = mock.Mock(return_value=fake_releases) self.assertEqual(42, engine._get_release_id()) - @mock.patch("rally.deploy.fuel.fuelclient.FuelClient") - @mock.patch("rally.deploy.fuel.fuelclient.FuelCluster") + @mock.patch("rally.deployment.fuel.fuelclient.FuelClient") + @mock.patch("rally.deployment.fuel.fuelclient.FuelCluster") def test_deploy(self, mock_fuel_cluster, mock_fuel_client): attributes = {"editable": {"access": {"user": {"value": "user"}, "password": {"value": "pw"}, @@ -129,8 +129,8 @@ class FuelEngineTestCase(test.TestCase): self.assertEqual(expected_cluster_calls, cluster.mock_calls) self.assertEqual([mock.call.get_nodes()], client.mock_calls) - @mock.patch("rally.deploy.fuel.fuelclient.FuelClient") - @mock.patch("rally.deploy.engines.fuel.objects.Deployment") + @mock.patch("rally.deployment.fuel.fuelclient.FuelClient") + @mock.patch("rally.deployment.engines.fuel.objects.Deployment") def test_cleanup(self, mock_deployment, mock_fuel_client): fake_resources = [{"id": 41, "info": {"id": 42}}] self.deployment.get_resources = mock.Mock(return_value=fake_resources) diff --git a/tests/unit/deploy/serverprovider/__init__.py b/tests/unit/deployment/serverprovider/__init__.py similarity index 100% rename from tests/unit/deploy/serverprovider/__init__.py rename to tests/unit/deployment/serverprovider/__init__.py diff --git a/tests/unit/deploy/serverprovider/providers/__init__.py b/tests/unit/deployment/serverprovider/providers/__init__.py similarity index 100% rename from tests/unit/deploy/serverprovider/providers/__init__.py rename to tests/unit/deployment/serverprovider/providers/__init__.py diff --git a/tests/unit/deploy/serverprovider/providers/test_existing.py b/tests/unit/deployment/serverprovider/providers/test_existing.py similarity index 93% rename from tests/unit/deploy/serverprovider/providers/test_existing.py rename to tests/unit/deployment/serverprovider/providers/test_existing.py index 3907113261..e3192f6591 100644 --- a/tests/unit/deploy/serverprovider/providers/test_existing.py +++ b/tests/unit/deployment/serverprovider/providers/test_existing.py @@ -15,8 +15,8 @@ import jsonschema -from rally.deploy.serverprovider import provider -from rally.deploy.serverprovider.providers import existing +from rally.deployment.serverprovider import provider +from rally.deployment.serverprovider.providers import existing from tests.unit import test diff --git a/tests/unit/deploy/serverprovider/providers/test_lxc.py b/tests/unit/deployment/serverprovider/providers/test_lxc.py similarity index 98% rename from tests/unit/deploy/serverprovider/providers/test_lxc.py rename to tests/unit/deployment/serverprovider/providers/test_lxc.py index 897e642e6f..5c6c45041f 100644 --- a/tests/unit/deploy/serverprovider/providers/test_lxc.py +++ b/tests/unit/deployment/serverprovider/providers/test_lxc.py @@ -17,12 +17,12 @@ import jsonschema import mock import netaddr -from rally.deploy.serverprovider.providers import lxc +from rally.deployment.serverprovider.providers import lxc from rally import exceptions from tests.unit import test -MOD_NAME = "rally.deploy.serverprovider.providers.lxc." +MOD_NAME = "rally.deployment.serverprovider.providers.lxc." class HelperFunctionsTestCase(test.TestCase): @@ -33,8 +33,8 @@ class HelperFunctionsTestCase(test.TestCase): self.assertEqual("fake_script", script) path = mock_open.mock_calls[0][1][0] mode = mock_open.mock_calls[0][1][1] - self.assertTrue(path.endswith("rally/deploy/serverprovider/providers" - "/lxc/script.sh")) + self.assertTrue(path.endswith( + "rally/deployment/serverprovider/providers/lxc/script.sh")) self.assertEqual("rb", mode) @mock.patch(MOD_NAME + "_get_script", return_value="fake_script") diff --git a/tests/unit/deploy/serverprovider/providers/test_openstack.py b/tests/unit/deployment/serverprovider/providers/test_openstack.py similarity index 90% rename from tests/unit/deploy/serverprovider/providers/test_openstack.py rename to tests/unit/deployment/serverprovider/providers/test_openstack.py index 0911d573e2..9cc8f654d4 100644 --- a/tests/unit/deploy/serverprovider/providers/test_openstack.py +++ b/tests/unit/deployment/serverprovider/providers/test_openstack.py @@ -19,12 +19,12 @@ import jsonschema import mock from oslotest import mockpatch -from rally.deploy.serverprovider.providers import openstack as provider +from rally.deployment.serverprovider.providers import openstack as provider from rally import exceptions from tests.unit import fakes from tests.unit import test -MOD_NAME = "rally.deploy.serverprovider.providers.openstack" +MOD_NAME = "rally.deployment.serverprovider.providers.openstack" OSProvider = provider.OpenStackProvider @@ -41,8 +41,8 @@ class OpenStackProviderTestCase(test.TestCase): def setUp(self): super(OpenStackProviderTestCase, self).setUp() - self.useFixture(mockpatch.Patch("rally.deploy.serverprovider.provider." - "ResourceManager")) + self.useFixture(mockpatch.Patch( + "rally.deployment.serverprovider.provider.ResourceManager")) def _get_valid_config(self): return { @@ -80,7 +80,8 @@ class OpenStackProviderTestCase(test.TestCase): self.clients.nova = mock.MagicMock(return_value=self.nova_client) - @mock.patch("rally.deploy.serverprovider.providers.openstack.osclients") + @mock.patch( + "rally.deployment.serverprovider.providers.openstack.osclients") def test_openstack_provider_init(self, mock_osclients): cfg = self._get_valid_config() mock_osclients.Clients = mock.MagicMock(return_value=FakeOSClients()) @@ -95,7 +96,8 @@ class OpenStackProviderTestCase(test.TestCase): provider = OSProvider(mock.MagicMock(), cfg) self.assertIsNone(provider.glance) - @mock.patch("rally.deploy.serverprovider.providers.openstack.osclients") + @mock.patch( + "rally.deployment.serverprovider.providers.openstack.osclients") def test_openstack_provider_init_with_invalid_conf_no_user(self, mock_osclients): cfg = self._get_valid_config() @@ -103,7 +105,8 @@ class OpenStackProviderTestCase(test.TestCase): self.assertRaises(jsonschema.ValidationError, OSProvider, mock.MagicMock(), cfg) - @mock.patch("rally.deploy.serverprovider.providers.openstack.osclients") + @mock.patch( + "rally.deployment.serverprovider.providers.openstack.osclients") def test_openstack_provider_init_with_invalid_conf_no_url(self, mock_osclients): cfg = self._get_valid_config() @@ -112,7 +115,8 @@ class OpenStackProviderTestCase(test.TestCase): self.assertRaises(jsonschema.ValidationError, OSProvider, mock.MagicMock(), cfg) - @mock.patch("rally.deploy.serverprovider.providers.openstack.osclients") + @mock.patch( + "rally.deployment.serverprovider.providers.openstack.osclients") def test_openstack_provider_init_with_invalid_conf_extra_key( self, mock_osclients): cfg = self._get_valid_config() @@ -120,26 +124,30 @@ class OpenStackProviderTestCase(test.TestCase): self.assertRaises(jsonschema.ValidationError, OSProvider, mock.MagicMock(), cfg) - @mock.patch("rally.deploy.serverprovider.providers.openstack.osclients") + @mock.patch( + "rally.deployment.serverprovider.providers.openstack.osclients") def test_openstack_provider_init_with_invalid_conf_flavor_(self, mock_osclients): cfg = self._get_valid_config()["user"] = 1111 self.assertRaises(jsonschema.ValidationError, OSProvider, mock.MagicMock(), cfg) - @mock.patch("rally.deploy.serverprovider.providers.openstack.osclients") + @mock.patch( + "rally.deployment.serverprovider.providers.openstack.osclients") def test_openstack_provider_with_valid_config(self, mock_osclients): cfg = self._get_valid_config() OSProvider(mock.MagicMock(), cfg) - @mock.patch("rally.deploy.serverprovider.providers.openstack.osclients") + @mock.patch( + "rally.deployment.serverprovider.providers.openstack.osclients") def test_openstack_provider_with_valid_config_uuid(self, mock_osclients): cfg = self._get_valid_config() cfg["image"] = dict(uuid="289D7A51-1A0C-43C4-800D-706EA8A3CDF3") OSProvider(mock.MagicMock(), cfg) - @mock.patch("rally.deploy.serverprovider.providers.openstack.osclients") + @mock.patch( + "rally.deployment.serverprovider.providers.openstack.osclients") def test_openstack_provider_with_valid_config_checksum(self, mock_osclients): cfg = self._get_valid_config() diff --git a/tests/unit/deploy/serverprovider/providers/test_virsh.py b/tests/unit/deployment/serverprovider/providers/test_virsh.py similarity index 90% rename from tests/unit/deploy/serverprovider/providers/test_virsh.py rename to tests/unit/deployment/serverprovider/providers/test_virsh.py index caf83ec4e9..388d8b3c4d 100644 --- a/tests/unit/deploy/serverprovider/providers/test_virsh.py +++ b/tests/unit/deployment/serverprovider/providers/test_virsh.py @@ -20,7 +20,7 @@ import mock import netaddr from oslotest import mockpatch -from rally.deploy.serverprovider.providers import virsh +from rally.deployment.serverprovider.providers import virsh from tests.unit import test @@ -39,8 +39,8 @@ class VirshProviderTestCase(test.TestCase): self.useFixture(mockpatch.PatchObject(self.provider, "resources")) @mock.patch( - "rally.deploy.serverprovider.providers.virsh.netaddr.IPAddress") - @mock.patch("rally.deploy.serverprovider.providers.virsh.subprocess") + "rally.deployment.serverprovider.providers.virsh.netaddr.IPAddress") + @mock.patch("rally.deployment.serverprovider.providers.virsh.subprocess") @mock.patch("time.sleep") def test_create_vm(self, mock_sleep, mock_subprocess, mock_ip_address): mock_subprocess.check_output.return_value = "10.0.0.1" @@ -70,8 +70,8 @@ class VirshProviderTestCase(test.TestCase): }) @mock.patch( - "rally.deploy.serverprovider.providers.virsh.netaddr.IPAddress") - @mock.patch("rally.deploy.serverprovider.providers.virsh.subprocess") + "rally.deployment.serverprovider.providers.virsh.netaddr.IPAddress") + @mock.patch("rally.deployment.serverprovider.providers.virsh.subprocess") @mock.patch("time.sleep") def test_create_vm_ip_failed(self, mock_sleep, mock_subprocess, mock_ip_address): @@ -83,7 +83,7 @@ class VirshProviderTestCase(test.TestCase): ]) self.assertEqual(server.host, "None") - @mock.patch("rally.deploy.serverprovider.providers.virsh.subprocess") + @mock.patch("rally.deployment.serverprovider.providers.virsh.subprocess") def test_destroy_vm(self, mock_subprocess): self.provider.destroy_vm("uuid") mock_subprocess.assert_has_calls([ @@ -94,7 +94,7 @@ class VirshProviderTestCase(test.TestCase): shell=True), ]) - @mock.patch("rally.deploy.serverprovider.providers.virsh.uuid") + @mock.patch("rally.deployment.serverprovider.providers.virsh.uuid") @mock.patch.object(virsh.VirshProvider, "create_vm") def test_create_servers(self, mock_create_vm, mock_uuid): mock_uuid.uuid4.side_effect = ["1", "2", "3"] diff --git a/tests/unit/deploy/serverprovider/test_provider.py b/tests/unit/deployment/serverprovider/test_provider.py similarity index 98% rename from tests/unit/deploy/serverprovider/test_provider.py rename to tests/unit/deployment/serverprovider/test_provider.py index 65fa6ec8f3..66d9052705 100644 --- a/tests/unit/deploy/serverprovider/test_provider.py +++ b/tests/unit/deployment/serverprovider/test_provider.py @@ -18,7 +18,7 @@ import mock import six from rally.common import sshutils -from rally.deploy.serverprovider import provider +from rally.deployment.serverprovider import provider from rally import exceptions from tests.unit import test diff --git a/tests/unit/deploy/test_engine.py b/tests/unit/deployment/test_engine.py similarity index 99% rename from tests/unit/deploy/test_engine.py rename to tests/unit/deployment/test_engine.py index 6c9301942a..ba4d2286ad 100644 --- a/tests/unit/deploy/test_engine.py +++ b/tests/unit/deployment/test_engine.py @@ -18,7 +18,7 @@ import mock from rally import consts -from rally.deploy import engine +from rally.deployment import engine from rally import exceptions from tests.unit import test diff --git a/tests/unit/deploy/test_lxc.py b/tests/unit/deployment/test_lxc.py similarity index 99% rename from tests/unit/deploy/test_lxc.py rename to tests/unit/deployment/test_lxc.py index e2de2638ff..753169b02e 100644 --- a/tests/unit/deploy/test_lxc.py +++ b/tests/unit/deployment/test_lxc.py @@ -15,11 +15,11 @@ import mock -from rally.deploy import engine +from rally.deployment import engine from rally import objects from tests.unit import test -MOD = "rally.deploy.engines.lxc." +MOD = "rally.deployment.engines.lxc." class LxcEngineTestCase(test.TestCase): diff --git a/tests/unit/deploy/test_multihost.py b/tests/unit/deployment/test_multihost.py similarity index 98% rename from tests/unit/deploy/test_multihost.py rename to tests/unit/deployment/test_multihost.py index a3132542f0..77dfd82a6e 100644 --- a/tests/unit/deploy/test_multihost.py +++ b/tests/unit/deployment/test_multihost.py @@ -17,11 +17,11 @@ import mock from rally import consts -from rally.deploy import engine +from rally.deployment import engine from tests.unit import fakes from tests.unit import test -MOD = "rally.deploy.engines.multihost." +MOD = "rally.deployment.engines.multihost." class MultihostEngineTestCase(test.TestCase): diff --git a/tests/unit/test_api.py b/tests/unit/test_api.py index 6315ac7fdf..f2870105d5 100644 --- a/tests/unit/test_api.py +++ b/tests/unit/test_api.py @@ -199,7 +199,7 @@ class BaseDeploymentTestCase(test.TestCase): class DeploymentAPITestCase(BaseDeploymentTestCase): @mock.patch("rally.objects.deploy.db.deployment_update") @mock.patch("rally.objects.deploy.db.deployment_create") - @mock.patch("rally.deploy.engine.EngineFactory.validate") + @mock.patch("rally.deployment.engine.EngineFactory.validate") def test_create(self, mock_engine_factory_validate, mock_deployment_create, mock_deployment_update): mock_deployment_create.return_value = self.deployment @@ -216,7 +216,7 @@ class DeploymentAPITestCase(BaseDeploymentTestCase): @mock.patch("rally.objects.deploy.db.deployment_update") @mock.patch("rally.objects.deploy.db.deployment_create") - @mock.patch("rally.deploy.engine.EngineFactory.validate", + @mock.patch("rally.deployment.engine.EngineFactory.validate", side_effect=jsonschema.ValidationError("ValidationError")) def test_create_validation_error( self, mock_engine_factory_validate, mock_deployment_create, diff --git a/tests/unit/test_docstrings.py b/tests/unit/test_docstrings.py index f900fcb07c..74c9d35323 100644 --- a/tests/unit/test_docstrings.py +++ b/tests/unit/test_docstrings.py @@ -15,8 +15,8 @@ from rally.common.plugin import discover from rally.common import utils -from rally.deploy import engine -from rally.deploy.serverprovider import provider +from rally.deployment import engine +from rally.deployment.serverprovider import provider from rally.task.scenarios import base from rally.task import sla from tests.unit import test diff --git a/tests/unit/test_fuelclient.py b/tests/unit/test_fuelclient.py index e54f317bd4..a9b0b30674 100644 --- a/tests/unit/test_fuelclient.py +++ b/tests/unit/test_fuelclient.py @@ -17,7 +17,7 @@ import copy import mock -from rally.deploy.fuel import fuelclient +from rally.deployment.fuel import fuelclient from tests.unit import test @@ -153,7 +153,7 @@ class FuelClusterTestCase(test.TestCase): "key": "new_val", "key2": "val2"}]}) - @mock.patch("rally.deploy.fuel.fuelclient.time.sleep") + @mock.patch("rally.deployment.fuel.fuelclient.time.sleep") def test_deploy(self, mock_sleep): call1 = {"progress": 50} call2 = {"progress": 100} @@ -189,7 +189,7 @@ class FuelClusterTestCase(test.TestCase): "clusters/42/network_configuration/nova_network", {"key": "val"}) self.cluster.verify_network.assert_called_once_with({"key": "val"}) - @mock.patch("rally.deploy.fuel.fuelclient.time.sleep") + @mock.patch("rally.deployment.fuel.fuelclient.time.sleep") def test_verify_network(self, mock_sleep): call1 = {"progress": 50} call2 = {"progress": 100, "message": ""} @@ -206,7 +206,7 @@ class FuelClusterTestCase(test.TestCase): self.assertEqual([mock.call(42), mock.call(42)], self.client.get_task.mock_calls) - @mock.patch("rally.deploy.fuel.fuelclient.time.sleep") + @mock.patch("rally.deployment.fuel.fuelclient.time.sleep") def test_verify_network_fail(self, mock_sleep): self.client.put.return_value = {"id": 42} self.client.get_task.return_value = {"progress": 100, @@ -244,7 +244,7 @@ class FuelClientTestCase(test.TestCase): super(FuelClientTestCase, self).setUp() self.client = fuelclient.FuelClient("http://10.20.0.2:8000/api/v1/") - @mock.patch("rally.deploy.fuel.fuelclient.requests") + @mock.patch("rally.deployment.fuel.fuelclient.requests") def test__request_non_json(self, mock_requests): reply = mock.Mock() reply.status_code = 200 @@ -256,7 +256,7 @@ class FuelClientTestCase(test.TestCase): self.assertEqual(retval, reply) - @mock.patch("rally.deploy.fuel.fuelclient.requests") + @mock.patch("rally.deployment.fuel.fuelclient.requests") def test__request_non_2xx(self, mock_requests): reply = mock.Mock() reply.status_code = 300 @@ -267,7 +267,7 @@ class FuelClientTestCase(test.TestCase): self.client._request, "method", "url", data={"key": "value"}) - @mock.patch("rally.deploy.fuel.fuelclient.requests") + @mock.patch("rally.deployment.fuel.fuelclient.requests") def test__request(self, mock_requests): reply = mock.Mock() reply.status_code = 202