From: John Griffith Date: Mon, 20 Apr 2015 21:38:22 +0000 (-0600) Subject: Move unit tests into dedicated directory X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=cbcbc90cf64d91a33b7bcfb826c59d4b69697486;p=openstack-build%2Fcinder-build.git Move unit tests into dedicated directory This patch moves all of the existing cinder/tests into cinder unit tests. This is being done to make way for the addition of cinder/tests/functional. Yes, this is going to cause significant pain with any changes that haven't merged behind it in terms of rebase, but there's no real alternative. We have to rip the band-aid off at some point, and early in L seems like a great time to do it. Change-Id: I63b0f89474b3c139bdb89589abd85319d2aa61ec --- diff --git a/cinder/hacking/checks.py b/cinder/hacking/checks.py index 2312e9212..9b2451411 100644 --- a/cinder/hacking/checks.py +++ b/cinder/hacking/checks.py @@ -120,7 +120,7 @@ def check_assert_called_once(logical_line, filename): "once_with to test with explicit parameters or an assertEqual with" " call_count.") - if 'cinder/tests/' in filename: + if 'cinder.functional/tests/' or 'cinder.unit/tests' in filename: pos = logical_line.find('.assert_called_once(') if pos != -1: yield (pos, msg) diff --git a/cinder/test.py b/cinder/test.py index e7180cc3c..c4c7bd469 100644 --- a/cinder/test.py +++ b/cinder/test.py @@ -46,8 +46,8 @@ from cinder import i18n from cinder import objects from cinder import rpc from cinder import service -from cinder.tests import conf_fixture -from cinder.tests import fake_notifier +from cinder.tests.unit import conf_fixture +from cinder.tests.unit import fake_notifier test_opts = [ cfg.StrOpt('sqlite_clean_db', @@ -165,7 +165,7 @@ class TestCase(testtools.TestCase): format=log_format, level=level)) - rpc.add_extra_exmods("cinder.tests") + rpc.add_extra_exmods("cinder.tests.unit") self.addCleanup(rpc.clear_extra_exmods) self.addCleanup(rpc.cleanup) @@ -225,7 +225,7 @@ class TestCase(testtools.TestCase): '..', ) ), - 'cinder/tests/policy.json')) + 'cinder/tests/unit/policy.json')) def _common_cleanup(self): """Runs after each test method to tear down test environment.""" diff --git a/cinder/tests/__init__.py b/cinder/tests/__init__.py index 302a1a2db..e69de29bb 100644 --- a/cinder/tests/__init__.py +++ b/cinder/tests/__init__.py @@ -1,38 +0,0 @@ -# Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -""" -:mod:`cinder.tests` -- Cinder Unittests -===================================================== - -.. automodule:: cinder.tests - :platform: Unix -.. moduleauthor:: Jesse Andrews -.. moduleauthor:: Devin Carlen -.. moduleauthor:: Vishvananda Ishaya -.. moduleauthor:: Joshua McKenty -.. moduleauthor:: Manish Singh -.. moduleauthor:: Andy Smith -""" - -import eventlet - -eventlet.monkey_patch() - -# See http://code.google.com/p/python-nose/issues/detail?id=373 -# The code below enables nosetests to work with i18n _() blocks -import __builtin__ -setattr(__builtin__, '_', lambda x: x) diff --git a/cinder/tests/unit/__init__.py b/cinder/tests/unit/__init__.py new file mode 100644 index 000000000..125b19eac --- /dev/null +++ b/cinder/tests/unit/__init__.py @@ -0,0 +1,38 @@ +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +""" +:mod:`cinder.tests.unit` -- Cinder Unittests +===================================================== + +.. automodule:: cinder.tests.unit + :platform: Unix +.. moduleauthor:: Jesse Andrews +.. moduleauthor:: Devin Carlen +.. moduleauthor:: Vishvananda Ishaya +.. moduleauthor:: Joshua McKenty +.. moduleauthor:: Manish Singh +.. moduleauthor:: Andy Smith +""" + +import eventlet + +eventlet.monkey_patch() + +# See http://code.google.com/p/python-nose/issues/detail?id=373 +# The code below enables nosetests to work with i18n _() blocks +import __builtin__ +setattr(__builtin__, '_', lambda x: x) diff --git a/cinder/tests/api/__init__.py b/cinder/tests/unit/api/__init__.py similarity index 100% rename from cinder/tests/api/__init__.py rename to cinder/tests/unit/api/__init__.py diff --git a/cinder/tests/api/common.py b/cinder/tests/unit/api/common.py similarity index 100% rename from cinder/tests/api/common.py rename to cinder/tests/unit/api/common.py diff --git a/cinder/tests/api/contrib/__init__.py b/cinder/tests/unit/api/contrib/__init__.py similarity index 100% rename from cinder/tests/api/contrib/__init__.py rename to cinder/tests/unit/api/contrib/__init__.py diff --git a/cinder/tests/api/contrib/test_admin_actions.py b/cinder/tests/unit/api/contrib/test_admin_actions.py similarity index 99% rename from cinder/tests/api/contrib/test_admin_actions.py rename to cinder/tests/unit/api/contrib/test_admin_actions.py index d4861db4d..a1dff4da4 100644 --- a/cinder/tests/api/contrib/test_admin_actions.py +++ b/cinder/tests/unit/api/contrib/test_admin_actions.py @@ -28,10 +28,10 @@ from cinder import context from cinder import db from cinder import exception from cinder import test -from cinder.tests.api import fakes -from cinder.tests.api.v2 import stubs -from cinder.tests import cast_as_call -from cinder.tests import fake_snapshot +from cinder.tests.unit.api import fakes +from cinder.tests.unit.api.v2 import stubs +from cinder.tests.unit import cast_as_call +from cinder.tests.unit import fake_snapshot from cinder.volume import api as volume_api from cinder.volume.targets import tgt diff --git a/cinder/tests/api/contrib/test_availability_zones.py b/cinder/tests/unit/api/contrib/test_availability_zones.py similarity index 100% rename from cinder/tests/api/contrib/test_availability_zones.py rename to cinder/tests/unit/api/contrib/test_availability_zones.py diff --git a/cinder/tests/api/contrib/test_backups.py b/cinder/tests/unit/api/contrib/test_backups.py similarity index 99% rename from cinder/tests/api/contrib/test_backups.py rename to cinder/tests/unit/api/contrib/test_backups.py index 1fe3752ee..09077e674 100644 --- a/cinder/tests/api/contrib/test_backups.py +++ b/cinder/tests/unit/api/contrib/test_backups.py @@ -32,8 +32,8 @@ from cinder import db from cinder import exception from cinder.i18n import _ from cinder import test -from cinder.tests.api import fakes -from cinder.tests import utils +from cinder.tests.unit.api import fakes +from cinder.tests.unit import utils # needed for stubs to work import cinder.volume diff --git a/cinder/tests/api/contrib/test_cgsnapshots.py b/cinder/tests/unit/api/contrib/test_cgsnapshots.py similarity index 99% rename from cinder/tests/api/contrib/test_cgsnapshots.py rename to cinder/tests/unit/api/contrib/test_cgsnapshots.py index 4654ceef6..b1d970833 100644 --- a/cinder/tests/api/contrib/test_cgsnapshots.py +++ b/cinder/tests/unit/api/contrib/test_cgsnapshots.py @@ -29,8 +29,8 @@ from cinder import context from cinder import db from cinder import exception from cinder import test -from cinder.tests.api import fakes -from cinder.tests import utils +from cinder.tests.unit.api import fakes +from cinder.tests.unit import utils import cinder.volume diff --git a/cinder/tests/api/contrib/test_consistencygroups.py b/cinder/tests/unit/api/contrib/test_consistencygroups.py similarity index 99% rename from cinder/tests/api/contrib/test_consistencygroups.py rename to cinder/tests/unit/api/contrib/test_consistencygroups.py index 70d730dcc..77dd273c0 100644 --- a/cinder/tests/api/contrib/test_consistencygroups.py +++ b/cinder/tests/unit/api/contrib/test_consistencygroups.py @@ -29,9 +29,9 @@ from cinder import db from cinder import exception from cinder.i18n import _ from cinder import test -from cinder.tests.api import fakes -from cinder.tests.api.v2 import stubs -from cinder.tests import utils +from cinder.tests.unit.api import fakes +from cinder.tests.unit.api.v2 import stubs +from cinder.tests.unit import utils from cinder.volume import api as volume_api diff --git a/cinder/tests/api/contrib/test_extended_snapshot_attributes.py b/cinder/tests/unit/api/contrib/test_extended_snapshot_attributes.py similarity index 97% rename from cinder/tests/api/contrib/test_extended_snapshot_attributes.py rename to cinder/tests/unit/api/contrib/test_extended_snapshot_attributes.py index b0daf1989..6b8d2712a 100644 --- a/cinder/tests/api/contrib/test_extended_snapshot_attributes.py +++ b/cinder/tests/unit/api/contrib/test_extended_snapshot_attributes.py @@ -22,9 +22,9 @@ import webob from cinder.api.contrib import extended_snapshot_attributes from cinder import context from cinder import test -from cinder.tests.api import fakes -from cinder.tests import fake_snapshot -from cinder.tests import fake_volume +from cinder.tests.unit.api import fakes +from cinder.tests.unit import fake_snapshot +from cinder.tests.unit import fake_volume UUID1 = '00000000-0000-0000-0000-000000000001' diff --git a/cinder/tests/api/contrib/test_hosts.py b/cinder/tests/unit/api/contrib/test_hosts.py similarity index 100% rename from cinder/tests/api/contrib/test_hosts.py rename to cinder/tests/unit/api/contrib/test_hosts.py diff --git a/cinder/tests/api/contrib/test_qos_specs_manage.py b/cinder/tests/unit/api/contrib/test_qos_specs_manage.py similarity index 99% rename from cinder/tests/api/contrib/test_qos_specs_manage.py rename to cinder/tests/unit/api/contrib/test_qos_specs_manage.py index 1b2ce57b0..27119667a 100644 --- a/cinder/tests/api/contrib/test_qos_specs_manage.py +++ b/cinder/tests/unit/api/contrib/test_qos_specs_manage.py @@ -24,8 +24,8 @@ from cinder.api.contrib import qos_specs_manage from cinder.api import xmlutil from cinder import exception from cinder import test -from cinder.tests.api import fakes -from cinder.tests import fake_notifier +from cinder.tests.unit.api import fakes +from cinder.tests.unit import fake_notifier def stub_qos_specs(id): diff --git a/cinder/tests/api/contrib/test_quotas.py b/cinder/tests/unit/api/contrib/test_quotas.py similarity index 100% rename from cinder/tests/api/contrib/test_quotas.py rename to cinder/tests/unit/api/contrib/test_quotas.py diff --git a/cinder/tests/api/contrib/test_quotas_classes.py b/cinder/tests/unit/api/contrib/test_quotas_classes.py similarity index 100% rename from cinder/tests/api/contrib/test_quotas_classes.py rename to cinder/tests/unit/api/contrib/test_quotas_classes.py diff --git a/cinder/tests/api/contrib/test_scheduler_hints.py b/cinder/tests/unit/api/contrib/test_scheduler_hints.py similarity index 97% rename from cinder/tests/api/contrib/test_scheduler_hints.py rename to cinder/tests/unit/api/contrib/test_scheduler_hints.py index 1098ee207..2fffe1192 100644 --- a/cinder/tests/api/contrib/test_scheduler_hints.py +++ b/cinder/tests/unit/api/contrib/test_scheduler_hints.py @@ -20,8 +20,8 @@ from oslo_serialization import jsonutils import cinder from cinder.api.openstack import wsgi from cinder import test -from cinder.tests.api import fakes -from cinder.tests.api.v2 import stubs +from cinder.tests.unit.api import fakes +from cinder.tests.unit.api.v2 import stubs UUID = fakes.FAKE_UUID diff --git a/cinder/tests/api/contrib/test_scheduler_stats.py b/cinder/tests/unit/api/contrib/test_scheduler_stats.py similarity index 98% rename from cinder/tests/api/contrib/test_scheduler_stats.py rename to cinder/tests/unit/api/contrib/test_scheduler_stats.py index ca0518bdd..975711282 100644 --- a/cinder/tests/api/contrib/test_scheduler_stats.py +++ b/cinder/tests/unit/api/contrib/test_scheduler_stats.py @@ -19,7 +19,7 @@ import mock from cinder.api.contrib import scheduler_stats from cinder import context from cinder import test -from cinder.tests.api import fakes +from cinder.tests.unit.api import fakes def schedule_rpcapi_get_pools(self, context, filters=None): diff --git a/cinder/tests/api/contrib/test_services.py b/cinder/tests/unit/api/contrib/test_services.py similarity index 99% rename from cinder/tests/api/contrib/test_services.py rename to cinder/tests/unit/api/contrib/test_services.py index d8aeb1ee2..8940a053c 100644 --- a/cinder/tests/api/contrib/test_services.py +++ b/cinder/tests/unit/api/contrib/test_services.py @@ -26,7 +26,7 @@ from cinder import db from cinder import exception from cinder import policy from cinder import test -from cinder.tests.api import fakes +from cinder.tests.unit.api import fakes fake_services_list = [ diff --git a/cinder/tests/api/contrib/test_snapshot_actions.py b/cinder/tests/unit/api/contrib/test_snapshot_actions.py similarity index 97% rename from cinder/tests/api/contrib/test_snapshot_actions.py rename to cinder/tests/unit/api/contrib/test_snapshot_actions.py index f955428ac..be2592fe5 100644 --- a/cinder/tests/api/contrib/test_snapshot_actions.py +++ b/cinder/tests/unit/api/contrib/test_snapshot_actions.py @@ -17,8 +17,8 @@ import webob from cinder import db from cinder import test -from cinder.tests.api import fakes -from cinder.tests.api.v2 import stubs +from cinder.tests.unit.api import fakes +from cinder.tests.unit.api.v2 import stubs class SnapshotActionsTest(test.TestCase): diff --git a/cinder/tests/api/contrib/test_types_extra_specs.py b/cinder/tests/unit/api/contrib/test_types_extra_specs.py similarity index 99% rename from cinder/tests/api/contrib/test_types_extra_specs.py rename to cinder/tests/unit/api/contrib/test_types_extra_specs.py index d86531485..0c1ebbe47 100644 --- a/cinder/tests/api/contrib/test_types_extra_specs.py +++ b/cinder/tests/unit/api/contrib/test_types_extra_specs.py @@ -22,8 +22,8 @@ import webob from cinder.api.contrib import types_extra_specs from cinder import exception from cinder import test -from cinder.tests.api import fakes -from cinder.tests import fake_notifier +from cinder.tests.unit.api import fakes +from cinder.tests.unit import fake_notifier import cinder.wsgi diff --git a/cinder/tests/api/contrib/test_types_manage.py b/cinder/tests/unit/api/contrib/test_types_manage.py similarity index 99% rename from cinder/tests/api/contrib/test_types_manage.py rename to cinder/tests/unit/api/contrib/test_types_manage.py index 6b8530ea5..f20419d14 100644 --- a/cinder/tests/api/contrib/test_types_manage.py +++ b/cinder/tests/unit/api/contrib/test_types_manage.py @@ -19,8 +19,8 @@ import webob from cinder.api.contrib import types_manage from cinder import exception from cinder import test -from cinder.tests.api import fakes -from cinder.tests import fake_notifier +from cinder.tests.unit.api import fakes +from cinder.tests.unit import fake_notifier from cinder.volume import volume_types diff --git a/cinder/tests/api/contrib/test_used_limits.py b/cinder/tests/unit/api/contrib/test_used_limits.py similarity index 98% rename from cinder/tests/api/contrib/test_used_limits.py rename to cinder/tests/unit/api/contrib/test_used_limits.py index 86971bf83..0c4f1f1d8 100644 --- a/cinder/tests/api/contrib/test_used_limits.py +++ b/cinder/tests/unit/api/contrib/test_used_limits.py @@ -17,7 +17,7 @@ from cinder.api.contrib import used_limits from cinder.api.openstack import wsgi from cinder import quota from cinder import test -from cinder.tests.api import fakes +from cinder.tests.unit.api import fakes class FakeRequest(object): diff --git a/cinder/tests/api/contrib/test_volume_actions.py b/cinder/tests/unit/api/contrib/test_volume_actions.py similarity index 99% rename from cinder/tests/api/contrib/test_volume_actions.py rename to cinder/tests/unit/api/contrib/test_volume_actions.py index cee967afe..d59607c5d 100644 --- a/cinder/tests/api/contrib/test_volume_actions.py +++ b/cinder/tests/unit/api/contrib/test_volume_actions.py @@ -26,8 +26,8 @@ from cinder.api.contrib import volume_actions from cinder import exception from cinder.image import glance from cinder import test -from cinder.tests.api import fakes -from cinder.tests.api.v2 import stubs +from cinder.tests.unit.api import fakes +from cinder.tests.unit.api.v2 import stubs from cinder import volume from cinder.volume import api as volume_api from cinder.volume import rpcapi as volume_rpcapi diff --git a/cinder/tests/api/contrib/test_volume_encryption_metadata.py b/cinder/tests/unit/api/contrib/test_volume_encryption_metadata.py similarity index 99% rename from cinder/tests/api/contrib/test_volume_encryption_metadata.py rename to cinder/tests/unit/api/contrib/test_volume_encryption_metadata.py index 29c5dec27..a6678cec6 100644 --- a/cinder/tests/api/contrib/test_volume_encryption_metadata.py +++ b/cinder/tests/unit/api/contrib/test_volume_encryption_metadata.py @@ -21,7 +21,7 @@ from cinder.api.contrib import volume_encryption_metadata from cinder import context from cinder import db from cinder import test -from cinder.tests.api import fakes +from cinder.tests.unit.api import fakes from cinder.volume import volume_types diff --git a/cinder/tests/api/contrib/test_volume_host_attribute.py b/cinder/tests/unit/api/contrib/test_volume_host_attribute.py similarity index 99% rename from cinder/tests/api/contrib/test_volume_host_attribute.py rename to cinder/tests/unit/api/contrib/test_volume_host_attribute.py index 2505fca9a..848b9b1e1 100644 --- a/cinder/tests/api/contrib/test_volume_host_attribute.py +++ b/cinder/tests/unit/api/contrib/test_volume_host_attribute.py @@ -22,7 +22,7 @@ import webob from cinder import context from cinder import db from cinder import test -from cinder.tests.api import fakes +from cinder.tests.unit.api import fakes from cinder import volume diff --git a/cinder/tests/api/contrib/test_volume_image_metadata.py b/cinder/tests/unit/api/contrib/test_volume_image_metadata.py similarity index 99% rename from cinder/tests/api/contrib/test_volume_image_metadata.py rename to cinder/tests/unit/api/contrib/test_volume_image_metadata.py index 954245b9d..9f5268890 100644 --- a/cinder/tests/api/contrib/test_volume_image_metadata.py +++ b/cinder/tests/unit/api/contrib/test_volume_image_metadata.py @@ -23,7 +23,7 @@ from cinder.api import common from cinder.api.openstack import wsgi from cinder import db from cinder import test -from cinder.tests.api import fakes +from cinder.tests.unit.api import fakes from cinder import volume diff --git a/cinder/tests/api/contrib/test_volume_manage.py b/cinder/tests/unit/api/contrib/test_volume_manage.py similarity index 99% rename from cinder/tests/api/contrib/test_volume_manage.py rename to cinder/tests/unit/api/contrib/test_volume_manage.py index 9363e2647..f05ebac06 100644 --- a/cinder/tests/api/contrib/test_volume_manage.py +++ b/cinder/tests/unit/api/contrib/test_volume_manage.py @@ -19,7 +19,7 @@ import webob from cinder import context from cinder import exception from cinder import test -from cinder.tests.api import fakes +from cinder.tests.unit.api import fakes def app(): diff --git a/cinder/tests/api/contrib/test_volume_migration_status_attribute.py b/cinder/tests/unit/api/contrib/test_volume_migration_status_attribute.py similarity index 99% rename from cinder/tests/api/contrib/test_volume_migration_status_attribute.py rename to cinder/tests/unit/api/contrib/test_volume_migration_status_attribute.py index b99f009c2..241ea0beb 100644 --- a/cinder/tests/api/contrib/test_volume_migration_status_attribute.py +++ b/cinder/tests/unit/api/contrib/test_volume_migration_status_attribute.py @@ -21,7 +21,7 @@ import webob from cinder import context from cinder import test -from cinder.tests.api import fakes +from cinder.tests.unit.api import fakes from cinder import volume diff --git a/cinder/tests/api/contrib/test_volume_replication.py b/cinder/tests/unit/api/contrib/test_volume_replication.py similarity index 99% rename from cinder/tests/api/contrib/test_volume_replication.py rename to cinder/tests/unit/api/contrib/test_volume_replication.py index 4277a205c..8de27087f 100644 --- a/cinder/tests/api/contrib/test_volume_replication.py +++ b/cinder/tests/unit/api/contrib/test_volume_replication.py @@ -24,8 +24,8 @@ import webob from cinder import context from cinder import test -from cinder.tests.api import fakes -from cinder.tests import utils as tests_utils +from cinder.tests.unit.api import fakes +from cinder.tests.unit import utils as tests_utils CONF = cfg.CONF diff --git a/cinder/tests/api/contrib/test_volume_tenant_attribute.py b/cinder/tests/unit/api/contrib/test_volume_tenant_attribute.py similarity index 99% rename from cinder/tests/api/contrib/test_volume_tenant_attribute.py rename to cinder/tests/unit/api/contrib/test_volume_tenant_attribute.py index 5c671c2be..1c2db1579 100644 --- a/cinder/tests/api/contrib/test_volume_tenant_attribute.py +++ b/cinder/tests/unit/api/contrib/test_volume_tenant_attribute.py @@ -21,7 +21,7 @@ import webob from cinder import context from cinder import test -from cinder.tests.api import fakes +from cinder.tests.unit.api import fakes from cinder import volume diff --git a/cinder/tests/api/contrib/test_volume_transfer.py b/cinder/tests/unit/api/contrib/test_volume_transfer.py similarity index 99% rename from cinder/tests/api/contrib/test_volume_transfer.py rename to cinder/tests/unit/api/contrib/test_volume_transfer.py index 0b541e166..81eaeeefd 100644 --- a/cinder/tests/api/contrib/test_volume_transfer.py +++ b/cinder/tests/unit/api/contrib/test_volume_transfer.py @@ -28,7 +28,7 @@ from cinder import context from cinder import db from cinder import exception from cinder import test -from cinder.tests.api import fakes +from cinder.tests.unit.api import fakes from cinder import transfer import cinder.volume diff --git a/cinder/tests/api/contrib/test_volume_type_access.py b/cinder/tests/unit/api/contrib/test_volume_type_access.py similarity index 99% rename from cinder/tests/api/contrib/test_volume_type_access.py rename to cinder/tests/unit/api/contrib/test_volume_type_access.py index 218ccd835..96d06c9cf 100644 --- a/cinder/tests/api/contrib/test_volume_type_access.py +++ b/cinder/tests/unit/api/contrib/test_volume_type_access.py @@ -21,7 +21,7 @@ from cinder import context from cinder import db from cinder import exception from cinder import test -from cinder.tests.api import fakes +from cinder.tests.unit.api import fakes def generate_type(type_id, is_public): diff --git a/cinder/tests/api/contrib/test_volume_type_encryption.py b/cinder/tests/unit/api/contrib/test_volume_type_encryption.py similarity index 99% rename from cinder/tests/api/contrib/test_volume_type_encryption.py rename to cinder/tests/unit/api/contrib/test_volume_type_encryption.py index 9bf1f9852..8e7085c8b 100644 --- a/cinder/tests/api/contrib/test_volume_type_encryption.py +++ b/cinder/tests/unit/api/contrib/test_volume_type_encryption.py @@ -20,8 +20,8 @@ import webob from cinder import context from cinder import db from cinder import test -from cinder.tests.api import fakes -from cinder.tests import fake_notifier +from cinder.tests.unit.api import fakes +from cinder.tests.unit import fake_notifier def return_volume_type_encryption(context, volume_type_id): diff --git a/cinder/tests/api/contrib/test_volume_unmanage.py b/cinder/tests/unit/api/contrib/test_volume_unmanage.py similarity index 99% rename from cinder/tests/api/contrib/test_volume_unmanage.py rename to cinder/tests/unit/api/contrib/test_volume_unmanage.py index 2939a61b8..fcbc856a4 100644 --- a/cinder/tests/api/contrib/test_volume_unmanage.py +++ b/cinder/tests/unit/api/contrib/test_volume_unmanage.py @@ -19,7 +19,7 @@ import webob from cinder import context from cinder import exception from cinder import test -from cinder.tests.api import fakes +from cinder.tests.unit.api import fakes # This list of fake volumes is used by our tests. Each is configured in a diff --git a/cinder/tests/api/extensions/__init__.py b/cinder/tests/unit/api/extensions/__init__.py similarity index 100% rename from cinder/tests/api/extensions/__init__.py rename to cinder/tests/unit/api/extensions/__init__.py diff --git a/cinder/tests/api/extensions/foxinsocks.py b/cinder/tests/unit/api/extensions/foxinsocks.py similarity index 100% rename from cinder/tests/api/extensions/foxinsocks.py rename to cinder/tests/unit/api/extensions/foxinsocks.py diff --git a/cinder/tests/api/fakes.py b/cinder/tests/unit/api/fakes.py similarity index 100% rename from cinder/tests/api/fakes.py rename to cinder/tests/unit/api/fakes.py diff --git a/cinder/tests/api/middleware/__init__.py b/cinder/tests/unit/api/middleware/__init__.py similarity index 100% rename from cinder/tests/api/middleware/__init__.py rename to cinder/tests/unit/api/middleware/__init__.py diff --git a/cinder/tests/api/middleware/test_auth.py b/cinder/tests/unit/api/middleware/test_auth.py similarity index 100% rename from cinder/tests/api/middleware/test_auth.py rename to cinder/tests/unit/api/middleware/test_auth.py diff --git a/cinder/tests/api/middleware/test_faults.py b/cinder/tests/unit/api/middleware/test_faults.py similarity index 100% rename from cinder/tests/api/middleware/test_faults.py rename to cinder/tests/unit/api/middleware/test_faults.py diff --git a/cinder/tests/api/openstack/__init__.py b/cinder/tests/unit/api/openstack/__init__.py similarity index 100% rename from cinder/tests/api/openstack/__init__.py rename to cinder/tests/unit/api/openstack/__init__.py diff --git a/cinder/tests/api/openstack/test_wsgi.py b/cinder/tests/unit/api/openstack/test_wsgi.py similarity index 99% rename from cinder/tests/api/openstack/test_wsgi.py rename to cinder/tests/unit/api/openstack/test_wsgi.py index 16ccbd718..af5cb38d0 100644 --- a/cinder/tests/api/openstack/test_wsgi.py +++ b/cinder/tests/unit/api/openstack/test_wsgi.py @@ -17,7 +17,7 @@ import webob from cinder.api.openstack import wsgi from cinder import exception from cinder import test -from cinder.tests.api import fakes +from cinder.tests.unit.api import fakes class RequestTest(test.TestCase): diff --git a/cinder/tests/api/test_common.py b/cinder/tests/unit/api/test_common.py similarity index 100% rename from cinder/tests/api/test_common.py rename to cinder/tests/unit/api/test_common.py diff --git a/cinder/tests/api/test_extensions.py b/cinder/tests/unit/api/test_extensions.py similarity index 99% rename from cinder/tests/api/test_extensions.py rename to cinder/tests/unit/api/test_extensions.py index 374021ba0..bfdc63c20 100644 --- a/cinder/tests/api/test_extensions.py +++ b/cinder/tests/unit/api/test_extensions.py @@ -36,7 +36,7 @@ class ExtensionTestCase(test.TestCase): def setUp(self): super(ExtensionTestCase, self).setUp() ext_list = CONF.osapi_volume_extension[:] - fox = ('cinder.tests.api.extensions.foxinsocks.Foxinsocks') + fox = ('cinder.tests.unit.api.extensions.foxinsocks.Foxinsocks') if fox not in ext_list: ext_list.append(fox) self.flags(osapi_volume_extension=ext_list) diff --git a/cinder/tests/api/test_router.py b/cinder/tests/unit/api/test_router.py similarity index 99% rename from cinder/tests/api/test_router.py rename to cinder/tests/unit/api/test_router.py index e38a62a5e..2e23cdbf4 100644 --- a/cinder/tests/api/test_router.py +++ b/cinder/tests/unit/api/test_router.py @@ -21,7 +21,7 @@ from cinder.api.v1 import snapshots from cinder.api.v1 import volumes from cinder.api import versions from cinder import test -from cinder.tests.api import fakes +from cinder.tests.unit.api import fakes LOG = logging.getLogger(__name__) diff --git a/cinder/tests/api/test_versions.py b/cinder/tests/unit/api/test_versions.py similarity index 100% rename from cinder/tests/api/test_versions.py rename to cinder/tests/unit/api/test_versions.py diff --git a/cinder/tests/api/test_wsgi.py b/cinder/tests/unit/api/test_wsgi.py similarity index 100% rename from cinder/tests/api/test_wsgi.py rename to cinder/tests/unit/api/test_wsgi.py diff --git a/cinder/tests/api/test_xmlutil.py b/cinder/tests/unit/api/test_xmlutil.py similarity index 100% rename from cinder/tests/api/test_xmlutil.py rename to cinder/tests/unit/api/test_xmlutil.py diff --git a/cinder/tests/api/v1/__init__.py b/cinder/tests/unit/api/v1/__init__.py similarity index 100% rename from cinder/tests/api/v1/__init__.py rename to cinder/tests/unit/api/v1/__init__.py diff --git a/cinder/tests/api/v1/stubs.py b/cinder/tests/unit/api/v1/stubs.py similarity index 100% rename from cinder/tests/api/v1/stubs.py rename to cinder/tests/unit/api/v1/stubs.py diff --git a/cinder/tests/api/v1/test_limits.py b/cinder/tests/unit/api/v1/test_limits.py similarity index 100% rename from cinder/tests/api/v1/test_limits.py rename to cinder/tests/unit/api/v1/test_limits.py diff --git a/cinder/tests/api/v1/test_snapshot_metadata.py b/cinder/tests/unit/api/v1/test_snapshot_metadata.py similarity index 99% rename from cinder/tests/api/v1/test_snapshot_metadata.py rename to cinder/tests/unit/api/v1/test_snapshot_metadata.py index 82cc5cbd3..ccd49e22c 100644 --- a/cinder/tests/api/v1/test_snapshot_metadata.py +++ b/cinder/tests/unit/api/v1/test_snapshot_metadata.py @@ -27,9 +27,9 @@ from cinder import context import cinder.db from cinder import exception from cinder import test -from cinder.tests.api import fakes -from cinder.tests import fake_snapshot -from cinder.tests import fake_volume +from cinder.tests.unit.api import fakes +from cinder.tests.unit import fake_snapshot +from cinder.tests.unit import fake_volume CONF = cfg.CONF diff --git a/cinder/tests/api/v1/test_snapshots.py b/cinder/tests/unit/api/v1/test_snapshots.py similarity index 99% rename from cinder/tests/api/v1/test_snapshots.py rename to cinder/tests/unit/api/v1/test_snapshots.py index bc6d76f82..6e2984644 100644 --- a/cinder/tests/api/v1/test_snapshots.py +++ b/cinder/tests/unit/api/v1/test_snapshots.py @@ -24,10 +24,10 @@ from cinder import context from cinder import db from cinder import exception from cinder import test -from cinder.tests.api import fakes -from cinder.tests.api.v1 import stubs -from cinder.tests import fake_snapshot -from cinder.tests import fake_volume +from cinder.tests.unit.api import fakes +from cinder.tests.unit.api.v1 import stubs +from cinder.tests.unit import fake_snapshot +from cinder.tests.unit import fake_volume from cinder import volume diff --git a/cinder/tests/api/v1/test_types.py b/cinder/tests/unit/api/v1/test_types.py similarity index 99% rename from cinder/tests/api/v1/test_types.py rename to cinder/tests/unit/api/v1/test_types.py index 290f279e4..60d3e1914 100644 --- a/cinder/tests/api/v1/test_types.py +++ b/cinder/tests/unit/api/v1/test_types.py @@ -23,7 +23,7 @@ from cinder.api.v1 import types from cinder.api.views import types as views_types from cinder import exception from cinder import test -from cinder.tests.api import fakes +from cinder.tests.unit.api import fakes from cinder.volume import volume_types diff --git a/cinder/tests/api/v1/test_volume_metadata.py b/cinder/tests/unit/api/v1/test_volume_metadata.py similarity index 99% rename from cinder/tests/api/v1/test_volume_metadata.py rename to cinder/tests/unit/api/v1/test_volume_metadata.py index af70cfcf2..e8de1955b 100644 --- a/cinder/tests/api/v1/test_volume_metadata.py +++ b/cinder/tests/unit/api/v1/test_volume_metadata.py @@ -25,8 +25,8 @@ from cinder.api.v1 import volumes import cinder.db from cinder import exception from cinder import test -from cinder.tests.api import fakes -from cinder.tests.api.v1 import stubs +from cinder.tests.unit.api import fakes +from cinder.tests.unit.api.v1 import stubs CONF = cfg.CONF diff --git a/cinder/tests/api/v1/test_volumes.py b/cinder/tests/unit/api/v1/test_volumes.py similarity index 99% rename from cinder/tests/api/v1/test_volumes.py rename to cinder/tests/unit/api/v1/test_volumes.py index 6052a7efa..908034c85 100644 --- a/cinder/tests/api/v1/test_volumes.py +++ b/cinder/tests/unit/api/v1/test_volumes.py @@ -27,10 +27,10 @@ from cinder import context from cinder import db from cinder import exception from cinder import test -from cinder.tests.api import fakes -from cinder.tests.api.v2 import stubs -from cinder.tests import fake_notifier -from cinder.tests.image import fake as fake_image +from cinder.tests.unit.api import fakes +from cinder.tests.unit.api.v2 import stubs +from cinder.tests.unit import fake_notifier +from cinder.tests.unit.image import fake as fake_image from cinder.volume import api as volume_api diff --git a/cinder/tests/api/v2/__init__.py b/cinder/tests/unit/api/v2/__init__.py similarity index 100% rename from cinder/tests/api/v2/__init__.py rename to cinder/tests/unit/api/v2/__init__.py diff --git a/cinder/tests/api/v2/stubs.py b/cinder/tests/unit/api/v2/stubs.py similarity index 100% rename from cinder/tests/api/v2/stubs.py rename to cinder/tests/unit/api/v2/stubs.py diff --git a/cinder/tests/api/v2/test_limits.py b/cinder/tests/unit/api/v2/test_limits.py similarity index 100% rename from cinder/tests/api/v2/test_limits.py rename to cinder/tests/unit/api/v2/test_limits.py diff --git a/cinder/tests/api/v2/test_snapshot_metadata.py b/cinder/tests/unit/api/v2/test_snapshot_metadata.py similarity index 99% rename from cinder/tests/api/v2/test_snapshot_metadata.py rename to cinder/tests/unit/api/v2/test_snapshot_metadata.py index 5f608f0b5..633def0b6 100644 --- a/cinder/tests/api/v2/test_snapshot_metadata.py +++ b/cinder/tests/unit/api/v2/test_snapshot_metadata.py @@ -27,9 +27,9 @@ from cinder import context import cinder.db from cinder import exception from cinder import test -from cinder.tests.api import fakes -from cinder.tests import fake_snapshot -from cinder.tests import fake_volume +from cinder.tests.unit.api import fakes +from cinder.tests.unit import fake_snapshot +from cinder.tests.unit import fake_volume CONF = cfg.CONF diff --git a/cinder/tests/api/v2/test_snapshots.py b/cinder/tests/unit/api/v2/test_snapshots.py similarity index 99% rename from cinder/tests/api/v2/test_snapshots.py rename to cinder/tests/unit/api/v2/test_snapshots.py index dde584adc..b10d1ca88 100644 --- a/cinder/tests/api/v2/test_snapshots.py +++ b/cinder/tests/unit/api/v2/test_snapshots.py @@ -24,10 +24,10 @@ from cinder import context from cinder import db from cinder import exception from cinder import test -from cinder.tests.api import fakes -from cinder.tests.api.v2 import stubs -from cinder.tests import fake_snapshot -from cinder.tests import fake_volume +from cinder.tests.unit.api import fakes +from cinder.tests.unit.api.v2 import stubs +from cinder.tests.unit import fake_snapshot +from cinder.tests.unit import fake_volume from cinder import volume diff --git a/cinder/tests/api/v2/test_types.py b/cinder/tests/unit/api/v2/test_types.py similarity index 99% rename from cinder/tests/api/v2/test_types.py rename to cinder/tests/unit/api/v2/test_types.py index c2877dd2c..388492a10 100644 --- a/cinder/tests/api/v2/test_types.py +++ b/cinder/tests/unit/api/v2/test_types.py @@ -24,7 +24,7 @@ from cinder.api.v2 import types from cinder.api.views import types as views_types from cinder import exception from cinder import test -from cinder.tests.api import fakes +from cinder.tests.unit.api import fakes from cinder.volume import volume_types diff --git a/cinder/tests/api/v2/test_volume_metadata.py b/cinder/tests/unit/api/v2/test_volume_metadata.py similarity index 99% rename from cinder/tests/api/v2/test_volume_metadata.py rename to cinder/tests/unit/api/v2/test_volume_metadata.py index d4eb6e1c9..d40f52008 100644 --- a/cinder/tests/api/v2/test_volume_metadata.py +++ b/cinder/tests/unit/api/v2/test_volume_metadata.py @@ -25,8 +25,8 @@ from cinder.api.v2 import volumes from cinder import db from cinder import exception from cinder import test -from cinder.tests.api import fakes -from cinder.tests.api.v2 import stubs +from cinder.tests.unit.api import fakes +from cinder.tests.unit.api.v2 import stubs from cinder.volume import api as volume_api diff --git a/cinder/tests/api/v2/test_volumes.py b/cinder/tests/unit/api/v2/test_volumes.py similarity index 99% rename from cinder/tests/api/v2/test_volumes.py rename to cinder/tests/unit/api/v2/test_volumes.py index f65a26614..d74154b55 100644 --- a/cinder/tests/api/v2/test_volumes.py +++ b/cinder/tests/unit/api/v2/test_volumes.py @@ -30,10 +30,10 @@ from cinder import context from cinder import db from cinder import exception from cinder import test -from cinder.tests.api import fakes -from cinder.tests.api.v2 import stubs -from cinder.tests import fake_notifier -from cinder.tests.image import fake as fake_image +from cinder.tests.unit.api import fakes +from cinder.tests.unit.api.v2 import stubs +from cinder.tests.unit import fake_notifier +from cinder.tests.unit.image import fake as fake_image from cinder.volume import api as volume_api CONF = cfg.CONF diff --git a/cinder/tests/backup/__init__.py b/cinder/tests/unit/backup/__init__.py similarity index 100% rename from cinder/tests/backup/__init__.py rename to cinder/tests/unit/backup/__init__.py diff --git a/cinder/tests/backup/drivers/__init__.py b/cinder/tests/unit/backup/drivers/__init__.py similarity index 100% rename from cinder/tests/backup/drivers/__init__.py rename to cinder/tests/unit/backup/drivers/__init__.py diff --git a/cinder/tests/backup/drivers/test_backup_nfs.py b/cinder/tests/unit/backup/drivers/test_backup_nfs.py similarity index 100% rename from cinder/tests/backup/drivers/test_backup_nfs.py rename to cinder/tests/unit/backup/drivers/test_backup_nfs.py diff --git a/cinder/tests/backup/fake_service.py b/cinder/tests/unit/backup/fake_service.py similarity index 100% rename from cinder/tests/backup/fake_service.py rename to cinder/tests/unit/backup/fake_service.py diff --git a/cinder/tests/backup/fake_service_with_verify.py b/cinder/tests/unit/backup/fake_service_with_verify.py similarity index 95% rename from cinder/tests/backup/fake_service_with_verify.py rename to cinder/tests/unit/backup/fake_service_with_verify.py index 8f7821c5e..4673b26fd 100644 --- a/cinder/tests/backup/fake_service_with_verify.py +++ b/cinder/tests/unit/backup/fake_service_with_verify.py @@ -16,7 +16,7 @@ from oslo_log import log as logging from cinder.backup import driver -from cinder.tests.backup import fake_service +from cinder.tests.unit.backup import fake_service LOG = logging.getLogger(__name__) diff --git a/cinder/tests/backup/fake_swift_client.py b/cinder/tests/unit/backup/fake_swift_client.py similarity index 100% rename from cinder/tests/backup/fake_swift_client.py rename to cinder/tests/unit/backup/fake_swift_client.py diff --git a/cinder/tests/backup/fake_swift_client2.py b/cinder/tests/unit/backup/fake_swift_client2.py similarity index 100% rename from cinder/tests/backup/fake_swift_client2.py rename to cinder/tests/unit/backup/fake_swift_client2.py diff --git a/cinder/tests/brick/__init__.py b/cinder/tests/unit/brick/__init__.py similarity index 100% rename from cinder/tests/brick/__init__.py rename to cinder/tests/unit/brick/__init__.py diff --git a/cinder/tests/brick/fake_lvm.py b/cinder/tests/unit/brick/fake_lvm.py similarity index 100% rename from cinder/tests/brick/fake_lvm.py rename to cinder/tests/unit/brick/fake_lvm.py diff --git a/cinder/tests/brick/test_brick_connector.py b/cinder/tests/unit/brick/test_brick_connector.py similarity index 100% rename from cinder/tests/brick/test_brick_connector.py rename to cinder/tests/unit/brick/test_brick_connector.py diff --git a/cinder/tests/brick/test_brick_exception.py b/cinder/tests/unit/brick/test_brick_exception.py similarity index 100% rename from cinder/tests/brick/test_brick_exception.py rename to cinder/tests/unit/brick/test_brick_exception.py diff --git a/cinder/tests/brick/test_brick_linuxfc.py b/cinder/tests/unit/brick/test_brick_linuxfc.py similarity index 100% rename from cinder/tests/brick/test_brick_linuxfc.py rename to cinder/tests/unit/brick/test_brick_linuxfc.py diff --git a/cinder/tests/brick/test_brick_linuxscsi.py b/cinder/tests/unit/brick/test_brick_linuxscsi.py similarity index 100% rename from cinder/tests/brick/test_brick_linuxscsi.py rename to cinder/tests/unit/brick/test_brick_linuxscsi.py diff --git a/cinder/tests/brick/test_brick_lvm.py b/cinder/tests/unit/brick/test_brick_lvm.py similarity index 100% rename from cinder/tests/brick/test_brick_lvm.py rename to cinder/tests/unit/brick/test_brick_lvm.py diff --git a/cinder/tests/brick/test_brick_remotefs.py b/cinder/tests/unit/brick/test_brick_remotefs.py similarity index 100% rename from cinder/tests/brick/test_brick_remotefs.py rename to cinder/tests/unit/brick/test_brick_remotefs.py diff --git a/cinder/tests/cast_as_call.py b/cinder/tests/unit/cast_as_call.py similarity index 100% rename from cinder/tests/cast_as_call.py rename to cinder/tests/unit/cast_as_call.py diff --git a/cinder/tests/compute/__init__.py b/cinder/tests/unit/compute/__init__.py similarity index 100% rename from cinder/tests/compute/__init__.py rename to cinder/tests/unit/compute/__init__.py diff --git a/cinder/tests/compute/test_nova.py b/cinder/tests/unit/compute/test_nova.py similarity index 100% rename from cinder/tests/compute/test_nova.py rename to cinder/tests/unit/compute/test_nova.py diff --git a/cinder/tests/conf_fixture.py b/cinder/tests/unit/conf_fixture.py similarity index 84% rename from cinder/tests/conf_fixture.py rename to cinder/tests/unit/conf_fixture.py index b1c4ccffc..ae5ee2f19 100644 --- a/cinder/tests/conf_fixture.py +++ b/cinder/tests/unit/conf_fixture.py @@ -35,20 +35,20 @@ def_vol_type = 'fake_vol_type' def set_defaults(conf): conf.set_default('default_volume_type', def_vol_type) conf.set_default('volume_driver', - 'cinder.tests.fake_driver.FakeISCSIDriver') + 'cinder.tests.unit.fake_driver.FakeISCSIDriver') conf.set_default('iscsi_helper', 'fake') conf.set_default('rpc_backend', 'cinder.openstack.common.rpc.impl_fake') conf.set_default('connection', 'sqlite://', group='database') conf.set_default('sqlite_synchronous', False, group='database') - conf.set_default('policy_file', 'cinder/tests/policy.json') + conf.set_default('policy_file', 'cinder.tests.unit/policy.json') conf.set_default( 'xiv_ds8k_proxy', - 'cinder.tests.test_ibm_xiv_ds8k.XIVDS8KFakeProxyDriver') - conf.set_default('backup_driver', 'cinder.tests.backup.fake_service') + 'cinder.tests.unit.test_ibm_xiv_ds8k.XIVDS8KFakeProxyDriver') + conf.set_default('backup_driver', 'cinder.tests.unit.backup.fake_service') conf.set_default('fixed_key', default='0' * 64, group='keymgr') conf.set_default('scheduler_driver', 'cinder.scheduler.filter_scheduler.FilterScheduler') conf.set_default('state_path', os.path.abspath( - os.path.join(os.path.dirname(__file__), '..', '..'))) + os.path.join(os.path.dirname(__file__), '..', '..', '..'))) conf.set_default('policy_dirs', []) conf.set_default('auth_strategy', 'noauth') diff --git a/cinder/tests/db/__init__.py b/cinder/tests/unit/db/__init__.py similarity index 100% rename from cinder/tests/db/__init__.py rename to cinder/tests/unit/db/__init__.py diff --git a/cinder/tests/db/fakes.py b/cinder/tests/unit/db/fakes.py similarity index 100% rename from cinder/tests/db/fakes.py rename to cinder/tests/unit/db/fakes.py diff --git a/cinder/tests/db/test_finish_migration.py b/cinder/tests/unit/db/test_finish_migration.py similarity index 97% rename from cinder/tests/db/test_finish_migration.py rename to cinder/tests/unit/db/test_finish_migration.py index bcd160a8a..38b6e9b42 100644 --- a/cinder/tests/db/test_finish_migration.py +++ b/cinder/tests/unit/db/test_finish_migration.py @@ -18,7 +18,7 @@ from cinder import context from cinder import db from cinder import test -from cinder.tests import utils as testutils +from cinder.tests.unit import utils as testutils class FinishVolumeMigrationTestCase(test.TestCase): diff --git a/cinder/tests/db/test_name_id.py b/cinder/tests/unit/db/test_name_id.py similarity index 97% rename from cinder/tests/db/test_name_id.py rename to cinder/tests/unit/db/test_name_id.py index faeca670e..e1b9f79b7 100644 --- a/cinder/tests/db/test_name_id.py +++ b/cinder/tests/unit/db/test_name_id.py @@ -19,7 +19,7 @@ from oslo_config import cfg from cinder import context from cinder import db from cinder import test -from cinder.tests import utils as testutils +from cinder.tests.unit import utils as testutils CONF = cfg.CONF diff --git a/cinder/tests/db/test_purge.py b/cinder/tests/unit/db/test_purge.py similarity index 100% rename from cinder/tests/db/test_purge.py rename to cinder/tests/unit/db/test_purge.py diff --git a/cinder/tests/db/test_qos_specs.py b/cinder/tests/unit/db/test_qos_specs.py similarity index 100% rename from cinder/tests/db/test_qos_specs.py rename to cinder/tests/unit/db/test_qos_specs.py diff --git a/cinder/tests/db/test_transfers.py b/cinder/tests/unit/db/test_transfers.py similarity index 99% rename from cinder/tests/db/test_transfers.py rename to cinder/tests/unit/db/test_transfers.py index 6ad8b98cb..5e54998ee 100644 --- a/cinder/tests/db/test_transfers.py +++ b/cinder/tests/unit/db/test_transfers.py @@ -21,7 +21,7 @@ from cinder import context from cinder import db from cinder import exception from cinder import test -from cinder.tests import utils +from cinder.tests.unit import utils LOG = logging.getLogger(__name__) diff --git a/cinder/tests/declare_conf.py b/cinder/tests/unit/declare_conf.py similarity index 100% rename from cinder/tests/declare_conf.py rename to cinder/tests/unit/declare_conf.py diff --git a/cinder/tests/fake_driver.py b/cinder/tests/unit/fake_driver.py similarity index 99% rename from cinder/tests/fake_driver.py rename to cinder/tests/unit/fake_driver.py index 2c1b0351c..a0db8ed4d 100644 --- a/cinder/tests/fake_driver.py +++ b/cinder/tests/unit/fake_driver.py @@ -15,7 +15,7 @@ from oslo_log import log as logging from cinder.i18n import _LE -from cinder.tests.brick import fake_lvm +from cinder.tests.unit.brick import fake_lvm from cinder.volume import driver from cinder.volume.drivers import lvm from cinder.zonemanager import utils as fczm_utils diff --git a/cinder/tests/fake_hp_3par_client.py b/cinder/tests/unit/fake_hp_3par_client.py similarity index 92% rename from cinder/tests/fake_hp_3par_client.py rename to cinder/tests/unit/fake_hp_3par_client.py index b6f19d557..99741ead7 100644 --- a/cinder/tests/fake_hp_3par_client.py +++ b/cinder/tests/unit/fake_hp_3par_client.py @@ -19,7 +19,7 @@ import sys import mock -from cinder.tests import fake_hp_client_exceptions as hpexceptions +from cinder.tests.unit import fake_hp_client_exceptions as hpexceptions hp3par = mock.Mock() hp3par.version = "3.1.2" diff --git a/cinder/tests/fake_hp_client_exceptions.py b/cinder/tests/unit/fake_hp_client_exceptions.py similarity index 100% rename from cinder/tests/fake_hp_client_exceptions.py rename to cinder/tests/unit/fake_hp_client_exceptions.py diff --git a/cinder/tests/fake_hp_lefthand_client.py b/cinder/tests/unit/fake_hp_lefthand_client.py similarity index 92% rename from cinder/tests/fake_hp_lefthand_client.py rename to cinder/tests/unit/fake_hp_lefthand_client.py index 791304b47..ca3376d14 100644 --- a/cinder/tests/fake_hp_lefthand_client.py +++ b/cinder/tests/unit/fake_hp_lefthand_client.py @@ -19,7 +19,7 @@ import sys import mock -from cinder.tests import fake_hp_client_exceptions as hpexceptions +from cinder.tests.unit import fake_hp_client_exceptions as hpexceptions hplefthand = mock.Mock() hplefthand.version = "1.0.4" diff --git a/cinder/tests/fake_notifier.py b/cinder/tests/unit/fake_notifier.py similarity index 100% rename from cinder/tests/fake_notifier.py rename to cinder/tests/unit/fake_notifier.py diff --git a/cinder/tests/fake_snapshot.py b/cinder/tests/unit/fake_snapshot.py similarity index 100% rename from cinder/tests/fake_snapshot.py rename to cinder/tests/unit/fake_snapshot.py diff --git a/cinder/tests/fake_utils.py b/cinder/tests/unit/fake_utils.py similarity index 100% rename from cinder/tests/fake_utils.py rename to cinder/tests/unit/fake_utils.py diff --git a/cinder/tests/fake_vmem_client.py b/cinder/tests/unit/fake_vmem_client.py similarity index 100% rename from cinder/tests/fake_vmem_client.py rename to cinder/tests/unit/fake_vmem_client.py diff --git a/cinder/tests/fake_volume.py b/cinder/tests/unit/fake_volume.py similarity index 100% rename from cinder/tests/fake_volume.py rename to cinder/tests/unit/fake_volume.py diff --git a/cinder/tests/glance/__init__.py b/cinder/tests/unit/glance/__init__.py similarity index 100% rename from cinder/tests/glance/__init__.py rename to cinder/tests/unit/glance/__init__.py diff --git a/cinder/tests/glance/stubs.py b/cinder/tests/unit/glance/stubs.py similarity index 100% rename from cinder/tests/glance/stubs.py rename to cinder/tests/unit/glance/stubs.py diff --git a/cinder/tests/image/__init__.py b/cinder/tests/unit/image/__init__.py similarity index 100% rename from cinder/tests/image/__init__.py rename to cinder/tests/unit/image/__init__.py diff --git a/cinder/tests/image/fake.py b/cinder/tests/unit/image/fake.py similarity index 100% rename from cinder/tests/image/fake.py rename to cinder/tests/unit/image/fake.py diff --git a/cinder/tests/image/test_glance.py b/cinder/tests/unit/image/test_glance.py similarity index 99% rename from cinder/tests/image/test_glance.py rename to cinder/tests/unit/image/test_glance.py index 123a5a25d..f4032c7bf 100644 --- a/cinder/tests/image/test_glance.py +++ b/cinder/tests/unit/image/test_glance.py @@ -24,7 +24,7 @@ from cinder import context from cinder import exception from cinder.image import glance from cinder import test -from cinder.tests.glance import stubs as glance_stubs +from cinder.tests.unit.glance import stubs as glance_stubs CONF = cfg.CONF diff --git a/cinder/tests/integrated/__init__.py b/cinder/tests/unit/integrated/__init__.py similarity index 100% rename from cinder/tests/integrated/__init__.py rename to cinder/tests/unit/integrated/__init__.py diff --git a/cinder/tests/integrated/api/__init__.py b/cinder/tests/unit/integrated/api/__init__.py similarity index 100% rename from cinder/tests/integrated/api/__init__.py rename to cinder/tests/unit/integrated/api/__init__.py diff --git a/cinder/tests/integrated/api/client.py b/cinder/tests/unit/integrated/api/client.py similarity index 100% rename from cinder/tests/integrated/api/client.py rename to cinder/tests/unit/integrated/api/client.py diff --git a/cinder/tests/integrated/integrated_helpers.py b/cinder/tests/unit/integrated/integrated_helpers.py similarity index 98% rename from cinder/tests/integrated/integrated_helpers.py rename to cinder/tests/unit/integrated/integrated_helpers.py index 20d6fbff1..17a9543a8 100644 --- a/cinder/tests/integrated/integrated_helpers.py +++ b/cinder/tests/unit/integrated/integrated_helpers.py @@ -27,7 +27,7 @@ from oslo_log import log as logging from cinder import service from cinder import test # For the flags -from cinder.tests.integrated.api import client +from cinder.tests.unit.integrated.api import client LOG = logging.getLogger(__name__) diff --git a/cinder/tests/integrated/test_extensions.py b/cinder/tests/unit/integrated/test_extensions.py similarity index 91% rename from cinder/tests/integrated/test_extensions.py rename to cinder/tests/unit/integrated/test_extensions.py index 1e140143c..9bcab2642 100644 --- a/cinder/tests/integrated/test_extensions.py +++ b/cinder/tests/unit/integrated/test_extensions.py @@ -17,7 +17,7 @@ from oslo_config import cfg from oslo_log import log as logging -from cinder.tests.integrated import integrated_helpers +from cinder.tests.unit.integrated import integrated_helpers CONF = cfg.CONF @@ -30,7 +30,7 @@ class ExtensionsTest(integrated_helpers._IntegratedTestBase): f = super(ExtensionsTest, self)._get_flags() f['osapi_volume_extension'] = CONF.osapi_volume_extension[:] f['osapi_volume_extension'].append( - 'cinder.tests.api.extensions.foxinsocks.Foxinsocks') + 'cinder.tests.unit.api.extensions.foxinsocks.Foxinsocks') return f def test_get_foxnsocks(self): diff --git a/cinder/tests/integrated/test_login.py b/cinder/tests/unit/integrated/test_login.py similarity index 94% rename from cinder/tests/integrated/test_login.py rename to cinder/tests/unit/integrated/test_login.py index e0bad0957..2cb62f358 100644 --- a/cinder/tests/integrated/test_login.py +++ b/cinder/tests/unit/integrated/test_login.py @@ -15,7 +15,7 @@ from oslo_log import log as logging -from cinder.tests.integrated import integrated_helpers +from cinder.tests.unit.integrated import integrated_helpers LOG = logging.getLogger(__name__) diff --git a/cinder/tests/integrated/test_volumes.py b/cinder/tests/unit/integrated/test_volumes.py similarity index 96% rename from cinder/tests/integrated/test_volumes.py rename to cinder/tests/unit/integrated/test_volumes.py index abccca2a7..caee2a7d5 100644 --- a/cinder/tests/integrated/test_volumes.py +++ b/cinder/tests/unit/integrated/test_volumes.py @@ -19,9 +19,9 @@ from oslo_log import log as logging import testtools from cinder import service -from cinder.tests import fake_driver -from cinder.tests.integrated.api import client -from cinder.tests.integrated import integrated_helpers +from cinder.tests.unit import fake_driver +from cinder.tests.unit.integrated.api import client +from cinder.tests.unit.integrated import integrated_helpers LOG = logging.getLogger(__name__) @@ -40,7 +40,8 @@ class VolumesTest(integrated_helpers._IntegratedTestBase): def _get_flags(self): f = super(VolumesTest, self)._get_flags() - f['volume_driver'] = 'cinder.tests.fake_driver.LoggingVolumeDriver' + f['volume_driver'] = \ + 'cinder.tests.unit.fake_driver.LoggingVolumeDriver' return f def test_get_volumes_summary(self): diff --git a/cinder/tests/integrated/test_xml.py b/cinder/tests/unit/integrated/test_xml.py similarity index 96% rename from cinder/tests/integrated/test_xml.py rename to cinder/tests/unit/integrated/test_xml.py index 9307d7a16..e24957dc2 100644 --- a/cinder/tests/integrated/test_xml.py +++ b/cinder/tests/unit/integrated/test_xml.py @@ -17,7 +17,7 @@ from lxml import etree from oslo_log import log as logging from cinder.api import common -from cinder.tests.integrated import integrated_helpers +from cinder.tests.unit.integrated import integrated_helpers LOG = logging.getLogger(__name__) diff --git a/cinder/tests/keymgr/__init__.py b/cinder/tests/unit/keymgr/__init__.py similarity index 100% rename from cinder/tests/keymgr/__init__.py rename to cinder/tests/unit/keymgr/__init__.py diff --git a/cinder/tests/keymgr/fake.py b/cinder/tests/unit/keymgr/fake.py similarity index 93% rename from cinder/tests/keymgr/fake.py rename to cinder/tests/unit/keymgr/fake.py index c169e0a4e..7612ebafb 100644 --- a/cinder/tests/keymgr/fake.py +++ b/cinder/tests/unit/keymgr/fake.py @@ -17,7 +17,7 @@ """Implementation of a fake key manager.""" -from cinder.tests.keymgr import mock_key_mgr +from cinder.tests.unit.keymgr import mock_key_mgr def fake_api(): diff --git a/cinder/tests/keymgr/mock_key_mgr.py b/cinder/tests/unit/keymgr/mock_key_mgr.py similarity index 100% rename from cinder/tests/keymgr/mock_key_mgr.py rename to cinder/tests/unit/keymgr/mock_key_mgr.py diff --git a/cinder/tests/keymgr/test_barbican.py b/cinder/tests/unit/keymgr/test_barbican.py similarity index 99% rename from cinder/tests/keymgr/test_barbican.py rename to cinder/tests/unit/keymgr/test_barbican.py index f3382115e..d8a25c15b 100644 --- a/cinder/tests/keymgr/test_barbican.py +++ b/cinder/tests/unit/keymgr/test_barbican.py @@ -27,7 +27,7 @@ from oslo_config import cfg from cinder import exception from cinder.keymgr import barbican from cinder.keymgr import key as keymgr_key -from cinder.tests.keymgr import test_key_mgr +from cinder.tests.unit.keymgr import test_key_mgr CONF = cfg.CONF CONF.import_opt('encryption_auth_url', 'cinder.keymgr.key_mgr', group='keymgr') diff --git a/cinder/tests/keymgr/test_conf_key_mgr.py b/cinder/tests/unit/keymgr/test_conf_key_mgr.py similarity index 98% rename from cinder/tests/keymgr/test_conf_key_mgr.py rename to cinder/tests/unit/keymgr/test_conf_key_mgr.py index 314a48f40..756cc4c20 100644 --- a/cinder/tests/keymgr/test_conf_key_mgr.py +++ b/cinder/tests/unit/keymgr/test_conf_key_mgr.py @@ -25,7 +25,7 @@ from cinder import context from cinder import exception from cinder.keymgr import conf_key_mgr from cinder.keymgr import key -from cinder.tests.keymgr import test_key_mgr +from cinder.tests.unit.keymgr import test_key_mgr CONF = cfg.CONF diff --git a/cinder/tests/keymgr/test_key.py b/cinder/tests/unit/keymgr/test_key.py similarity index 100% rename from cinder/tests/keymgr/test_key.py rename to cinder/tests/unit/keymgr/test_key.py diff --git a/cinder/tests/keymgr/test_key_mgr.py b/cinder/tests/unit/keymgr/test_key_mgr.py similarity index 100% rename from cinder/tests/keymgr/test_key_mgr.py rename to cinder/tests/unit/keymgr/test_key_mgr.py diff --git a/cinder/tests/keymgr/test_mock_key_mgr.py b/cinder/tests/unit/keymgr/test_mock_key_mgr.py similarity index 97% rename from cinder/tests/keymgr/test_mock_key_mgr.py rename to cinder/tests/unit/keymgr/test_mock_key_mgr.py index d73b8ba2a..7f2cd9e66 100644 --- a/cinder/tests/keymgr/test_mock_key_mgr.py +++ b/cinder/tests/unit/keymgr/test_mock_key_mgr.py @@ -22,8 +22,8 @@ import array from cinder import context from cinder import exception from cinder.keymgr import key as keymgr_key -from cinder.tests.keymgr import mock_key_mgr -from cinder.tests.keymgr import test_key_mgr +from cinder.tests.unit.keymgr import mock_key_mgr +from cinder.tests.unit.keymgr import test_key_mgr class MockKeyManagerTestCase(test_key_mgr.KeyManagerTestCase): diff --git a/cinder/tests/keymgr/test_not_implemented_key_mgr.py b/cinder/tests/unit/keymgr/test_not_implemented_key_mgr.py similarity index 97% rename from cinder/tests/keymgr/test_not_implemented_key_mgr.py rename to cinder/tests/unit/keymgr/test_not_implemented_key_mgr.py index 184939647..6f2896b13 100644 --- a/cinder/tests/keymgr/test_not_implemented_key_mgr.py +++ b/cinder/tests/unit/keymgr/test_not_implemented_key_mgr.py @@ -18,7 +18,7 @@ Test cases for the not implemented key manager. """ from cinder.keymgr import not_implemented_key_mgr -from cinder.tests.keymgr import test_key_mgr +from cinder.tests.unit.keymgr import test_key_mgr class NotImplementedKeyManagerTestCase(test_key_mgr.KeyManagerTestCase): diff --git a/cinder/tests/monkey_patch_example/__init__.py b/cinder/tests/unit/monkey_patch_example/__init__.py similarity index 100% rename from cinder/tests/monkey_patch_example/__init__.py rename to cinder/tests/unit/monkey_patch_example/__init__.py diff --git a/cinder/tests/monkey_patch_example/example_a.py b/cinder/tests/unit/monkey_patch_example/example_a.py similarity index 100% rename from cinder/tests/monkey_patch_example/example_a.py rename to cinder/tests/unit/monkey_patch_example/example_a.py diff --git a/cinder/tests/monkey_patch_example/example_b.py b/cinder/tests/unit/monkey_patch_example/example_b.py similarity index 100% rename from cinder/tests/monkey_patch_example/example_b.py rename to cinder/tests/unit/monkey_patch_example/example_b.py diff --git a/cinder/tests/objects/__init__.py b/cinder/tests/unit/objects/__init__.py similarity index 100% rename from cinder/tests/objects/__init__.py rename to cinder/tests/unit/objects/__init__.py diff --git a/cinder/tests/objects/test_fields.py b/cinder/tests/unit/objects/test_fields.py similarity index 100% rename from cinder/tests/objects/test_fields.py rename to cinder/tests/unit/objects/test_fields.py diff --git a/cinder/tests/objects/test_objects.py b/cinder/tests/unit/objects/test_objects.py similarity index 99% rename from cinder/tests/objects/test_objects.py rename to cinder/tests/unit/objects/test_objects.py index 6fe798886..74f8d7977 100644 --- a/cinder/tests/objects/test_objects.py +++ b/cinder/tests/unit/objects/test_objects.py @@ -28,7 +28,7 @@ from cinder import objects from cinder.objects import base from cinder.objects import fields from cinder import test -from cinder.tests import fake_notifier +from cinder.tests.unit import fake_notifier class MyOwnedObject(base.CinderPersistentObject, base.CinderObject): diff --git a/cinder/tests/objects/test_snapshot.py b/cinder/tests/unit/objects/test_snapshot.py similarity index 98% rename from cinder/tests/objects/test_snapshot.py rename to cinder/tests/unit/objects/test_snapshot.py index 21ffda00a..48068a890 100644 --- a/cinder/tests/objects/test_snapshot.py +++ b/cinder/tests/unit/objects/test_snapshot.py @@ -16,8 +16,8 @@ import mock from cinder.objects import snapshot as snapshot_obj from cinder.objects import volume as volume_obj -from cinder.tests import fake_volume -from cinder.tests.objects import test_objects +from cinder.tests.unit import fake_volume +from cinder.tests.unit.objects import test_objects fake_snapshot = { 'id': '1', diff --git a/cinder/tests/objects/test_volume.py b/cinder/tests/unit/objects/test_volume.py similarity index 97% rename from cinder/tests/objects/test_volume.py rename to cinder/tests/unit/objects/test_volume.py index 901855a40..d6f407a70 100644 --- a/cinder/tests/objects/test_volume.py +++ b/cinder/tests/unit/objects/test_volume.py @@ -15,8 +15,8 @@ import mock from cinder import objects -from cinder.tests import fake_volume -from cinder.tests.objects import test_objects +from cinder.tests.unit import fake_volume +from cinder.tests.unit.objects import test_objects class TestVolume(test_objects._LocalTest): diff --git a/cinder/tests/policy.json b/cinder/tests/unit/policy.json similarity index 100% rename from cinder/tests/policy.json rename to cinder/tests/unit/policy.json diff --git a/cinder/tests/runtime_conf.py b/cinder/tests/unit/runtime_conf.py similarity index 100% rename from cinder/tests/runtime_conf.py rename to cinder/tests/unit/runtime_conf.py diff --git a/cinder/tests/scheduler/__init__.py b/cinder/tests/unit/scheduler/__init__.py similarity index 100% rename from cinder/tests/scheduler/__init__.py rename to cinder/tests/unit/scheduler/__init__.py diff --git a/cinder/tests/scheduler/fakes.py b/cinder/tests/unit/scheduler/fakes.py similarity index 100% rename from cinder/tests/scheduler/fakes.py rename to cinder/tests/unit/scheduler/fakes.py diff --git a/cinder/tests/scheduler/test_allocated_capacity_weigher.py b/cinder/tests/unit/scheduler/test_allocated_capacity_weigher.py similarity index 98% rename from cinder/tests/scheduler/test_allocated_capacity_weigher.py rename to cinder/tests/unit/scheduler/test_allocated_capacity_weigher.py index fc5cc87c2..ded0cd714 100644 --- a/cinder/tests/scheduler/test_allocated_capacity_weigher.py +++ b/cinder/tests/unit/scheduler/test_allocated_capacity_weigher.py @@ -24,7 +24,7 @@ from cinder import context from cinder.openstack.common.scheduler import weights from cinder.scheduler.weights import capacity from cinder import test -from cinder.tests.scheduler import fakes +from cinder.tests.unit.scheduler import fakes from cinder.volume import utils CONF = cfg.CONF diff --git a/cinder/tests/scheduler/test_capacity_weigher.py b/cinder/tests/unit/scheduler/test_capacity_weigher.py similarity index 99% rename from cinder/tests/scheduler/test_capacity_weigher.py rename to cinder/tests/unit/scheduler/test_capacity_weigher.py index 6e831d0c8..25d8909e5 100644 --- a/cinder/tests/scheduler/test_capacity_weigher.py +++ b/cinder/tests/unit/scheduler/test_capacity_weigher.py @@ -23,7 +23,7 @@ from cinder import context from cinder.openstack.common.scheduler import weights from cinder.scheduler.weights import capacity from cinder import test -from cinder.tests.scheduler import fakes +from cinder.tests.unit.scheduler import fakes from cinder.volume import utils CONF = cfg.CONF diff --git a/cinder/tests/scheduler/test_chance_weigher.py b/cinder/tests/unit/scheduler/test_chance_weigher.py similarity index 100% rename from cinder/tests/scheduler/test_chance_weigher.py rename to cinder/tests/unit/scheduler/test_chance_weigher.py diff --git a/cinder/tests/scheduler/test_filter_scheduler.py b/cinder/tests/unit/scheduler/test_filter_scheduler.py similarity index 99% rename from cinder/tests/scheduler/test_filter_scheduler.py rename to cinder/tests/unit/scheduler/test_filter_scheduler.py index cb72faa35..d047e8f46 100644 --- a/cinder/tests/scheduler/test_filter_scheduler.py +++ b/cinder/tests/unit/scheduler/test_filter_scheduler.py @@ -22,8 +22,8 @@ from cinder import context from cinder import exception from cinder.scheduler import filter_scheduler from cinder.scheduler import host_manager -from cinder.tests.scheduler import fakes -from cinder.tests.scheduler import test_scheduler +from cinder.tests.unit.scheduler import fakes +from cinder.tests.unit.scheduler import test_scheduler from cinder.volume import utils diff --git a/cinder/tests/scheduler/test_goodness_weigher.py b/cinder/tests/unit/scheduler/test_goodness_weigher.py similarity index 99% rename from cinder/tests/scheduler/test_goodness_weigher.py rename to cinder/tests/unit/scheduler/test_goodness_weigher.py index 29cfa7fcd..c042d1f71 100644 --- a/cinder/tests/scheduler/test_goodness_weigher.py +++ b/cinder/tests/unit/scheduler/test_goodness_weigher.py @@ -17,7 +17,7 @@ Tests For Goodness Weigher. from cinder.scheduler.weights import goodness from cinder import test -from cinder.tests.scheduler import fakes +from cinder.tests.unit.scheduler import fakes class GoodnessWeigherTestCase(test.TestCase): diff --git a/cinder/tests/scheduler/test_host_filters.py b/cinder/tests/unit/scheduler/test_host_filters.py similarity index 99% rename from cinder/tests/scheduler/test_host_filters.py rename to cinder/tests/unit/scheduler/test_host_filters.py index b5b82c190..592f2be56 100644 --- a/cinder/tests/scheduler/test_host_filters.py +++ b/cinder/tests/unit/scheduler/test_host_filters.py @@ -25,8 +25,8 @@ from cinder import db from cinder import exception from cinder.openstack.common.scheduler import filters from cinder import test -from cinder.tests.scheduler import fakes -from cinder.tests import utils +from cinder.tests.unit.scheduler import fakes +from cinder.tests.unit import utils class HostFiltersTestCase(test.TestCase): diff --git a/cinder/tests/scheduler/test_host_manager.py b/cinder/tests/unit/scheduler/test_host_manager.py similarity index 100% rename from cinder/tests/scheduler/test_host_manager.py rename to cinder/tests/unit/scheduler/test_host_manager.py diff --git a/cinder/tests/scheduler/test_rpcapi.py b/cinder/tests/unit/scheduler/test_rpcapi.py similarity index 100% rename from cinder/tests/scheduler/test_rpcapi.py rename to cinder/tests/unit/scheduler/test_rpcapi.py diff --git a/cinder/tests/scheduler/test_scheduler.py b/cinder/tests/unit/scheduler/test_scheduler.py similarity index 100% rename from cinder/tests/scheduler/test_scheduler.py rename to cinder/tests/unit/scheduler/test_scheduler.py diff --git a/cinder/tests/scheduler/test_scheduler_options.py b/cinder/tests/unit/scheduler/test_scheduler_options.py similarity index 100% rename from cinder/tests/scheduler/test_scheduler_options.py rename to cinder/tests/unit/scheduler/test_scheduler_options.py diff --git a/cinder/tests/scheduler/test_volume_number_weigher.py b/cinder/tests/unit/scheduler/test_volume_number_weigher.py similarity index 98% rename from cinder/tests/scheduler/test_volume_number_weigher.py rename to cinder/tests/unit/scheduler/test_volume_number_weigher.py index 7588bb631..3cccffe54 100644 --- a/cinder/tests/scheduler/test_volume_number_weigher.py +++ b/cinder/tests/unit/scheduler/test_volume_number_weigher.py @@ -24,7 +24,7 @@ from cinder.db.sqlalchemy import api from cinder.openstack.common.scheduler import weights from cinder.scheduler.weights import volume_number from cinder import test -from cinder.tests.scheduler import fakes +from cinder.tests.unit.scheduler import fakes from cinder.volume import utils CONF = cfg.CONF diff --git a/cinder/tests/targets/__init__.py b/cinder/tests/unit/targets/__init__.py similarity index 100% rename from cinder/tests/targets/__init__.py rename to cinder/tests/unit/targets/__init__.py diff --git a/cinder/tests/targets/test_base_iscsi_driver.py b/cinder/tests/unit/targets/test_base_iscsi_driver.py similarity index 100% rename from cinder/tests/targets/test_base_iscsi_driver.py rename to cinder/tests/unit/targets/test_base_iscsi_driver.py diff --git a/cinder/tests/targets/test_cxt_driver.py b/cinder/tests/unit/targets/test_cxt_driver.py similarity index 100% rename from cinder/tests/targets/test_cxt_driver.py rename to cinder/tests/unit/targets/test_cxt_driver.py diff --git a/cinder/tests/targets/test_iet_driver.py b/cinder/tests/unit/targets/test_iet_driver.py similarity index 100% rename from cinder/tests/targets/test_iet_driver.py rename to cinder/tests/unit/targets/test_iet_driver.py diff --git a/cinder/tests/targets/test_iser_driver.py b/cinder/tests/unit/targets/test_iser_driver.py similarity index 96% rename from cinder/tests/targets/test_iser_driver.py rename to cinder/tests/unit/targets/test_iser_driver.py index bfdb5a92b..291f0c0fc 100644 --- a/cinder/tests/targets/test_iser_driver.py +++ b/cinder/tests/unit/targets/test_iser_driver.py @@ -12,8 +12,8 @@ import mock -from cinder.tests.targets import test_lio_driver as test_lio -from cinder.tests.targets import test_tgt_driver as test_tgt +from cinder.tests.unit.targets import test_lio_driver as test_lio +from cinder.tests.unit.targets import test_tgt_driver as test_tgt from cinder import utils from cinder.volume.targets import iser from cinder.volume.targets import lio diff --git a/cinder/tests/targets/test_lio_driver.py b/cinder/tests/unit/targets/test_lio_driver.py similarity index 100% rename from cinder/tests/targets/test_lio_driver.py rename to cinder/tests/unit/targets/test_lio_driver.py diff --git a/cinder/tests/targets/test_scst_driver.py b/cinder/tests/unit/targets/test_scst_driver.py similarity index 100% rename from cinder/tests/targets/test_scst_driver.py rename to cinder/tests/unit/targets/test_scst_driver.py diff --git a/cinder/tests/targets/test_tgt_driver.py b/cinder/tests/unit/targets/test_tgt_driver.py similarity index 100% rename from cinder/tests/targets/test_tgt_driver.py rename to cinder/tests/unit/targets/test_tgt_driver.py diff --git a/cinder/tests/test_api.py b/cinder/tests/unit/test_api.py similarity index 100% rename from cinder/tests/test_api.py rename to cinder/tests/unit/test_api.py diff --git a/cinder/tests/test_api_urlmap.py b/cinder/tests/unit/test_api_urlmap.py similarity index 100% rename from cinder/tests/test_api_urlmap.py rename to cinder/tests/unit/test_api_urlmap.py diff --git a/cinder/tests/test_backup.py b/cinder/tests/unit/test_backup.py similarity index 98% rename from cinder/tests/test_backup.py rename to cinder/tests/unit/test_backup.py index 48bd24e42..66bccac21 100644 --- a/cinder/tests/test_backup.py +++ b/cinder/tests/unit/test_backup.py @@ -30,7 +30,7 @@ from cinder import context from cinder import db from cinder import exception from cinder import test -from cinder.tests.backup import fake_service_with_verify as fake_service +from cinder.tests.unit.backup import fake_service_with_verify as fake_service CONF = cfg.CONF @@ -297,7 +297,7 @@ class BackupTestCase(BaseBackupTest): backup_id = self._create_backup_db_entry(status='restoring', volume_id=vol_id) - service = 'cinder.tests.backup.bad_service' + service = 'cinder.tests.unit.backup.bad_service' db.backup_update(self.ctxt, backup_id, {'service': service}) self.assertRaises(exception.InvalidBackup, self.backup_mgr.restore_backup, @@ -372,7 +372,7 @@ class BackupTestCase(BaseBackupTest): vol_id = self._create_volume_db_entry(size=1) backup_id = self._create_backup_db_entry(status='deleting', volume_id=vol_id) - service = 'cinder.tests.backup.bad_service' + service = 'cinder.tests.unit.backup.bad_service' db.backup_update(self.ctxt, backup_id, {'service': service}) self.assertRaises(exception.InvalidBackup, self.backup_mgr.delete_backup, @@ -480,7 +480,7 @@ class BackupTestCase(BaseBackupTest): vol_id = self._create_volume_db_entry(size=1) backup_id = self._create_backup_db_entry(status='available', volume_id=vol_id) - service = 'cinder.tests.backup.bad_service' + service = 'cinder.tests.unit.backup.bad_service' db.backup_update(self.ctxt, backup_id, {'service': service}) self.assertRaises(exception.InvalidBackup, self.backup_mgr.export_record, @@ -536,7 +536,7 @@ class BackupTestCase(BaseBackupTest): record with a different service to that used to create the backup. """ export = self._create_exported_record_entry() - export['backup_service'] = 'cinder.tests.backup.bad_service' + export['backup_service'] = 'cinder.tests.unit.backup.bad_service' imported_record = self._create_export_record_db_entry() # Test the case where the additional hosts list is empty @@ -591,8 +591,9 @@ class BackupTestCaseWithVerify(BaseBackupTest): """Test Case for backups.""" def setUp(self): - self.override_config("backup_driver", - "cinder.tests.backup.fake_service_with_verify") + self.override_config( + "backup_driver", + "cinder.tests.unit.backup.fake_service_with_verify") super(BackupTestCaseWithVerify, self).setUp() def test_import_record_with_verify(self): diff --git a/cinder/tests/test_backup_ceph.py b/cinder/tests/unit/test_backup_ceph.py similarity index 100% rename from cinder/tests/test_backup_ceph.py rename to cinder/tests/unit/test_backup_ceph.py diff --git a/cinder/tests/test_backup_driver_base.py b/cinder/tests/unit/test_backup_driver_base.py similarity index 99% rename from cinder/tests/test_backup_driver_base.py rename to cinder/tests/unit/test_backup_driver_base.py index ce23c32a7..7e96a85e6 100644 --- a/cinder/tests/test_backup_driver_base.py +++ b/cinder/tests/unit/test_backup_driver_base.py @@ -24,7 +24,7 @@ from cinder import context from cinder import db from cinder import exception from cinder import test -from cinder.tests.backup import fake_service +from cinder.tests.unit.backup import fake_service _backup_db_fields = ['id', 'user_id', 'project_id', 'volume_id', 'host', 'availability_zone', diff --git a/cinder/tests/test_backup_swift.py b/cinder/tests/unit/test_backup_swift.py similarity index 99% rename from cinder/tests/test_backup_swift.py rename to cinder/tests/unit/test_backup_swift.py index ea402266a..70a72afa9 100644 --- a/cinder/tests/test_backup_swift.py +++ b/cinder/tests/unit/test_backup_swift.py @@ -36,8 +36,8 @@ from cinder import db from cinder import exception from cinder.i18n import _ from cinder import test -from cinder.tests.backup import fake_swift_client -from cinder.tests.backup import fake_swift_client2 +from cinder.tests.unit.backup import fake_swift_client +from cinder.tests.unit.backup import fake_swift_client2 LOG = logging.getLogger(__name__) diff --git a/cinder/tests/test_backup_tsm.py b/cinder/tests/unit/test_backup_tsm.py similarity index 100% rename from cinder/tests/test_backup_tsm.py rename to cinder/tests/unit/test_backup_tsm.py diff --git a/cinder/tests/test_block_device.py b/cinder/tests/unit/test_block_device.py similarity index 100% rename from cinder/tests/test_block_device.py rename to cinder/tests/unit/test_block_device.py diff --git a/cinder/tests/test_cloudbyte.py b/cinder/tests/unit/test_cloudbyte.py similarity index 100% rename from cinder/tests/test_cloudbyte.py rename to cinder/tests/unit/test_cloudbyte.py diff --git a/cinder/tests/test_cmd.py b/cinder/tests/unit/test_cmd.py similarity index 100% rename from cinder/tests/test_cmd.py rename to cinder/tests/unit/test_cmd.py diff --git a/cinder/tests/test_conf.py b/cinder/tests/unit/test_conf.py similarity index 93% rename from cinder/tests/test_conf.py rename to cinder/tests/unit/test_conf.py index 1dd285ad6..c81b2f49c 100644 --- a/cinder/tests/test_conf.py +++ b/cinder/tests/unit/test_conf.py @@ -35,19 +35,19 @@ class ConfigTestCase(test.TestCase): def test_declare(self): self.assertNotIn('answer', CONF) - CONF.import_opt('answer', 'cinder.tests.declare_conf') + CONF.import_opt('answer', 'cinder.tests.unit.declare_conf') self.assertIn('answer', CONF) self.assertEqual(CONF.answer, 42) # Make sure we don't overwrite anything CONF.set_override('answer', 256) self.assertEqual(CONF.answer, 256) - CONF.import_opt('answer', 'cinder.tests.declare_conf') + CONF.import_opt('answer', 'cinder.tests.unit.declare_conf') self.assertEqual(CONF.answer, 256) def test_runtime_and_unknown_conf(self): self.assertNotIn('runtime_answer', CONF) - import cinder.tests.runtime_conf # noqa + import cinder.tests.unit.runtime_conf # noqa self.assertIn('runtime_answer', CONF) self.assertEqual(CONF.runtime_answer, 54) diff --git a/cinder/tests/test_context.py b/cinder/tests/unit/test_context.py similarity index 100% rename from cinder/tests/test_context.py rename to cinder/tests/unit/test_context.py diff --git a/cinder/tests/test_create_volume_flow.py b/cinder/tests/unit/test_create_volume_flow.py similarity index 98% rename from cinder/tests/test_create_volume_flow.py rename to cinder/tests/unit/test_create_volume_flow.py index b863191e9..2847be312 100644 --- a/cinder/tests/test_create_volume_flow.py +++ b/cinder/tests/unit/test_create_volume_flow.py @@ -21,8 +21,8 @@ import mock from cinder import context from cinder import exception from cinder import test -from cinder.tests import fake_snapshot -from cinder.tests import fake_volume +from cinder.tests.unit import fake_snapshot +from cinder.tests.unit import fake_volume from cinder.volume.flows.api import create_volume from cinder.volume.flows.manager import create_volume as create_volume_manager diff --git a/cinder/tests/test_db_api.py b/cinder/tests/unit/test_db_api.py similarity index 100% rename from cinder/tests/test_db_api.py rename to cinder/tests/unit/test_db_api.py diff --git a/cinder/tests/test_dellfc.py b/cinder/tests/unit/test_dellfc.py similarity index 100% rename from cinder/tests/test_dellfc.py rename to cinder/tests/unit/test_dellfc.py diff --git a/cinder/tests/test_dellsc.py b/cinder/tests/unit/test_dellsc.py similarity index 100% rename from cinder/tests/test_dellsc.py rename to cinder/tests/unit/test_dellsc.py diff --git a/cinder/tests/test_dellscapi.py b/cinder/tests/unit/test_dellscapi.py similarity index 100% rename from cinder/tests/test_dellscapi.py rename to cinder/tests/unit/test_dellscapi.py diff --git a/cinder/tests/test_emc_vmax.py b/cinder/tests/unit/test_emc_vmax.py similarity index 100% rename from cinder/tests/test_emc_vmax.py rename to cinder/tests/unit/test_emc_vmax.py diff --git a/cinder/tests/test_emc_vnxdirect.py b/cinder/tests/unit/test_emc_vnxdirect.py similarity index 99% rename from cinder/tests/test_emc_vnxdirect.py rename to cinder/tests/unit/test_emc_vnxdirect.py index efc64d759..ab4a71879 100644 --- a/cinder/tests/test_emc_vnxdirect.py +++ b/cinder/tests/unit/test_emc_vnxdirect.py @@ -20,7 +20,7 @@ from oslo_concurrency import processutils from cinder import exception from cinder import test -from cinder.tests import utils +from cinder.tests.unit import utils from cinder.volume import configuration as conf from cinder.volume.drivers.emc import emc_cli_fc from cinder.volume.drivers.emc import emc_cli_iscsi diff --git a/cinder/tests/test_emc_xtremio.py b/cinder/tests/unit/test_emc_xtremio.py similarity index 100% rename from cinder/tests/test_emc_xtremio.py rename to cinder/tests/unit/test_emc_xtremio.py diff --git a/cinder/tests/test_eqlx.py b/cinder/tests/unit/test_eqlx.py similarity index 100% rename from cinder/tests/test_eqlx.py rename to cinder/tests/unit/test_eqlx.py diff --git a/cinder/tests/test_evaluator.py b/cinder/tests/unit/test_evaluator.py similarity index 100% rename from cinder/tests/test_evaluator.py rename to cinder/tests/unit/test_evaluator.py diff --git a/cinder/tests/test_exception.py b/cinder/tests/unit/test_exception.py similarity index 100% rename from cinder/tests/test_exception.py rename to cinder/tests/unit/test_exception.py diff --git a/cinder/tests/test_glusterfs.py b/cinder/tests/unit/test_glusterfs.py similarity index 100% rename from cinder/tests/test_glusterfs.py rename to cinder/tests/unit/test_glusterfs.py diff --git a/cinder/tests/test_gpfs.py b/cinder/tests/unit/test_gpfs.py similarity index 100% rename from cinder/tests/test_gpfs.py rename to cinder/tests/unit/test_gpfs.py diff --git a/cinder/tests/test_hacking.py b/cinder/tests/unit/test_hacking.py similarity index 93% rename from cinder/tests/test_hacking.py rename to cinder/tests/unit/test_hacking.py index c41455a23..400506d6b 100644 --- a/cinder/tests/test_hacking.py +++ b/cinder/tests/unit/test_hacking.py @@ -84,35 +84,35 @@ class HackingTestCase(test.TestCase): def test_check_explicit_underscore_import(self): self.assertEqual(1, len(list(checks.check_explicit_underscore_import( "LOG.info(_('My info message'))", - "cinder/tests/other_files.py")))) + "cinder.tests.unit/other_files.py")))) self.assertEqual(1, len(list(checks.check_explicit_underscore_import( "msg = _('My message')", - "cinder/tests/other_files.py")))) + "cinder.tests.unit/other_files.py")))) self.assertEqual(0, len(list(checks.check_explicit_underscore_import( "from cinder.i18n import _", - "cinder/tests/other_files.py")))) + "cinder.tests.unit/other_files.py")))) self.assertEqual(0, len(list(checks.check_explicit_underscore_import( "LOG.info(_('My info message'))", - "cinder/tests/other_files.py")))) + "cinder.tests.unit/other_files.py")))) self.assertEqual(0, len(list(checks.check_explicit_underscore_import( "msg = _('My message')", - "cinder/tests/other_files.py")))) + "cinder.tests.unit/other_files.py")))) self.assertEqual(0, len(list(checks.check_explicit_underscore_import( "from cinder.i18n import _, _LW", - "cinder/tests/other_files2.py")))) + "cinder.tests.unit/other_files2.py")))) self.assertEqual(0, len(list(checks.check_explicit_underscore_import( "msg = _('My message')", - "cinder/tests/other_files2.py")))) + "cinder.tests.unit/other_files2.py")))) self.assertEqual(0, len(list(checks.check_explicit_underscore_import( "_ = translations.ugettext", - "cinder/tests/other_files3.py")))) + "cinder.tests.unit/other_files3.py")))) self.assertEqual(0, len(list(checks.check_explicit_underscore_import( "msg = _('My message')", - "cinder/tests/other_files3.py")))) + "cinder.tests.unit/other_files3.py")))) # Complete code coverage by falling through all checks self.assertEqual(0, len(list(checks.check_explicit_underscore_import( "LOG.info('My info message')", - "cinder/tests/other_files4.py")))) + "cinder.tests.unit/other_files4.py")))) def test_check_no_log_audit(self): self.assertEqual(1, len(list(checks.check_no_log_audit( @@ -130,13 +130,13 @@ class HackingTestCase(test.TestCase): def test_check_assert_called_once(self): self.assertEqual(0, len(list(checks.check_assert_called_once( - ".assert_called_with(", "cinder/tests/test1.py")))) + ".assert_called_with(", "cinder.tests.unit/test1.py")))) self.assertEqual(0, len(list(checks.check_assert_called_once( ".assert_called_with(", "cinder/blah.py")))) self.assertEqual(1, len(list(checks.check_assert_called_once( - ".assert_called_once(", "cinder/tests/test1.py")))) + ".assert_called_once(", "cinder.tests.unit/test1.py")))) self.assertEqual(0, len(list(checks.check_assert_called_once( - ".assertEqual(", "cinder/tests/test1.py")))) + ".assertEqual(", "cinder.tests.unit/test1.py")))) def test_oslo_namespace_imports_check(self): self.assertEqual(1, len(list(checks.check_oslo_namespace_imports( @@ -222,7 +222,7 @@ class HackingTestCase(test.TestCase): "cinder/cmd/file.py", False)))) self.assertEqual(0, len(list(checks.check_no_print_statements( "print('My print statement that I just must have.')", - "cinder/tests/file.py", True)))) + "cinder.tests.unit/file.py", True)))) self.assertEqual(1, len(list(checks.check_no_print_statements( "print ('My print with space')", "cinder/volume/anotherFile.py", False)))) diff --git a/cinder/tests/test_hds.py b/cinder/tests/unit/test_hds.py similarity index 100% rename from cinder/tests/test_hds.py rename to cinder/tests/unit/test_hds.py diff --git a/cinder/tests/test_hds_hnas_backend.py b/cinder/tests/unit/test_hds_hnas_backend.py similarity index 100% rename from cinder/tests/test_hds_hnas_backend.py rename to cinder/tests/unit/test_hds_hnas_backend.py diff --git a/cinder/tests/test_hds_iscsi.py b/cinder/tests/unit/test_hds_iscsi.py similarity index 100% rename from cinder/tests/test_hds_iscsi.py rename to cinder/tests/unit/test_hds_iscsi.py diff --git a/cinder/tests/test_hds_nfs.py b/cinder/tests/unit/test_hds_nfs.py similarity index 100% rename from cinder/tests/test_hds_nfs.py rename to cinder/tests/unit/test_hds_nfs.py diff --git a/cinder/tests/test_hitachi_hbsd_horcm_fc.py b/cinder/tests/unit/test_hitachi_hbsd_horcm_fc.py similarity index 100% rename from cinder/tests/test_hitachi_hbsd_horcm_fc.py rename to cinder/tests/unit/test_hitachi_hbsd_horcm_fc.py diff --git a/cinder/tests/test_hitachi_hbsd_snm2_fc.py b/cinder/tests/unit/test_hitachi_hbsd_snm2_fc.py similarity index 100% rename from cinder/tests/test_hitachi_hbsd_snm2_fc.py rename to cinder/tests/unit/test_hitachi_hbsd_snm2_fc.py diff --git a/cinder/tests/test_hitachi_hbsd_snm2_iscsi.py b/cinder/tests/unit/test_hitachi_hbsd_snm2_iscsi.py similarity index 100% rename from cinder/tests/test_hitachi_hbsd_snm2_iscsi.py rename to cinder/tests/unit/test_hitachi_hbsd_snm2_iscsi.py diff --git a/cinder/tests/test_hp3par.py b/cinder/tests/unit/test_hp3par.py similarity index 99% rename from cinder/tests/test_hp3par.py rename to cinder/tests/unit/test_hp3par.py index cc3fb0097..1d331c584 100644 --- a/cinder/tests/test_hp3par.py +++ b/cinder/tests/unit/test_hp3par.py @@ -26,7 +26,7 @@ from oslo_utils import units from cinder import context from cinder import exception from cinder import test -from cinder.tests import fake_hp_3par_client as hp3parclient +from cinder.tests.unit import fake_hp_3par_client as hp3parclient from cinder.volume.drivers.san.hp import hp_3par_common as hpcommon from cinder.volume.drivers.san.hp import hp_3par_fc as hpfcdriver from cinder.volume.drivers.san.hp import hp_3par_iscsi as hpdriver diff --git a/cinder/tests/test_hplefthand.py b/cinder/tests/unit/test_hplefthand.py similarity index 99% rename from cinder/tests/test_hplefthand.py rename to cinder/tests/unit/test_hplefthand.py index 1888be72c..f5ca8ca10 100644 --- a/cinder/tests/test_hplefthand.py +++ b/cinder/tests/unit/test_hplefthand.py @@ -23,7 +23,7 @@ import six from cinder import context from cinder import exception from cinder import test -from cinder.tests import fake_hp_lefthand_client as hplefthandclient +from cinder.tests.unit import fake_hp_lefthand_client as hplefthandclient from cinder.volume.drivers.san.hp import hp_lefthand_iscsi from cinder.volume.drivers.san.hp import hp_lefthand_rest_proxy from cinder.volume import volume_types diff --git a/cinder/tests/test_huawei_18000.py b/cinder/tests/unit/test_huawei_18000.py similarity index 100% rename from cinder/tests/test_huawei_18000.py rename to cinder/tests/unit/test_huawei_18000.py diff --git a/cinder/tests/test_huawei_drivers_compatibility.py b/cinder/tests/unit/test_huawei_drivers_compatibility.py similarity index 100% rename from cinder/tests/test_huawei_drivers_compatibility.py rename to cinder/tests/unit/test_huawei_drivers_compatibility.py diff --git a/cinder/tests/test_ibm_flashsystem.py b/cinder/tests/unit/test_ibm_flashsystem.py similarity index 100% rename from cinder/tests/test_ibm_flashsystem.py rename to cinder/tests/unit/test_ibm_flashsystem.py diff --git a/cinder/tests/test_ibm_xiv_ds8k.py b/cinder/tests/unit/test_ibm_xiv_ds8k.py similarity index 99% rename from cinder/tests/test_ibm_xiv_ds8k.py rename to cinder/tests/unit/test_ibm_xiv_ds8k.py index 88db060ae..b169505fb 100644 --- a/cinder/tests/test_ibm_xiv_ds8k.py +++ b/cinder/tests/unit/test_ibm_xiv_ds8k.py @@ -271,7 +271,7 @@ class XIVDS8KVolumeDriverTest(test.TestCase): configuration = mox.MockObject(conf.Configuration) configuration.san_is_local = False configuration.xiv_ds8k_proxy = \ - 'cinder.tests.test_ibm_xiv_ds8k.XIVDS8KFakeProxyDriver' + 'cinder.tests.unit.test_ibm_xiv_ds8k.XIVDS8KFakeProxyDriver' configuration.xiv_ds8k_connection_type = 'iscsi' configuration.xiv_chap = 'disabled' configuration.san_ip = FAKE diff --git a/cinder/tests/test_ibmnas.py b/cinder/tests/unit/test_ibmnas.py similarity index 100% rename from cinder/tests/test_ibmnas.py rename to cinder/tests/unit/test_ibmnas.py diff --git a/cinder/tests/test_image_utils.py b/cinder/tests/unit/test_image_utils.py similarity index 100% rename from cinder/tests/test_image_utils.py rename to cinder/tests/unit/test_image_utils.py diff --git a/cinder/tests/test_migrations.py b/cinder/tests/unit/test_migrations.py similarity index 100% rename from cinder/tests/test_migrations.py rename to cinder/tests/unit/test_migrations.py diff --git a/cinder/tests/test_misc.py b/cinder/tests/unit/test_misc.py similarity index 100% rename from cinder/tests/test_misc.py rename to cinder/tests/unit/test_misc.py diff --git a/cinder/tests/test_netapp.py b/cinder/tests/unit/test_netapp.py similarity index 100% rename from cinder/tests/test_netapp.py rename to cinder/tests/unit/test_netapp.py diff --git a/cinder/tests/test_netapp_eseries_iscsi.py b/cinder/tests/unit/test_netapp_eseries_iscsi.py similarity index 100% rename from cinder/tests/test_netapp_eseries_iscsi.py rename to cinder/tests/unit/test_netapp_eseries_iscsi.py diff --git a/cinder/tests/test_netapp_nfs.py b/cinder/tests/unit/test_netapp_nfs.py similarity index 100% rename from cinder/tests/test_netapp_nfs.py rename to cinder/tests/unit/test_netapp_nfs.py diff --git a/cinder/tests/test_netapp_ssc.py b/cinder/tests/unit/test_netapp_ssc.py similarity index 100% rename from cinder/tests/test_netapp_ssc.py rename to cinder/tests/unit/test_netapp_ssc.py diff --git a/cinder/tests/test_nfs.py b/cinder/tests/unit/test_nfs.py similarity index 100% rename from cinder/tests/test_nfs.py rename to cinder/tests/unit/test_nfs.py diff --git a/cinder/tests/test_nimble.py b/cinder/tests/unit/test_nimble.py similarity index 100% rename from cinder/tests/test_nimble.py rename to cinder/tests/unit/test_nimble.py diff --git a/cinder/tests/test_openvstorage.py b/cinder/tests/unit/test_openvstorage.py similarity index 100% rename from cinder/tests/test_openvstorage.py rename to cinder/tests/unit/test_openvstorage.py diff --git a/cinder/tests/test_prophetstor_dpl.py b/cinder/tests/unit/test_prophetstor_dpl.py similarity index 100% rename from cinder/tests/test_prophetstor_dpl.py rename to cinder/tests/unit/test_prophetstor_dpl.py diff --git a/cinder/tests/test_pure.py b/cinder/tests/unit/test_pure.py similarity index 100% rename from cinder/tests/test_pure.py rename to cinder/tests/unit/test_pure.py diff --git a/cinder/tests/test_qos_specs.py b/cinder/tests/unit/test_qos_specs.py similarity index 100% rename from cinder/tests/test_qos_specs.py rename to cinder/tests/unit/test_qos_specs.py diff --git a/cinder/tests/test_quobyte.py b/cinder/tests/unit/test_quobyte.py similarity index 100% rename from cinder/tests/test_quobyte.py rename to cinder/tests/unit/test_quobyte.py diff --git a/cinder/tests/test_quota.py b/cinder/tests/unit/test_quota.py similarity index 99% rename from cinder/tests/test_quota.py rename to cinder/tests/unit/test_quota.py index b326ff0e2..90c098135 100644 --- a/cinder/tests/test_quota.py +++ b/cinder/tests/unit/test_quota.py @@ -30,7 +30,7 @@ from cinder.db.sqlalchemy import models as sqa_models from cinder import exception from cinder import quota from cinder import test -import cinder.tests.image.fake +import cinder.tests.unit.image.fake from cinder import volume @@ -64,7 +64,7 @@ class QuotaIntegrationTestCase(test.TestCase): # conflicts with the test cases here that are setting up their own # defaults. db.quota_class_destroy_all_by_name(self.context, 'default') - self.addCleanup(cinder.tests.image.fake.FakeImageService_reset) + self.addCleanup(cinder.tests.unit.image.fake.FakeImageService_reset) def _create_volume(self, size=1): """Create a test volume.""" @@ -463,7 +463,7 @@ class QuotaEngineTestCase(test.TestCase): def test_init_override_string(self): quota_obj = quota.QuotaEngine( - quota_driver_class='cinder.tests.test_quota.FakeDriver') + quota_driver_class='cinder.tests.unit.test_quota.FakeDriver') self.assertEqual(quota_obj.resources, {}) self.assertIsInstance(quota_obj._driver, FakeDriver) diff --git a/cinder/tests/test_rbd.py b/cinder/tests/unit/test_rbd.py similarity index 99% rename from cinder/tests/test_rbd.py rename to cinder/tests/unit/test_rbd.py index 2cf0138c9..6c52cd4c7 100644 --- a/cinder/tests/test_rbd.py +++ b/cinder/tests/unit/test_rbd.py @@ -30,8 +30,8 @@ from cinder import exception from cinder.i18n import _ from cinder.image import image_utils from cinder import test -from cinder.tests.image import fake as fake_image -from cinder.tests import test_volume +from cinder.tests.unit.image import fake as fake_image +from cinder.tests.unit import test_volume from cinder.volume import configuration as conf import cinder.volume.drivers.rbd as driver from cinder.volume.flows.manager import create_volume diff --git a/cinder/tests/test_remotefs.py b/cinder/tests/unit/test_remotefs.py similarity index 100% rename from cinder/tests/test_remotefs.py rename to cinder/tests/unit/test_remotefs.py diff --git a/cinder/tests/test_replication.py b/cinder/tests/unit/test_replication.py similarity index 99% rename from cinder/tests/test_replication.py rename to cinder/tests/unit/test_replication.py index 71e331735..19f620e34 100644 --- a/cinder/tests/test_replication.py +++ b/cinder/tests/unit/test_replication.py @@ -23,7 +23,7 @@ from cinder import context from cinder import db from cinder import exception from cinder import test -from cinder.tests import utils as test_utils +from cinder.tests.unit import utils as test_utils from cinder.volume import driver diff --git a/cinder/tests/test_san.py b/cinder/tests/unit/test_san.py similarity index 100% rename from cinder/tests/test_san.py rename to cinder/tests/unit/test_san.py diff --git a/cinder/tests/test_scality.py b/cinder/tests/unit/test_scality.py similarity index 100% rename from cinder/tests/test_scality.py rename to cinder/tests/unit/test_scality.py diff --git a/cinder/tests/test_service.py b/cinder/tests/unit/test_service.py similarity index 94% rename from cinder/tests/test_service.py rename to cinder/tests/unit/test_service.py index c2de595e1..81dac4f7c 100644 --- a/cinder/tests/test_service.py +++ b/cinder/tests/unit/test_service.py @@ -37,7 +37,7 @@ from cinder import wsgi test_service_opts = [ cfg.StrOpt("fake_manager", - default="cinder.tests.test_service.FakeManager", + default="cinder.tests.unit.test_service.FakeManager", help="Manager for testing"), cfg.StrOpt("test_service_listen", default=None, @@ -73,7 +73,7 @@ class ServiceManagerTestCase(test.TestCase): serv = service.Service('test', 'test', 'test', - 'cinder.tests.test_service.FakeManager') + 'cinder.tests.unit.test_service.FakeManager') serv.start() self.assertEqual('manager', serv.test_method()) @@ -81,7 +81,7 @@ class ServiceManagerTestCase(test.TestCase): serv = ExtendedService('test', 'test', 'test', - 'cinder.tests.test_service.FakeManager') + 'cinder.tests.unit.test_service.FakeManager') serv.start() self.assertEqual('service', serv.test_method()) @@ -157,7 +157,7 @@ class ServiceTestCase(test.TestCase): serv = service.Service(host, binary, topic, - 'cinder.tests.test_service.FakeManager') + 'cinder.tests.unit.test_service.FakeManager') serv.start() serv.report_state() self.assertTrue(serv.model_disconnected) @@ -192,7 +192,7 @@ class ServiceTestCase(test.TestCase): serv = service.Service(host, binary, topic, - 'cinder.tests.test_service.FakeManager') + 'cinder.tests.unit.test_service.FakeManager') serv.start() serv.model_disconnected = True serv.report_state() @@ -202,8 +202,9 @@ class ServiceTestCase(test.TestCase): def test_service_with_long_report_interval(self): self.override_config('service_down_time', 10) self.override_config('report_interval', 10) - service.Service.create(binary="test_service", - manager="cinder.tests.test_service.FakeManager") + service.Service.create( + binary="test_service", + manager="cinder.tests.unit.test_service.FakeManager") self.assertEqual(25, CONF.service_down_time) diff --git a/cinder/tests/test_sheepdog.py b/cinder/tests/unit/test_sheepdog.py similarity index 100% rename from cinder/tests/test_sheepdog.py rename to cinder/tests/unit/test_sheepdog.py diff --git a/cinder/tests/test_smbfs.py b/cinder/tests/unit/test_smbfs.py similarity index 100% rename from cinder/tests/test_smbfs.py rename to cinder/tests/unit/test_smbfs.py diff --git a/cinder/tests/test_solidfire.py b/cinder/tests/unit/test_solidfire.py similarity index 100% rename from cinder/tests/test_solidfire.py rename to cinder/tests/unit/test_solidfire.py diff --git a/cinder/tests/test_srb.py b/cinder/tests/unit/test_srb.py similarity index 99% rename from cinder/tests/test_srb.py rename to cinder/tests/unit/test_srb.py index a328176dd..594a1e181 100644 --- a/cinder/tests/test_srb.py +++ b/cinder/tests/unit/test_srb.py @@ -24,7 +24,7 @@ from oslo_utils import units from cinder import context from cinder import exception from cinder import test -from cinder.tests.brick import test_brick_lvm +from cinder.tests.unit.brick import test_brick_lvm from cinder.volume import configuration as conf from cinder.volume.drivers import srb diff --git a/cinder/tests/test_storwize_svc.py b/cinder/tests/unit/test_storwize_svc.py similarity index 99% rename from cinder/tests/test_storwize_svc.py rename to cinder/tests/unit/test_storwize_svc.py index 9392d6589..cd23c887a 100644 --- a/cinder/tests/test_storwize_svc.py +++ b/cinder/tests/unit/test_storwize_svc.py @@ -33,7 +33,7 @@ from cinder import context from cinder import exception from cinder.i18n import _ from cinder import test -from cinder.tests import utils as testutils +from cinder.tests.unit import utils as testutils from cinder import utils from cinder.volume import configuration as conf from cinder.volume.drivers.ibm import storwize_svc diff --git a/cinder/tests/test_test.py b/cinder/tests/unit/test_test.py similarity index 100% rename from cinder/tests/test_test.py rename to cinder/tests/unit/test_test.py diff --git a/cinder/tests/test_test_utils.py b/cinder/tests/unit/test_test_utils.py similarity index 96% rename from cinder/tests/test_test_utils.py rename to cinder/tests/unit/test_test_utils.py index 8a9dbcd66..0eeba4614 100644 --- a/cinder/tests/test_test_utils.py +++ b/cinder/tests/unit/test_test_utils.py @@ -14,7 +14,7 @@ # under the License. from cinder import test -from cinder.tests import utils as test_utils +from cinder.tests.unit import utils as test_utils class TestUtilsTestCase(test.TestCase): diff --git a/cinder/tests/test_utils.py b/cinder/tests/unit/test_utils.py similarity index 98% rename from cinder/tests/test_utils.py rename to cinder/tests/unit/test_utils.py index ef71eed11..91dd50953 100644 --- a/cinder/tests/test_utils.py +++ b/cinder/tests/unit/test_utils.py @@ -752,7 +752,7 @@ class MonkeyPatchTestCase(test.TestCase): """Unit test for utils.monkey_patch().""" def setUp(self): super(MonkeyPatchTestCase, self).setUp() - self.example_package = 'cinder.tests.monkey_patch_example.' + self.example_package = 'cinder.tests.unit.monkey_patch_example.' self.flags( monkey_patch=True, monkey_patch_modules=[self.example_package + 'example_a' + ':' @@ -761,9 +761,9 @@ class MonkeyPatchTestCase(test.TestCase): def test_monkey_patch(self): utils.monkey_patch() - cinder.tests.monkey_patch_example.CALLED_FUNCTION = [] - from cinder.tests.monkey_patch_example import example_a - from cinder.tests.monkey_patch_example import example_b + cinder.tests.unit.monkey_patch_example.CALLED_FUNCTION = [] + from cinder.tests.unit.monkey_patch_example import example_a + from cinder.tests.unit.monkey_patch_example import example_b self.assertEqual('Example function', example_a.example_function_a()) exampleA = example_a.ExampleClassA() @@ -778,20 +778,26 @@ class MonkeyPatchTestCase(test.TestCase): self.assertEqual(ret_b, 8) package_a = self.example_package + 'example_a.' - self.assertTrue(package_a + 'example_function_a' - in cinder.tests.monkey_patch_example.CALLED_FUNCTION) - - self.assertTrue(package_a + 'ExampleClassA.example_method' - in cinder.tests.monkey_patch_example.CALLED_FUNCTION) - self.assertTrue(package_a + 'ExampleClassA.example_method_add' - in cinder.tests.monkey_patch_example.CALLED_FUNCTION) + self.assertTrue( + package_a + 'example_function_a' + in cinder.tests.unit.monkey_patch_example.CALLED_FUNCTION) + + self.assertTrue( + package_a + 'ExampleClassA.example_method' + in cinder.tests.unit.monkey_patch_example.CALLED_FUNCTION) + self.assertTrue( + package_a + 'ExampleClassA.example_method_add' + in cinder.tests.unit.monkey_patch_example.CALLED_FUNCTION) package_b = self.example_package + 'example_b.' - self.assertFalse(package_b + 'example_function_b' - in cinder.tests.monkey_patch_example.CALLED_FUNCTION) - self.assertFalse(package_b + 'ExampleClassB.example_method' - in cinder.tests.monkey_patch_example.CALLED_FUNCTION) - self.assertFalse(package_b + 'ExampleClassB.example_method_add' - in cinder.tests.monkey_patch_example.CALLED_FUNCTION) + self.assertFalse( + package_b + 'example_function_b' + in cinder.tests.unit.monkey_patch_example.CALLED_FUNCTION) + self.assertFalse( + package_b + 'ExampleClassB.example_method' + in cinder.tests.unit.monkey_patch_example.CALLED_FUNCTION) + self.assertFalse( + package_b + 'ExampleClassB.example_method_add' + in cinder.tests.unit.monkey_patch_example.CALLED_FUNCTION) class AuditPeriodTest(test.TestCase): diff --git a/cinder/tests/test_v6000_common.py b/cinder/tests/unit/test_v6000_common.py similarity index 99% rename from cinder/tests/test_v6000_common.py rename to cinder/tests/unit/test_v6000_common.py index 2dbe3e511..e622dd9be 100644 --- a/cinder/tests/test_v6000_common.py +++ b/cinder/tests/unit/test_v6000_common.py @@ -21,7 +21,7 @@ import mock from cinder import exception from cinder import test -from cinder.tests import fake_vmem_client as vmemclient +from cinder.tests.unit import fake_vmem_client as vmemclient from cinder.volume import configuration as conf from cinder.volume.drivers.violin import v6000_common diff --git a/cinder/tests/test_v6000_fcp.py b/cinder/tests/unit/test_v6000_fcp.py similarity index 99% rename from cinder/tests/test_v6000_fcp.py rename to cinder/tests/unit/test_v6000_fcp.py index 02fe11bb9..9b11320d9 100644 --- a/cinder/tests/test_v6000_fcp.py +++ b/cinder/tests/unit/test_v6000_fcp.py @@ -24,7 +24,7 @@ from cinder import context from cinder.db.sqlalchemy import models from cinder import exception from cinder import test -from cinder.tests import fake_vmem_client as vmemclient +from cinder.tests.unit import fake_vmem_client as vmemclient from cinder.volume import configuration as conf from cinder.volume.drivers.violin import v6000_common from cinder.volume.drivers.violin import v6000_fcp diff --git a/cinder/tests/test_v6000_iscsi.py b/cinder/tests/unit/test_v6000_iscsi.py similarity index 99% rename from cinder/tests/test_v6000_iscsi.py rename to cinder/tests/unit/test_v6000_iscsi.py index 458a938d8..b884ba3ff 100644 --- a/cinder/tests/test_v6000_iscsi.py +++ b/cinder/tests/unit/test_v6000_iscsi.py @@ -24,7 +24,7 @@ from cinder import context from cinder.db.sqlalchemy import models from cinder import exception from cinder import test -from cinder.tests import fake_vmem_client as vmemclient +from cinder.tests.unit import fake_vmem_client as vmemclient from cinder.volume import configuration as conf from cinder.volume.drivers.violin import v6000_common from cinder.volume.drivers.violin import v6000_iscsi diff --git a/cinder/tests/test_vmware_datastore.py b/cinder/tests/unit/test_vmware_datastore.py similarity index 100% rename from cinder/tests/test_vmware_datastore.py rename to cinder/tests/unit/test_vmware_datastore.py diff --git a/cinder/tests/test_vmware_vmdk.py b/cinder/tests/unit/test_vmware_vmdk.py similarity index 100% rename from cinder/tests/test_vmware_vmdk.py rename to cinder/tests/unit/test_vmware_vmdk.py diff --git a/cinder/tests/test_vmware_volumeops.py b/cinder/tests/unit/test_vmware_volumeops.py similarity index 100% rename from cinder/tests/test_vmware_volumeops.py rename to cinder/tests/unit/test_vmware_volumeops.py diff --git a/cinder/tests/test_volume.py b/cinder/tests/unit/test_volume.py similarity index 99% rename from cinder/tests/test_volume.py rename to cinder/tests/unit/test_volume.py index eb9ca327d..ae8cb4b2b 100644 --- a/cinder/tests/test_volume.py +++ b/cinder/tests/unit/test_volume.py @@ -50,14 +50,14 @@ from cinder.openstack.common import fileutils import cinder.policy from cinder import quota from cinder import test -from cinder.tests.api import fakes -from cinder.tests.brick import fake_lvm -from cinder.tests import conf_fixture -from cinder.tests import fake_driver -from cinder.tests import fake_notifier -from cinder.tests.image import fake as fake_image -from cinder.tests.keymgr import fake as fake_keymgr -from cinder.tests import utils as tests_utils +from cinder.tests.unit.api import fakes +from cinder.tests.unit.brick import fake_lvm +from cinder.tests.unit import conf_fixture +from cinder.tests.unit import fake_driver +from cinder.tests.unit import fake_notifier +from cinder.tests.unit.image import fake as fake_image +from cinder.tests.unit.keymgr import fake as fake_keymgr +from cinder.tests.unit import utils as tests_utils from cinder import utils import cinder.volume from cinder.volume import configuration as conf @@ -1723,7 +1723,7 @@ class VolumeTestCase(BaseVolumeTestCase): with mock.patch.object(cinder.volume.volume_types, 'get_volume_type_qos_specs') as type_qos, \ - mock.patch.object(cinder.tests.fake_driver.FakeISCSIDriver, + mock.patch.object(cinder.tests.unit.fake_driver.FakeISCSIDriver, 'initialize_connection') as driver_init: type_qos.return_value = dict(qos_specs=qos_values) driver_init.return_value = {'data': {}} @@ -5102,7 +5102,7 @@ class DriverTestCase(test.TestCase): class GenericVolumeDriverTestCase(DriverTestCase): """Test case for VolumeDriver.""" - driver_name = "cinder.tests.fake_driver.LoggingVolumeDriver" + driver_name = "cinder.tests.unit.fake_driver.LoggingVolumeDriver" def test_backup_volume(self): vol = tests_utils.create_volume(self.context) diff --git a/cinder/tests/test_volume_configuration.py b/cinder/tests/unit/test_volume_configuration.py similarity index 100% rename from cinder/tests/test_volume_configuration.py rename to cinder/tests/unit/test_volume_configuration.py diff --git a/cinder/tests/test_volume_glance_metadata.py b/cinder/tests/unit/test_volume_glance_metadata.py similarity index 100% rename from cinder/tests/test_volume_glance_metadata.py rename to cinder/tests/unit/test_volume_glance_metadata.py diff --git a/cinder/tests/test_volume_rpcapi.py b/cinder/tests/unit/test_volume_rpcapi.py similarity index 99% rename from cinder/tests/test_volume_rpcapi.py rename to cinder/tests/unit/test_volume_rpcapi.py index f1da5b534..6cf41376e 100644 --- a/cinder/tests/test_volume_rpcapi.py +++ b/cinder/tests/unit/test_volume_rpcapi.py @@ -24,7 +24,7 @@ from cinder import context from cinder import db from cinder import objects from cinder import test -from cinder.tests import fake_snapshot +from cinder.tests.unit import fake_snapshot from cinder.volume import rpcapi as volume_rpcapi diff --git a/cinder/tests/test_volume_throttling.py b/cinder/tests/unit/test_volume_throttling.py similarity index 100% rename from cinder/tests/test_volume_throttling.py rename to cinder/tests/unit/test_volume_throttling.py diff --git a/cinder/tests/test_volume_transfer.py b/cinder/tests/unit/test_volume_transfer.py similarity index 99% rename from cinder/tests/test_volume_transfer.py rename to cinder/tests/unit/test_volume_transfer.py index 2b6162f1a..524cb6ab0 100644 --- a/cinder/tests/test_volume_transfer.py +++ b/cinder/tests/unit/test_volume_transfer.py @@ -21,7 +21,7 @@ from cinder import context from cinder import db from cinder import exception from cinder import test -from cinder.tests import utils +from cinder.tests.unit import utils from cinder.transfer import api as transfer_api diff --git a/cinder/tests/test_volume_types.py b/cinder/tests/unit/test_volume_types.py similarity index 99% rename from cinder/tests/test_volume_types.py rename to cinder/tests/unit/test_volume_types.py index a3ed37aeb..e5a024e78 100644 --- a/cinder/tests/test_volume_types.py +++ b/cinder/tests/unit/test_volume_types.py @@ -29,7 +29,7 @@ from cinder.db.sqlalchemy import models from cinder import exception from cinder.i18n import _ from cinder import test -from cinder.tests import conf_fixture +from cinder.tests.unit import conf_fixture from cinder.volume import qos_specs from cinder.volume import volume_types diff --git a/cinder/tests/test_volume_types_extra_specs.py b/cinder/tests/unit/test_volume_types_extra_specs.py similarity index 100% rename from cinder/tests/test_volume_types_extra_specs.py rename to cinder/tests/unit/test_volume_types_extra_specs.py diff --git a/cinder/tests/test_volume_utils.py b/cinder/tests/unit/test_volume_utils.py similarity index 100% rename from cinder/tests/test_volume_utils.py rename to cinder/tests/unit/test_volume_utils.py diff --git a/cinder/tests/test_wsgi.py b/cinder/tests/unit/test_wsgi.py similarity index 100% rename from cinder/tests/test_wsgi.py rename to cinder/tests/unit/test_wsgi.py diff --git a/cinder/tests/test_xio.py b/cinder/tests/unit/test_xio.py similarity index 100% rename from cinder/tests/test_xio.py rename to cinder/tests/unit/test_xio.py diff --git a/cinder/tests/test_zfssa.py b/cinder/tests/unit/test_zfssa.py similarity index 100% rename from cinder/tests/test_zfssa.py rename to cinder/tests/unit/test_zfssa.py diff --git a/cinder/tests/utils.py b/cinder/tests/unit/utils.py similarity index 100% rename from cinder/tests/utils.py rename to cinder/tests/unit/utils.py diff --git a/cinder/tests/var/ca.crt b/cinder/tests/unit/var/ca.crt similarity index 100% rename from cinder/tests/var/ca.crt rename to cinder/tests/unit/var/ca.crt diff --git a/cinder/tests/var/certificate.crt b/cinder/tests/unit/var/certificate.crt similarity index 100% rename from cinder/tests/var/certificate.crt rename to cinder/tests/unit/var/certificate.crt diff --git a/cinder/tests/var/privatekey.key b/cinder/tests/unit/var/privatekey.key similarity index 100% rename from cinder/tests/var/privatekey.key rename to cinder/tests/unit/var/privatekey.key diff --git a/cinder/tests/volume/__init__.py b/cinder/tests/unit/volume/__init__.py similarity index 100% rename from cinder/tests/volume/__init__.py rename to cinder/tests/unit/volume/__init__.py diff --git a/cinder/tests/volume/drivers/__init__.py b/cinder/tests/unit/volume/drivers/__init__.py similarity index 100% rename from cinder/tests/volume/drivers/__init__.py rename to cinder/tests/unit/volume/drivers/__init__.py diff --git a/cinder/tests/volume/drivers/datera.py b/cinder/tests/unit/volume/drivers/datera.py similarity index 100% rename from cinder/tests/volume/drivers/datera.py rename to cinder/tests/unit/volume/drivers/datera.py diff --git a/cinder/tests/volume/drivers/netapp/__init__.py b/cinder/tests/unit/volume/drivers/netapp/__init__.py similarity index 100% rename from cinder/tests/volume/drivers/netapp/__init__.py rename to cinder/tests/unit/volume/drivers/netapp/__init__.py diff --git a/cinder/tests/volume/drivers/netapp/dataontap/__init__.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/__init__.py similarity index 100% rename from cinder/tests/volume/drivers/netapp/dataontap/__init__.py rename to cinder/tests/unit/volume/drivers/netapp/dataontap/__init__.py diff --git a/cinder/tests/volume/drivers/netapp/dataontap/client/__init__.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/client/__init__.py similarity index 100% rename from cinder/tests/volume/drivers/netapp/dataontap/client/__init__.py rename to cinder/tests/unit/volume/drivers/netapp/dataontap/client/__init__.py diff --git a/cinder/tests/volume/drivers/netapp/dataontap/client/fakes.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/client/fakes.py similarity index 100% rename from cinder/tests/volume/drivers/netapp/dataontap/client/fakes.py rename to cinder/tests/unit/volume/drivers/netapp/dataontap/client/fakes.py diff --git a/cinder/tests/volume/drivers/netapp/dataontap/client/test_api.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/client/test_api.py similarity index 100% rename from cinder/tests/volume/drivers/netapp/dataontap/client/test_api.py rename to cinder/tests/unit/volume/drivers/netapp/dataontap/client/test_api.py diff --git a/cinder/tests/volume/drivers/netapp/dataontap/client/test_client_7mode.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/client/test_client_7mode.py similarity index 99% rename from cinder/tests/volume/drivers/netapp/dataontap/client/test_client_7mode.py rename to cinder/tests/unit/volume/drivers/netapp/dataontap/client/test_client_7mode.py index 59113be25..ca2a9e8e4 100644 --- a/cinder/tests/volume/drivers/netapp/dataontap/client/test_client_7mode.py +++ b/cinder/tests/unit/volume/drivers/netapp/dataontap/client/test_client_7mode.py @@ -20,7 +20,7 @@ import mock import six from cinder import test -from cinder.tests.volume.drivers.netapp.dataontap import fakes as fake +from cinder.tests.unit.volume.drivers.netapp.dataontap import fakes as fake from cinder.volume.drivers.netapp.dataontap.client import api as netapp_api from cinder.volume.drivers.netapp.dataontap.client import client_7mode from cinder.volume.drivers.netapp import utils as netapp_utils diff --git a/cinder/tests/volume/drivers/netapp/dataontap/client/test_client_base.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/client/test_client_base.py similarity index 99% rename from cinder/tests/volume/drivers/netapp/dataontap/client/test_client_base.py rename to cinder/tests/unit/volume/drivers/netapp/dataontap/client/test_client_base.py index e0f73a537..ef89c888f 100644 --- a/cinder/tests/volume/drivers/netapp/dataontap/client/test_client_base.py +++ b/cinder/tests/unit/volume/drivers/netapp/dataontap/client/test_client_base.py @@ -19,7 +19,7 @@ import mock import six from cinder import test -import cinder.tests.volume.drivers.netapp.dataontap.fakes as fake +import cinder.tests.unit.volume.drivers.netapp.dataontap.fakes as fake from cinder.volume.drivers.netapp.dataontap.client import api as netapp_api from cinder.volume.drivers.netapp.dataontap.client import client_base diff --git a/cinder/tests/volume/drivers/netapp/dataontap/client/test_client_cmode.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/client/test_client_cmode.py similarity index 99% rename from cinder/tests/volume/drivers/netapp/dataontap/client/test_client_cmode.py rename to cinder/tests/unit/volume/drivers/netapp/dataontap/client/test_client_cmode.py index 25a23ae67..655eb838e 100644 --- a/cinder/tests/volume/drivers/netapp/dataontap/client/test_client_cmode.py +++ b/cinder/tests/unit/volume/drivers/netapp/dataontap/client/test_client_cmode.py @@ -21,8 +21,10 @@ import six from cinder import exception from cinder import test -from cinder.tests.volume.drivers.netapp.dataontap.client import fakes as fake -from cinder.volume.drivers.netapp.dataontap.client import api as netapp_api +from cinder.tests.unit.volume.drivers.netapp.dataontap.client import ( + fakes as fake) +from cinder.volume.drivers.netapp.dataontap.client import ( + api as netapp_api) from cinder.volume.drivers.netapp.dataontap.client import client_cmode from cinder.volume.drivers.netapp import utils as netapp_utils diff --git a/cinder/tests/volume/drivers/netapp/dataontap/fakes.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/fakes.py similarity index 100% rename from cinder/tests/volume/drivers/netapp/dataontap/fakes.py rename to cinder/tests/unit/volume/drivers/netapp/dataontap/fakes.py diff --git a/cinder/tests/volume/drivers/netapp/dataontap/test_block_7mode.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_7mode.py similarity index 99% rename from cinder/tests/volume/drivers/netapp/dataontap/test_block_7mode.py rename to cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_7mode.py index 874875e9c..6bcfc9fac 100644 --- a/cinder/tests/volume/drivers/netapp/dataontap/test_block_7mode.py +++ b/cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_7mode.py @@ -22,8 +22,8 @@ import mock from cinder import exception from cinder import test -import cinder.tests.volume.drivers.netapp.dataontap.fakes as fake -import cinder.tests.volume.drivers.netapp.fakes as na_fakes +import cinder.tests.unit.volume.drivers.netapp.dataontap.fakes as fake +import cinder.tests.unit.volume.drivers.netapp.fakes as na_fakes from cinder.volume.drivers.netapp.dataontap import block_7mode from cinder.volume.drivers.netapp.dataontap import block_base from cinder.volume.drivers.netapp.dataontap.client import api as netapp_api diff --git a/cinder/tests/volume/drivers/netapp/dataontap/test_block_base.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_base.py similarity index 99% rename from cinder/tests/volume/drivers/netapp/dataontap/test_block_base.py rename to cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_base.py index 91779f9c0..57d60e595 100644 --- a/cinder/tests/volume/drivers/netapp/dataontap/test_block_base.py +++ b/cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_base.py @@ -27,7 +27,7 @@ import mock from cinder import exception from cinder.i18n import _ from cinder import test -from cinder.tests.volume.drivers.netapp.dataontap import fakes as fake +from cinder.tests.unit.volume.drivers.netapp.dataontap import fakes as fake from cinder.volume.drivers.netapp.dataontap import block_base from cinder.volume.drivers.netapp.dataontap.client import api as netapp_api from cinder.volume.drivers.netapp import utils as na_utils diff --git a/cinder/tests/volume/drivers/netapp/dataontap/test_block_cmode.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_cmode.py similarity index 98% rename from cinder/tests/volume/drivers/netapp/dataontap/test_block_cmode.py rename to cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_cmode.py index b47c46975..7a893b014 100644 --- a/cinder/tests/volume/drivers/netapp/dataontap/test_block_cmode.py +++ b/cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_cmode.py @@ -21,8 +21,8 @@ import mock from cinder import exception from cinder import test -import cinder.tests.volume.drivers.netapp.dataontap.fakes as fake -import cinder.tests.volume.drivers.netapp.fakes as na_fakes +import cinder.tests.unit.volume.drivers.netapp.dataontap.fakes as fake +import cinder.tests.unit.volume.drivers.netapp.fakes as na_fakes from cinder.volume.drivers.netapp.dataontap import block_base from cinder.volume.drivers.netapp.dataontap import block_cmode from cinder.volume.drivers.netapp.dataontap.client import api as netapp_api diff --git a/cinder/tests/volume/drivers/netapp/dataontap/test_nfs_base.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/test_nfs_base.py similarity index 100% rename from cinder/tests/volume/drivers/netapp/dataontap/test_nfs_base.py rename to cinder/tests/unit/volume/drivers/netapp/dataontap/test_nfs_base.py diff --git a/cinder/tests/volume/drivers/netapp/dataontap/test_nfs_cmode.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/test_nfs_cmode.py similarity index 97% rename from cinder/tests/volume/drivers/netapp/dataontap/test_nfs_cmode.py rename to cinder/tests/unit/volume/drivers/netapp/dataontap/test_nfs_cmode.py index 2f90277f3..cb6e5b470 100644 --- a/cinder/tests/volume/drivers/netapp/dataontap/test_nfs_cmode.py +++ b/cinder/tests/unit/volume/drivers/netapp/dataontap/test_nfs_cmode.py @@ -20,7 +20,7 @@ import mock from cinder.brick.remotefs import remotefs as remotefs_brick from cinder import test -from cinder.tests.volume.drivers.netapp import fakes as na_fakes +from cinder.tests.unit.volume.drivers.netapp import fakes as na_fakes from cinder import utils from cinder.volume.drivers.netapp.dataontap.client import client_cmode from cinder.volume.drivers.netapp.dataontap import nfs_cmode diff --git a/cinder/tests/volume/drivers/netapp/eseries/__init__.py b/cinder/tests/unit/volume/drivers/netapp/eseries/__init__.py similarity index 100% rename from cinder/tests/volume/drivers/netapp/eseries/__init__.py rename to cinder/tests/unit/volume/drivers/netapp/eseries/__init__.py diff --git a/cinder/tests/volume/drivers/netapp/eseries/test_client.py b/cinder/tests/unit/volume/drivers/netapp/eseries/test_client.py similarity index 100% rename from cinder/tests/volume/drivers/netapp/eseries/test_client.py rename to cinder/tests/unit/volume/drivers/netapp/eseries/test_client.py diff --git a/cinder/tests/volume/drivers/netapp/eseries/test_iscsi.py b/cinder/tests/unit/volume/drivers/netapp/eseries/test_iscsi.py similarity index 99% rename from cinder/tests/volume/drivers/netapp/eseries/test_iscsi.py rename to cinder/tests/unit/volume/drivers/netapp/eseries/test_iscsi.py index 193deade4..25e387555 100644 --- a/cinder/tests/volume/drivers/netapp/eseries/test_iscsi.py +++ b/cinder/tests/unit/volume/drivers/netapp/eseries/test_iscsi.py @@ -21,7 +21,7 @@ Mock unit tests for the NetApp E-series iscsi driver import mock from cinder import test -from cinder.tests.volume.drivers.netapp import fakes as na_fakes +from cinder.tests.unit.volume.drivers.netapp import fakes as na_fakes from cinder.volume.drivers.netapp.eseries import client as es_client from cinder.volume.drivers.netapp.eseries import iscsi as es_iscsi from cinder.volume.drivers.netapp import utils as na_utils diff --git a/cinder/tests/volume/drivers/netapp/eseries/test_utils.py b/cinder/tests/unit/volume/drivers/netapp/eseries/test_utils.py similarity index 100% rename from cinder/tests/volume/drivers/netapp/eseries/test_utils.py rename to cinder/tests/unit/volume/drivers/netapp/eseries/test_utils.py diff --git a/cinder/tests/volume/drivers/netapp/fakes.py b/cinder/tests/unit/volume/drivers/netapp/fakes.py similarity index 100% rename from cinder/tests/volume/drivers/netapp/fakes.py rename to cinder/tests/unit/volume/drivers/netapp/fakes.py diff --git a/cinder/tests/volume/drivers/netapp/test_common.py b/cinder/tests/unit/volume/drivers/netapp/test_common.py similarity index 98% rename from cinder/tests/volume/drivers/netapp/test_common.py rename to cinder/tests/unit/volume/drivers/netapp/test_common.py index 3f8d0c7ce..d846b3c6a 100644 --- a/cinder/tests/volume/drivers/netapp/test_common.py +++ b/cinder/tests/unit/volume/drivers/netapp/test_common.py @@ -17,7 +17,7 @@ import six from cinder import exception from cinder import test -import cinder.tests.volume.drivers.netapp.fakes as na_fakes +import cinder.tests.unit.volume.drivers.netapp.fakes as na_fakes import cinder.volume.drivers.netapp.common as na_common import cinder.volume.drivers.netapp.dataontap.fc_cmode as fc_cmode import cinder.volume.drivers.netapp.utils as na_utils diff --git a/cinder/tests/volume/drivers/netapp/test_utils.py b/cinder/tests/unit/volume/drivers/netapp/test_utils.py similarity index 99% rename from cinder/tests/volume/drivers/netapp/test_utils.py rename to cinder/tests/unit/volume/drivers/netapp/test_utils.py index ac97bc731..f636e5a4d 100644 --- a/cinder/tests/volume/drivers/netapp/test_utils.py +++ b/cinder/tests/unit/volume/drivers/netapp/test_utils.py @@ -24,7 +24,7 @@ from oslo_concurrency import processutils as putils from cinder import exception from cinder import test -import cinder.tests.volume.drivers.netapp.fakes as fake +import cinder.tests.unit.volume.drivers.netapp.fakes as fake from cinder import version import cinder.volume.drivers.netapp.utils as na_utils diff --git a/cinder/tests/windows/__init__.py b/cinder/tests/unit/windows/__init__.py similarity index 100% rename from cinder/tests/windows/__init__.py rename to cinder/tests/unit/windows/__init__.py diff --git a/cinder/tests/windows/db_fakes.py b/cinder/tests/unit/windows/db_fakes.py similarity index 100% rename from cinder/tests/windows/db_fakes.py rename to cinder/tests/unit/windows/db_fakes.py diff --git a/cinder/tests/windows/test_smbfs.py b/cinder/tests/unit/windows/test_smbfs.py similarity index 100% rename from cinder/tests/windows/test_smbfs.py rename to cinder/tests/unit/windows/test_smbfs.py diff --git a/cinder/tests/windows/test_vhdutils.py b/cinder/tests/unit/windows/test_vhdutils.py similarity index 100% rename from cinder/tests/windows/test_vhdutils.py rename to cinder/tests/unit/windows/test_vhdutils.py diff --git a/cinder/tests/windows/test_windows.py b/cinder/tests/unit/windows/test_windows.py similarity index 99% rename from cinder/tests/windows/test_windows.py rename to cinder/tests/unit/windows/test_windows.py index 759cb747b..0b8eb15b5 100644 --- a/cinder/tests/windows/test_windows.py +++ b/cinder/tests/unit/windows/test_windows.py @@ -28,7 +28,7 @@ from oslo_config import cfg from cinder.image import image_utils from cinder.openstack.common import fileutils from cinder import test -from cinder.tests.windows import db_fakes +from cinder.tests.unit.windows import db_fakes from cinder.volume import configuration as conf from cinder.volume.drivers.windows import constants from cinder.volume.drivers.windows import vhdutils diff --git a/cinder/tests/windows/test_windows_remotefs.py b/cinder/tests/unit/windows/test_windows_remotefs.py similarity index 100% rename from cinder/tests/windows/test_windows_remotefs.py rename to cinder/tests/unit/windows/test_windows_remotefs.py diff --git a/cinder/tests/windows/test_windows_utils.py b/cinder/tests/unit/windows/test_windows_utils.py similarity index 100% rename from cinder/tests/windows/test_windows_utils.py rename to cinder/tests/unit/windows/test_windows_utils.py diff --git a/cinder/tests/xenapi/__init__.py b/cinder/tests/unit/xenapi/__init__.py similarity index 100% rename from cinder/tests/xenapi/__init__.py rename to cinder/tests/unit/xenapi/__init__.py diff --git a/cinder/tests/zonemanager/__init__.py b/cinder/tests/unit/zonemanager/__init__.py similarity index 100% rename from cinder/tests/zonemanager/__init__.py rename to cinder/tests/unit/zonemanager/__init__.py diff --git a/cinder/tests/zonemanager/test_brcd_fc_san_lookup_service.py b/cinder/tests/unit/zonemanager/test_brcd_fc_san_lookup_service.py similarity index 100% rename from cinder/tests/zonemanager/test_brcd_fc_san_lookup_service.py rename to cinder/tests/unit/zonemanager/test_brcd_fc_san_lookup_service.py diff --git a/cinder/tests/zonemanager/test_brcd_fc_zone_client_cli.py b/cinder/tests/unit/zonemanager/test_brcd_fc_zone_client_cli.py similarity index 100% rename from cinder/tests/zonemanager/test_brcd_fc_zone_client_cli.py rename to cinder/tests/unit/zonemanager/test_brcd_fc_zone_client_cli.py diff --git a/cinder/tests/zonemanager/test_brcd_fc_zone_driver.py b/cinder/tests/unit/zonemanager/test_brcd_fc_zone_driver.py similarity index 97% rename from cinder/tests/zonemanager/test_brcd_fc_zone_driver.py rename to cinder/tests/unit/zonemanager/test_brcd_fc_zone_driver.py index 24c5f49c7..fa6c8da38 100644 --- a/cinder/tests/zonemanager/test_brcd_fc_zone_driver.py +++ b/cinder/tests/unit/zonemanager/test_brcd_fc_zone_driver.py @@ -65,16 +65,16 @@ class BrcdFcZoneDriverBaseTest(object): configuration = conf.Configuration(fc_test_opts) # fill up config configuration.zoning_mode = 'fabric' - configuration.zone_driver = ('cinder.tests.zonemanager.' + configuration.zone_driver = ('cinder.tests.unit.zonemanager.' 'test_brcd_fc_zone_driver.' 'FakeBrcdFCZoneDriver') - configuration.brcd_sb_connector = ('cinder.tests.zonemanager.' + configuration.brcd_sb_connector = ('cinder.tests.unit.zonemanager.' 'test_brcd_fc_zone_driver' '.FakeBrcdFCZoneClientCLI') configuration.zoning_policy = 'initiator-target' configuration.zone_activate = True configuration.zone_name_prefix = 'openstack' - configuration.fc_san_lookup_service = ('cinder.tests.zonemanager.' + configuration.fc_san_lookup_service = ('cinder.tests.unit.zonemanager.' 'test_brcd_fc_zone_driver.' 'FakeBrcdFCSanLookupService') diff --git a/cinder/tests/zonemanager/test_brcd_lookup_service.py b/cinder/tests/unit/zonemanager/test_brcd_lookup_service.py similarity index 98% rename from cinder/tests/zonemanager/test_brcd_lookup_service.py rename to cinder/tests/unit/zonemanager/test_brcd_lookup_service.py index 5010bb0b4..34d080c01 100644 --- a/cinder/tests/zonemanager/test_brcd_lookup_service.py +++ b/cinder/tests/unit/zonemanager/test_brcd_lookup_service.py @@ -51,7 +51,7 @@ class TestFCSanLookupService(san_service.FCSanLookupService, test.TestCase): configuration = conf.Configuration(None) # fill up config configuration.fc_san_lookup_service = ( - 'cinder.tests.zonemanager.test_brcd_lookup_service.' + 'cinder.tests.unit.zonemanager.test_brcd_lookup_service.' 'FakeBrcdFCSanLookupService') return configuration diff --git a/cinder/tests/zonemanager/test_cisco_fc_san_lookup_service.py b/cinder/tests/unit/zonemanager/test_cisco_fc_san_lookup_service.py similarity index 100% rename from cinder/tests/zonemanager/test_cisco_fc_san_lookup_service.py rename to cinder/tests/unit/zonemanager/test_cisco_fc_san_lookup_service.py diff --git a/cinder/tests/zonemanager/test_cisco_fc_zone_client_cli.py b/cinder/tests/unit/zonemanager/test_cisco_fc_zone_client_cli.py similarity index 100% rename from cinder/tests/zonemanager/test_cisco_fc_zone_client_cli.py rename to cinder/tests/unit/zonemanager/test_cisco_fc_zone_client_cli.py diff --git a/cinder/tests/zonemanager/test_cisco_fc_zone_driver.py b/cinder/tests/unit/zonemanager/test_cisco_fc_zone_driver.py similarity index 97% rename from cinder/tests/zonemanager/test_cisco_fc_zone_driver.py rename to cinder/tests/unit/zonemanager/test_cisco_fc_zone_driver.py index a9aa3c4a4..42e5c555c 100644 --- a/cinder/tests/zonemanager/test_cisco_fc_zone_driver.py +++ b/cinder/tests/unit/zonemanager/test_cisco_fc_zone_driver.py @@ -58,16 +58,16 @@ class CiscoFcZoneDriverBaseTest(object): configuration = conf.Configuration(fc_test_opts) # fill up config configuration.zoning_mode = 'fabric' - configuration.zone_driver = ('cinder.tests.zonemanager.' + configuration.zone_driver = ('cinder.tests.unit.zonemanager.' 'test_cisco_fc_zone_driver.' 'FakeCiscoFCZoneDriver') - configuration.cisco_sb_connector = ('cinder.tests.zonemanager.' + configuration.cisco_sb_connector = ('cinder.tests.unit.zonemanager.' 'test_cisco_fc_zone_driver' '.FakeCiscoFCZoneClientCLI') configuration.zoning_policy = 'initiator-target' configuration.zone_activate = True configuration.zone_name_prefix = 'openstack' - configuration.fc_san_lookup_service = ('cinder.tests.zonemanager.' + configuration.fc_san_lookup_service = ('cinder.tests.unit.zonemanager.' 'test_cisco_fc_zone_driver.' 'FakeCiscoFCSanLookupService') diff --git a/cinder/tests/zonemanager/test_cisco_lookup_service.py b/cinder/tests/unit/zonemanager/test_cisco_lookup_service.py similarity index 97% rename from cinder/tests/zonemanager/test_cisco_lookup_service.py rename to cinder/tests/unit/zonemanager/test_cisco_lookup_service.py index aaf0f1b6e..b2b4c171c 100644 --- a/cinder/tests/zonemanager/test_cisco_lookup_service.py +++ b/cinder/tests/unit/zonemanager/test_cisco_lookup_service.py @@ -44,7 +44,7 @@ class TestFCSanLookupService(san_service.FCSanLookupService, test.TestCase): def setup_config(self): configuration = conf.Configuration(None) # fill up config - configuration.fc_san_lookup_service = ('cinder.tests.zonemanager' + configuration.fc_san_lookup_service = ('cinder.tests.unit.zonemanager' '.test_cisco_lookup_service' '.FakeCiscoFCSanLookupService') return configuration diff --git a/cinder/tests/zonemanager/test_fc_zone_manager.py b/cinder/tests/unit/zonemanager/test_fc_zone_manager.py similarity index 100% rename from cinder/tests/zonemanager/test_fc_zone_manager.py rename to cinder/tests/unit/zonemanager/test_fc_zone_manager.py diff --git a/cinder/tests/zonemanager/test_volume_driver.py b/cinder/tests/unit/zonemanager/test_volume_driver.py similarity index 98% rename from cinder/tests/zonemanager/test_volume_driver.py rename to cinder/tests/unit/zonemanager/test_volume_driver.py index fe4c919d6..f68f39def 100644 --- a/cinder/tests/zonemanager/test_volume_driver.py +++ b/cinder/tests/unit/zonemanager/test_volume_driver.py @@ -22,7 +22,7 @@ import mock from cinder import test -from cinder.tests import fake_driver +from cinder.tests.unit import fake_driver from cinder import utils from cinder.volume import configuration as conf from cinder.zonemanager.drivers.brocade import brcd_fc_zone_driver