Browse Source

tests: Move remaining non-libvirt fixtures

Move these to the central place. There's a large amount of test damage
but it's pretty trivial.

Change-Id: If581eb7aa463c9dde13714f34f0f1b41549a7130
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
changes/67/790967/2
Stephen Finucane 7 months ago
parent
commit
c269285568
  1. 3
      nova/test.py
  2. 9
      nova/tests/fixtures/__init__.py
  3. 2
      nova/tests/fixtures/api_paste.py
  4. 8
      nova/tests/fixtures/cast_as_call.py
  5. 2
      nova/tests/fixtures/policy.py
  6. 2
      nova/tests/functional/api_sample_tests/api_sample_base.py
  7. 8
      nova/tests/functional/integrated_helpers.py
  8. 6
      nova/tests/functional/libvirt/test_numa_live_migration.py
  9. 4
      nova/tests/functional/libvirt/test_numa_servers.py
  10. 12
      nova/tests/functional/libvirt/test_pci_sriov_servers.py
  11. 6
      nova/tests/functional/regressions/test_bug_1522536.py
  12. 3
      nova/tests/functional/regressions/test_bug_1541691.py
  13. 6
      nova/tests/functional/regressions/test_bug_1548980.py
  14. 3
      nova/tests/functional/regressions/test_bug_1552888.py
  15. 6
      nova/tests/functional/regressions/test_bug_1554631.py
  16. 3
      nova/tests/functional/regressions/test_bug_1558866.py
  17. 6
      nova/tests/functional/regressions/test_bug_1595962.py
  18. 6
      nova/tests/functional/regressions/test_bug_1620248.py
  19. 6
      nova/tests/functional/regressions/test_bug_1670627.py
  20. 6
      nova/tests/functional/regressions/test_bug_1671648.py
  21. 6
      nova/tests/functional/regressions/test_bug_1675570.py
  22. 3
      nova/tests/functional/regressions/test_bug_1679750.py
  23. 3
      nova/tests/functional/regressions/test_bug_1682693.py
  24. 11
      nova/tests/functional/regressions/test_bug_1689692.py
  25. 11
      nova/tests/functional/regressions/test_bug_1702454.py
  26. 3
      nova/tests/functional/regressions/test_bug_1713783.py
  27. 3
      nova/tests/functional/regressions/test_bug_1718455.py
  28. 3
      nova/tests/functional/regressions/test_bug_1718512.py
  29. 3
      nova/tests/functional/regressions/test_bug_1719730.py
  30. 3
      nova/tests/functional/regressions/test_bug_1735407.py
  31. 3
      nova/tests/functional/regressions/test_bug_1741307.py
  32. 3
      nova/tests/functional/regressions/test_bug_1746483.py
  33. 3
      nova/tests/functional/regressions/test_bug_1764556.py
  34. 3
      nova/tests/functional/regressions/test_bug_1764883.py
  35. 3
      nova/tests/functional/regressions/test_bug_1780373.py
  36. 5
      nova/tests/functional/regressions/test_bug_1781286.py
  37. 3
      nova/tests/functional/regressions/test_bug_1781710.py
  38. 3
      nova/tests/functional/regressions/test_bug_1784353.py
  39. 3
      nova/tests/functional/regressions/test_bug_1797580.py
  40. 3
      nova/tests/functional/regressions/test_bug_1806064.py
  41. 3
      nova/tests/functional/regressions/test_bug_1815153.py
  42. 3
      nova/tests/functional/regressions/test_bug_1835822.py
  43. 3
      nova/tests/functional/regressions/test_bug_1852458.py
  44. 3
      nova/tests/functional/regressions/test_bug_1893284.py
  45. 5
      nova/tests/functional/regressions/test_bug_1902925.py
  46. 3
      nova/tests/functional/regressions/test_bug_1914777.py
  47. 3
      nova/tests/functional/test_aggregates.py
  48. 6
      nova/tests/functional/test_availability_zones.py
  49. 3
      nova/tests/functional/test_boot_from_volume.py
  50. 3
      nova/tests/functional/test_compute_mgr.py
  51. 3
      nova/tests/functional/test_cross_az_attach.py
  52. 5
      nova/tests/functional/test_cross_cell_migrate.py
  53. 3
      nova/tests/functional/test_external_networks.py
  54. 3
      nova/tests/functional/test_instance_actions.py
  55. 6
      nova/tests/functional/test_list_servers_ip_filter.py
  56. 2
      nova/tests/functional/test_nova_manage.py
  57. 3
      nova/tests/functional/test_policy.py
  58. 3
      nova/tests/functional/test_scheduler.py
  59. 3
      nova/tests/functional/test_server_faults.py
  60. 5
      nova/tests/functional/test_server_group.py
  61. 8
      nova/tests/functional/test_servers.py
  62. 3
      nova/tests/functional/test_service.py
  63. 3
      nova/tests/functional/wsgi/test_flavor_manage.py
  64. 3
      nova/tests/functional/wsgi/test_secgroup.py
  65. 9
      nova/tests/functional/wsgi/test_servers.py
  66. 3
      nova/tests/unit/api/openstack/compute/test_server_groups.py
  67. 4
      nova/tests/unit/cmd/test_policy.py
  68. 3
      nova/tests/unit/cmd/test_status.py
  69. 37
      nova/tests/unit/conductor/test_conductor.py
  70. 5
      nova/tests/unit/policies/base.py
  71. 4
      nova/tests/unit/policies/test_attach_interfaces.py
  72. 4
      nova/tests/unit/policies/test_instance_actions.py
  73. 4
      nova/tests/unit/policies/test_services.py
  74. 6
      nova/tests/unit/test_policy.py

3
nova/test.py

@ -63,7 +63,6 @@ from nova.objects import base as objects_base
from nova import quota
from nova.tests import fixtures as nova_fixtures
from nova.tests.unit import matchers
from nova.tests.unit import policy_fixture
from nova import utils
from nova.virt import images
@ -263,7 +262,7 @@ class TestCase(base.BaseTestCase):
self.addCleanup(self._clear_attrs)
self.useFixture(fixtures.EnvironmentVariable('http_proxy'))
self.policy = self.useFixture(policy_fixture.PolicyFixture())
self.policy = self.useFixture(nova_fixtures.PolicyFixture())
self.useFixture(nova_fixtures.PoisonFunctions())

9
nova/tests/fixtures/__init__.py

@ -10,5 +10,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from .conf import * # noqa: F401, F403
from .api_paste import ApiPasteNoProjectId # noqa: F401
from .api_paste import ApiPasteV21Fixture # noqa: F401
from .cast_as_call import CastAsCallFixture # noqa: F401
from .conf import ConfFixture # noqa: F401
from .nova import * # noqa: F401, F403
from .policy import OverridePolicyFixture # noqa: F401
from .policy import PolicyFixture # noqa: F401
from .policy import RealPolicyFixture # noqa: F401
from .policy import RoleBasedPolicyFixture # noqa: F401

2
nova/tests/functional/api_paste_fixture.py → nova/tests/fixtures/api_paste.py

@ -11,6 +11,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os
import fixtures
@ -18,7 +19,6 @@ import fixtures
import nova.conf
from nova.conf import paths
CONF = nova.conf.CONF

8
nova/tests/unit/cast_as_call.py → nova/tests/fixtures/cast_as_call.py

@ -18,7 +18,7 @@ import fixtures
import oslo_messaging as messaging
class CastAsCall(fixtures.Fixture):
class CastAsCallFixture(fixtures.Fixture):
"""Make RPC 'cast' behave like a 'call'.
@ -31,7 +31,7 @@ class CastAsCall(fixtures.Fixture):
"""
def __init__(self, testcase):
super(CastAsCall, self).__init__()
super().__init__()
self.testcase = testcase
@staticmethod
@ -47,7 +47,7 @@ class CastAsCall(fixtures.Fixture):
if 'fanout' in kwargs:
kwargs['fanout'] = False
cctxt = orig_prepare(self, *args, **kwargs)
CastAsCall._stub_out(testcase, cctxt) # woo, recurse!
CastAsCallFixture._stub_out(testcase, cctxt) # woo, recurse!
return cctxt
if obj:
@ -65,5 +65,5 @@ class CastAsCall(fixtures.Fixture):
messaging.RPCClient.call)
def setUp(self):
super(CastAsCall, self).setUp()
super().setUp()
self._stub_out(self.testcase)

2
nova/tests/unit/policy_fixture.py → nova/tests/fixtures/policy.py

@ -152,7 +152,7 @@ class OverridePolicyFixture(RealPolicyFixture):
# Oslo.policy will consider the overridden rules if:
# 1. overridden checks are different than defaults
# 2. new rules for deprecated rules are not present in policy file
self.policy = self.useFixture(policy_fixture.OverridePolicyFixture(
self.policy = self.useFixture(nova_fixtures.OverridePolicyFixture(
rules_in_file=override_rules))
"""

2
nova/tests/functional/api_sample_tests/api_sample_base.py

@ -18,7 +18,7 @@ import testscenarios
import nova.conf
from nova.tests import fixtures
from nova.tests.functional import api_paste_fixture
from nova.tests.fixtures import api_paste as api_paste_fixture
from nova.tests.functional import api_samples_test_base
CONF = nova.conf.CONF

8
nova/tests/functional/integrated_helpers.py

@ -40,9 +40,7 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional.api import client as api_client
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.unit import cast_as_call
from nova.tests.unit import fake_notifier
from nova.tests.unit import policy_fixture
from nova import utils
@ -1109,13 +1107,13 @@ class _IntegratedTestBase(test.TestCase, PlacementInstanceHelperMixin):
def setUp(self):
super(_IntegratedTestBase, self).setUp()
self.useFixture(cast_as_call.CastAsCall(self))
self.useFixture(nova_fixtures.CastAsCallFixture(self))
self.placement = self.useFixture(func_fixtures.PlacementFixture()).api
self.neutron = self.useFixture(nova_fixtures.NeutronFixture(self))
self.cinder = self.useFixture(nova_fixtures.CinderFixture(self))
self.glance = self.useFixture(nova_fixtures.GlanceFixture(self))
self.policy = self.useFixture(policy_fixture.RealPolicyFixture())
self.policy = self.useFixture(nova_fixtures.RealPolicyFixture())
fake_notifier.stub_notifier(self)
self.addCleanup(fake_notifier.reset)
@ -1182,7 +1180,7 @@ class ProviderUsageBaseTestCase(test.TestCase, PlacementInstanceHelperMixin):
self.flags(compute_driver=self.compute_driver)
super(ProviderUsageBaseTestCase, self).setUp()
self.policy = self.useFixture(policy_fixture.RealPolicyFixture())
self.policy = self.useFixture(nova_fixtures.RealPolicyFixture())
self.neutron = self.useFixture(nova_fixtures.NeutronFixture(self))
self.glance = self.useFixture(nova_fixtures.GlanceFixture(self))
self.placement = self.useFixture(func_fixtures.PlacementFixture()).api

6
nova/tests/functional/libvirt/test_numa_live_migration.py

@ -620,9 +620,8 @@ class NUMALiveMigrationNegativeTests(NUMALiveMigrationBase):
server = self.api.post_server(post)
self._wait_for_state_change(server, 'ACTIVE')
self.assertEqual('host_a', self.get_host(server['id']))
# NOTE(artom) Because we use the CastAsCall fixture, we expect the
# NOTE(artom) Because we use the CastAsCallFixture, we expect the
# MigrationPreCheckError to be bubbled up to the API as an error 500.
# TODO(artom) Stop using CastAsCall to make it more realistic.
self.api.api_post(
'/servers/%s/action' % server['id'],
{'os-migrateLive': {'host': 'host_b',
@ -666,9 +665,8 @@ class NUMALiveMigrationNegativeTests(NUMALiveMigrationBase):
self._wait_for_state_change(server, 'ACTIVE')
initial_host = self.get_host(server['id'])
dest_host = 'host_a' if initial_host == 'host_b' else 'host_b'
# NOTE(artom) Because we use the CastAsCall fixture, we expect the
# NOTE(artom) Because we use the CastAsCallFixture, we expect the
# MigrationPreCheckError to be bubbled up to the API as an error 500.
# TODO(artom) Stop using CastAsCall to make it more realistic.
self.api.api_post(
'/servers/%s/action' % server['id'],
{'os-migrateLive': {'host': dest_host,

4
nova/tests/functional/libvirt/test_numa_servers.py

@ -1193,8 +1193,8 @@ class NUMAServersWithNetworksTest(NUMAServersTestBase):
ex = self.assertRaises(client.OpenStackApiException,
self.api.post_server_action, server['id'], post)
# NOTE(danms): This wouldn't happen in a real deployment since rebuild
# is a cast, but since we are using CastAsCall this will bubble to the
# API.
# is a cast, but since we are using CastAsCallFixture this will bubble
# to the API.
self.assertEqual(500, ex.response.status_code)
self.assertIn('NoValidHost', str(ex))

12
nova/tests/functional/libvirt/test_pci_sriov_servers.py

@ -322,8 +322,8 @@ class SRIOVServersTest(_PCIServersTestBase):
self._live_migrate,
server, 'completed')
# NOTE(stephenfin): this wouldn't happen in a real deployment since
# live migration is a cast, but since we are using CastAsCall this will
# bubble to the API
# live migration is a cast, but since we are using CastAsCallFixture
# this will bubble to the API
self.assertEqual(500, ex.response.status_code)
self.assertIn('NoValidHost', str(ex))
@ -353,8 +353,8 @@ class SRIOVServersTest(_PCIServersTestBase):
self._live_migrate,
server, 'completed')
# NOTE(stephenfin): this wouldn't happen in a real deployment since
# live migration is a cast, but since we are using CastAsCall this will
# bubble to the API
# live migration is a cast, but since we are using CastAsCallFixture
# this will bubble to the API
self.assertEqual(500, ex.response.status_code)
self.assertIn('NoValidHost', str(ex))
@ -1089,8 +1089,8 @@ class PCIServersTest(_PCIServersTestBase):
self._live_migrate,
server, 'completed')
# NOTE(stephenfin): this wouldn't happen in a real deployment since
# live migration is a cast, but since we are using CastAsCall this will
# bubble to the API
# live migration is a cast, but since we are using CastAsCallFixture
# this will bubble to the API
self.assertEqual(500, ex.response.status_code)
self.assertIn('NoValidHost', str(ex))

6
nova/tests/functional/regressions/test_bug_1522536.py

@ -15,8 +15,6 @@
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional.api import client
from nova.tests.unit import cast_as_call
from nova.tests.unit import policy_fixture
class TestServerGet(test.TestCase):
@ -24,7 +22,7 @@ class TestServerGet(test.TestCase):
def setUp(self):
super(TestServerGet, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(nova_fixtures.GlanceFixture(self))
api_fixture = self.useFixture(nova_fixtures.OSAPIFixture(
@ -36,7 +34,7 @@ class TestServerGet(test.TestCase):
self.start_service('scheduler')
self.compute = self.start_service('compute')
self.useFixture(cast_as_call.CastAsCall(self))
self.useFixture(nova_fixtures.CastAsCallFixture(self))
self.image_id = self.api.get_images()[0]['id']
self.flavor_id = self.api.get_flavors()[0]['id']

3
nova/tests/functional/regressions/test_bug_1541691.py

@ -15,7 +15,6 @@
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional.api import client
from nova.tests.unit import policy_fixture
class TestServerValidation(test.TestCase):
@ -24,7 +23,7 @@ class TestServerValidation(test.TestCase):
def setUp(self):
super(TestServerValidation, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.GlanceFixture(self))
api_fixture = self.useFixture(nova_fixtures.OSAPIFixture(

6
nova/tests/functional/regressions/test_bug_1548980.py

@ -17,8 +17,6 @@ import time
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional.api import client
from nova.tests.unit import cast_as_call
from nova.tests.unit import policy_fixture
class TestServerGet(test.TestCase):
@ -26,10 +24,10 @@ class TestServerGet(test.TestCase):
def setUp(self):
super(TestServerGet, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(nova_fixtures.GlanceFixture(self))
self.useFixture(cast_as_call.CastAsCall(self))
self.useFixture(nova_fixtures.CastAsCallFixture(self))
# The non-admin API client is fine to stay at 2.1 since it just creates
# and deletes the server.

3
nova/tests/functional/regressions/test_bug_1552888.py

@ -15,14 +15,13 @@
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.unit import policy_fixture
class TestAggregateCreation(test.TestCase):
def setUp(self):
super(TestAggregateCreation, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
api_fixture = self.useFixture(nova_fixtures.OSAPIFixture(
api_version='v2.1'))

6
nova/tests/functional/regressions/test_bug_1554631.py

@ -11,19 +11,19 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from cinderclient import exceptions as cinder_exceptions
import mock
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional.api import client
from nova.tests.unit import policy_fixture
class TestCinderForbidden(test.TestCase):
def setUp(self):
super(TestCinderForbidden, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
api_fixture = self.useFixture(nova_fixtures.OSAPIFixture(
api_version='v2.1'))
@ -50,7 +50,7 @@ class TestCinderForbidden(test.TestCase):
class TestCinderOverLimit(test.TestCase):
def setUp(self):
super(TestCinderOverLimit, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
api_fixture = self.useFixture(nova_fixtures.OSAPIFixture(
api_version='v2.1'))

3
nova/tests/functional/regressions/test_bug_1558866.py

@ -17,14 +17,13 @@ import datetime
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional.api import client as api_client
from nova.tests.unit import policy_fixture
class TestServerGet(test.TestCase):
def setUp(self):
super(TestServerGet, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.glance = self.useFixture(nova_fixtures.GlanceFixture(self))
api_fixture = self.useFixture(nova_fixtures.OSAPIFixture(

6
nova/tests/functional/regressions/test_bug_1595962.py

@ -21,8 +21,6 @@ import mock
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.unit import cast_as_call
from nova.tests.unit import policy_fixture
from nova.tests.unit.virt.libvirt import fakelibvirt
from nova.virt.libvirt import guest as libvirt_guest
@ -32,7 +30,7 @@ class TestSerialConsoleLiveMigrate(test.TestCase):
def setUp(self):
super(TestSerialConsoleLiveMigrate, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(nova_fixtures.GlanceFixture(self))
self.useFixture(func_fixtures.PlacementFixture())
@ -62,7 +60,7 @@ class TestSerialConsoleLiveMigrate(test.TestCase):
self.start_service('scheduler')
self.compute = self.start_service('compute', host='test_compute1')
self.useFixture(cast_as_call.CastAsCall(self))
self.useFixture(nova_fixtures.CastAsCallFixture(self))
self.image_id = self.api.get_images()[0]['id']
self.flavor_id = self.api.get_flavors()[0]['id']

6
nova/tests/functional/regressions/test_bug_1620248.py

@ -12,8 +12,6 @@
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.unit import cast_as_call
from nova.tests.unit import policy_fixture
class TestServerUpdate(test.TestCase):
@ -21,7 +19,7 @@ class TestServerUpdate(test.TestCase):
def setUp(self):
super(TestServerUpdate, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(nova_fixtures.GlanceFixture(self))
# Simulate requests coming in before the instance is scheduled by
@ -32,7 +30,7 @@ class TestServerUpdate(test.TestCase):
self.api = api_fixture.api
self.useFixture(cast_as_call.CastAsCall(self))
self.useFixture(nova_fixtures.CastAsCallFixture(self))
self.image_id = self.api.get_images()[0]['id']
self.flavor_id = self.api.get_flavors()[0]['id']

6
nova/tests/functional/regressions/test_bug_1670627.py

@ -17,8 +17,6 @@ import time
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional.api import client
from nova.tests.unit import cast_as_call
from nova.tests.unit import policy_fixture
class TestDeleteFromCell0CheckQuota(test.TestCase):
@ -47,7 +45,7 @@ class TestDeleteFromCell0CheckQuota(test.TestCase):
def setUp(self):
super(TestDeleteFromCell0CheckQuota, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(nova_fixtures.GlanceFixture(self))
@ -62,7 +60,7 @@ class TestDeleteFromCell0CheckQuota(test.TestCase):
# compute hosts to schedule the instance to and will go into error and
# be put into cell0.
self.useFixture(cast_as_call.CastAsCall(self))
self.useFixture(nova_fixtures.CastAsCallFixture(self))
self.image_id = self.api.get_images()[0]['id']
self.flavor_id = self.api.get_flavors()[0]['id']

6
nova/tests/functional/regressions/test_bug_1671648.py

@ -19,9 +19,7 @@ from nova import exception
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.unit import cast_as_call
from nova.tests.unit import fake_network
from nova.tests.unit import policy_fixture
class TestRetryBetweenComputeNodeBuilds(test.TestCase):
@ -39,7 +37,7 @@ class TestRetryBetweenComputeNodeBuilds(test.TestCase):
def setUp(self):
super(TestRetryBetweenComputeNodeBuilds, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
# The NeutronFixture is needed to stub out validate_networks in API.
self.useFixture(nova_fixtures.NeutronFixture(self))
@ -69,7 +67,7 @@ class TestRetryBetweenComputeNodeBuilds(test.TestCase):
self.scheduler_service = self.start_service('scheduler')
self.useFixture(cast_as_call.CastAsCall(self))
self.useFixture(nova_fixtures.CastAsCallFixture(self))
self.image_id = self.admin_api.get_images()[0]['id']
self.flavor_id = self.admin_api.get_flavors()[0]['id']

6
nova/tests/functional/regressions/test_bug_1675570.py

@ -20,8 +20,6 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional.api import client
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.unit import cast_as_call
from nova.tests.unit import policy_fixture
LOG = logging.getLogger(__name__)
@ -42,7 +40,7 @@ class TestLocalDeleteAttachedVolumes(test.TestCase):
def setUp(self):
super(TestLocalDeleteAttachedVolumes, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
# We need the CinderFixture to stub out the volume API.
self.cinder = self.useFixture(
nova_fixtures.CinderFixture(self))
@ -65,7 +63,7 @@ class TestLocalDeleteAttachedVolumes(test.TestCase):
self.start_service('scheduler')
self.start_service('compute')
self.useFixture(cast_as_call.CastAsCall(self))
self.useFixture(nova_fixtures.CastAsCallFixture(self))
self.flavor_id = self.api.get_flavors()[0]['id']

3
nova/tests/functional/regressions/test_bug_1679750.py

@ -19,14 +19,13 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
class TestLocalDeleteAllocations(test.TestCase,
integrated_helpers.InstanceHelperMixin):
def setUp(self):
super(TestLocalDeleteAllocations, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
# The NeutronFixture is needed to show security groups for a server.
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(nova_fixtures.GlanceFixture(self))

3
nova/tests/functional/regressions/test_bug_1682693.py

@ -16,7 +16,6 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
class ServerTagsFilteringTest(test.TestCase,
@ -30,7 +29,7 @@ class ServerTagsFilteringTest(test.TestCase,
def setUp(self):
super(ServerTagsFilteringTest, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
# The NeutronFixture is needed to stub out validate_networks in API.
self.useFixture(nova_fixtures.NeutronFixture(self))
# Use the PlacementFixture to avoid annoying warnings in the logs.

11
nova/tests/functional/regressions/test_bug_1689692.py

@ -15,12 +15,11 @@
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import cast_as_call
from nova.tests.unit import policy_fixture
class ServerListLimitMarkerCell0Test(test.TestCase,
integrated_helpers.InstanceHelperMixin):
class ServerListLimitMarkerCell0Test(
test.TestCase, integrated_helpers.InstanceHelperMixin,
):
"""Regression test for bug 1689692 introduced in Ocata.
The user specifies a limit which is greater than the number of instances
@ -33,7 +32,7 @@ class ServerListLimitMarkerCell0Test(test.TestCase,
def setUp(self):
super(ServerListLimitMarkerCell0Test, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
# The NeutronFixture is needed to stub out validate_networks in API.
self.useFixture(nova_fixtures.NeutronFixture(self))
api_fixture = self.useFixture(nova_fixtures.OSAPIFixture(
@ -51,7 +50,7 @@ class ServerListLimitMarkerCell0Test(test.TestCase,
self.start_service('scheduler')
# We don't start the compute service because we want NoValidHost so
# all of the instances go into ERROR state and get put into cell0.
self.useFixture(cast_as_call.CastAsCall(self))
self.useFixture(nova_fixtures.CastAsCallFixture(self))
def test_list_servers_marker_in_cell0_more_limit(self):
"""Creates three servers, then lists them with a marker on the first

11
nova/tests/functional/regressions/test_bug_1702454.py

@ -14,12 +14,11 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import cast_as_call
from nova.tests.unit import policy_fixture
class SchedulerOnlyChecksTargetTest(test.TestCase,
integrated_helpers.InstanceHelperMixin):
class SchedulerOnlyChecksTargetTest(
test.TestCase, integrated_helpers.InstanceHelperMixin,
):
"""Regression test for bug 1702454 introduced in Newton.
That test is for verifying that if we evacuate by providing a target, the
@ -41,7 +40,7 @@ class SchedulerOnlyChecksTargetTest(test.TestCase,
def setUp(self):
super(SchedulerOnlyChecksTargetTest, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
# The NeutronFixture is needed to stub out validate_networks in API.
self.useFixture(nova_fixtures.NeutronFixture(self))
@ -83,7 +82,7 @@ class SchedulerOnlyChecksTargetTest(test.TestCase,
self.start_service('compute', host='host1')
self.start_service('compute', host='host2')
self.start_service('compute', host='host3')
self.useFixture(cast_as_call.CastAsCall(self))
self.useFixture(nova_fixtures.CastAsCallFixture(self))
def test_evacuate_server(self):
# We first create the instance

3
nova/tests/functional/regressions/test_bug_1713783.py

@ -22,7 +22,6 @@ from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import fake_network
from nova.tests.unit import fake_notifier
from nova.tests.unit import policy_fixture
LOG = logging.getLogger(__name__)
@ -44,7 +43,7 @@ class FailedEvacuateStateTests(test.TestCase,
def setUp(self):
super(FailedEvacuateStateTests, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(nova_fixtures.GlanceFixture(self))
self.useFixture(func_fixtures.PlacementFixture())

3
nova/tests/functional/regressions/test_bug_1718455.py

@ -17,7 +17,6 @@ from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import fake_network
from nova.tests.unit import policy_fixture
class TestLiveMigrateOneOfConcurrentlyCreatedInstances(
@ -43,7 +42,7 @@ class TestLiveMigrateOneOfConcurrentlyCreatedInstances(
def setUp(self):
super(TestLiveMigrateOneOfConcurrentlyCreatedInstances, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(nova_fixtures.GlanceFixture(self))
self.useFixture(func_fixtures.PlacementFixture())

3
nova/tests/functional/regressions/test_bug_1718512.py

@ -17,7 +17,6 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
class TestRequestSpecRetryReschedule(test.TestCase,
@ -34,7 +33,7 @@ class TestRequestSpecRetryReschedule(test.TestCase,
"""
def setUp(self):
super(TestRequestSpecRetryReschedule, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
# The NeutronFixture is needed to stub out validate_networks in API.
self.useFixture(nova_fixtures.NeutronFixture(self))

3
nova/tests/functional/regressions/test_bug_1719730.py

@ -16,7 +16,6 @@ from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import fake_network
from nova.tests.unit import policy_fixture
class TestRescheduleWithServerGroup(test.TestCase,
@ -35,7 +34,7 @@ class TestRescheduleWithServerGroup(test.TestCase,
def setUp(self):
super(TestRescheduleWithServerGroup, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
# The NeutronFixture is needed to stub out validate_networks in API.
self.useFixture(nova_fixtures.NeutronFixture(self))

3
nova/tests/functional/regressions/test_bug_1735407.py

@ -17,7 +17,6 @@ from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import fake_network
from nova.tests.unit import fake_notifier
from nova.tests.unit import policy_fixture
class TestParallelEvacuationWithServerGroup(
@ -29,7 +28,7 @@ class TestParallelEvacuationWithServerGroup(
def setUp(self):
super(TestParallelEvacuationWithServerGroup, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
# The NeutronFixture is needed to stub out validate_networks in API.
self.useFixture(nova_fixtures.NeutronFixture(self))

3
nova/tests/functional/regressions/test_bug_1741307.py

@ -14,7 +14,6 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
class TestResizeWithNoAllocationScheduler(
@ -45,7 +44,7 @@ class TestResizeWithNoAllocationScheduler(
def setUp(self):
super(TestResizeWithNoAllocationScheduler, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.GlanceFixture(self))
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(func_fixtures.PlacementFixture())

3
nova/tests/functional/regressions/test_bug_1746483.py

@ -15,7 +15,6 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
from nova import utils
CONF = config.CONF
@ -36,7 +35,7 @@ class TestBootFromVolumeIsolatedHostsFilter(
def setUp(self):
super(TestBootFromVolumeIsolatedHostsFilter, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.glance = self.useFixture(nova_fixtures.GlanceFixture(self))
self.useFixture(nova_fixtures.CinderFixture(self))

3
nova/tests/functional/regressions/test_bug_1764556.py

@ -16,7 +16,6 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
from nova import utils
@ -32,7 +31,7 @@ class InstanceListWithDeletedServicesTestCase(
"""
def setUp(self):
super(InstanceListWithDeletedServicesTestCase, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
# The NeutronFixture is needed to stub out validate_networks in API.
self.useFixture(nova_fixtures.NeutronFixture(self))

3
nova/tests/functional/regressions/test_bug_1764883.py

@ -17,7 +17,6 @@ from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import fake_network
from nova.tests.unit import fake_notifier
from nova.tests.unit import policy_fixture
class TestEvacuationWithSourceReturningDuringRebuild(
@ -32,7 +31,7 @@ class TestEvacuationWithSourceReturningDuringRebuild(
def setUp(self):
super(TestEvacuationWithSourceReturningDuringRebuild, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
# The NeutronFixture is needed to stub out validate_networks in API.
self.useFixture(nova_fixtures.NeutronFixture(self))

3
nova/tests/functional/regressions/test_bug_1780373.py

@ -14,7 +14,6 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
class TestMultiCreateServerGroupMemberOverQuota(
@ -38,7 +37,7 @@ class TestMultiCreateServerGroupMemberOverQuota(
def setUp(self):
super(TestMultiCreateServerGroupMemberOverQuota, self).setUp()
self.flags(server_group_members=2, group='quota')
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.glance = self.useFixture(nova_fixtures.GlanceFixture(self))
self.useFixture(func_fixtures.PlacementFixture())

5
nova/tests/functional/regressions/test_bug_1781286.py

@ -21,7 +21,6 @@ from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import fake_notifier
from nova.tests.unit import policy_fixture
class RescheduleBuildAvailabilityZoneUpCall(
@ -37,7 +36,7 @@ class RescheduleBuildAvailabilityZoneUpCall(
def setUp(self):
super(RescheduleBuildAvailabilityZoneUpCall, self).setUp()
# Use the standard fixtures.
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.GlanceFixture(self))
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(func_fixtures.PlacementFixture())
@ -101,7 +100,7 @@ class RescheduleMigrateAvailabilityZoneUpCall(
def setUp(self):
super(RescheduleMigrateAvailabilityZoneUpCall, self).setUp()
# Use the standard fixtures.
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.GlanceFixture(self))
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(func_fixtures.PlacementFixture())

3
nova/tests/functional/regressions/test_bug_1781710.py

@ -15,7 +15,6 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
class AntiAffinityMultiCreateRequest(test.TestCase,
@ -38,7 +37,7 @@ class AntiAffinityMultiCreateRequest(test.TestCase,
def setUp(self):
super(AntiAffinityMultiCreateRequest, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.glance = self.useFixture(nova_fixtures.GlanceFixture(self))
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(func_fixtures.PlacementFixture())

3
nova/tests/functional/regressions/test_bug_1784353.py

@ -15,7 +15,6 @@ from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import fake_network
from nova.tests.unit import policy_fixture
class TestRescheduleWithVolumesAttached(
@ -32,7 +31,7 @@ class TestRescheduleWithVolumesAttached(
# Use the new attach flow fixture for cinder
self.cinder = self.useFixture(nova_fixtures.CinderFixture(self))
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(nova_fixtures.GlanceFixture(self))

3
nova/tests/functional/regressions/test_bug_1797580.py

@ -14,7 +14,6 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
class ColdMigrateTargetHostThenLiveMigrateTest(
@ -37,7 +36,7 @@ class ColdMigrateTargetHostThenLiveMigrateTest(
def setUp(self):
super(ColdMigrateTargetHostThenLiveMigrateTest, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.glance = self.useFixture(nova_fixtures.GlanceFixture(self))
self.useFixture(func_fixtures.PlacementFixture())

3
nova/tests/functional/regressions/test_bug_1806064.py

@ -18,7 +18,6 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
class BootFromVolumeOverQuotaRaceDeleteTest(
@ -49,7 +48,7 @@ class BootFromVolumeOverQuotaRaceDeleteTest(
self.cinder_fixture = self.useFixture(
nova_fixtures.CinderFixture(self))
# Use the standard fixtures.
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(func_fixtures.PlacementFixture())
self.api = self.useFixture(nova_fixtures.OSAPIFixture(

3
nova/tests/functional/regressions/test_bug_1815153.py

@ -19,7 +19,6 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
class NonPersistentFieldNotResetTest(
@ -46,7 +45,7 @@ class NonPersistentFieldNotResetTest(
def setUp(self):
super(NonPersistentFieldNotResetTest, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(nova_fixtures.GlanceFixture(self))
self.useFixture(func_fixtures.PlacementFixture())

3
nova/tests/functional/regressions/test_bug_1835822.py

@ -15,7 +15,6 @@ from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import fake_notifier
from nova.tests.unit import policy_fixture
class RegressionTest1835822(
@ -25,7 +24,7 @@ class RegressionTest1835822(
def setUp(self):
super(RegressionTest1835822, self).setUp()
# Use the standard fixtures.
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.GlanceFixture(self))
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(func_fixtures.PlacementFixture())

3
nova/tests/functional/regressions/test_bug_1852458.py

@ -15,7 +15,6 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
from nova import utils
@ -31,7 +30,7 @@ class TestInstanceActionBuryInCell0(test.TestCase,
self.useFixture(func_fixtures.PlacementFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(nova_fixtures.GlanceFixture(self))
policy = self.useFixture(policy_fixture.RealPolicyFixture())
policy = self.useFixture(nova_fixtures.RealPolicyFixture())
# Allow non-admins to see instance action events.
policy.set_rules({
'os_compute_api:os-instance-actions:events': 'rule:admin_or_owner'

3
nova/tests/functional/regressions/test_bug_1893284.py

@ -15,7 +15,6 @@ from nova.tests import fixtures as nova_fixtures
from nova.tests.functional.api import client as api_client
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
class TestServersPerUserQuota(test.TestCase,
@ -41,7 +40,7 @@ class TestServersPerUserQuota(test.TestCase,
"""
def setUp(self):
super(TestServersPerUserQuota, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(func_fixtures.PlacementFixture())
self.glance = self.useFixture(nova_fixtures.GlanceFixture(self))

5
nova/tests/functional/regressions/test_bug_1902925.py

@ -9,8 +9,9 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import cast_as_call
class ComputeVersion5xPinnedRpcTests(integrated_helpers._IntegratedTestBase):
@ -22,7 +23,7 @@ class ComputeVersion5xPinnedRpcTests(integrated_helpers._IntegratedTestBase):
def setUp(self):
super(ComputeVersion5xPinnedRpcTests, self).setUp()
self.useFixture(cast_as_call.CastAsCall(self))
self.useFixture(nova_fixtures.CastAsCallFixture(self))
self.compute1 = self._start_compute(host='host1')

3
nova/tests/functional/regressions/test_bug_1914777.py

@ -18,7 +18,6 @@ from nova import objects
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
class TestDeleteWhileBooting(test.TestCase,
@ -43,7 +42,7 @@ class TestDeleteWhileBooting(test.TestCase,
"""
def setUp(self):
super(TestDeleteWhileBooting, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(nova_fixtures.GlanceFixture(self))

3
nova/tests/functional/test_aggregates.py

@ -18,7 +18,6 @@ from nova.tests import fixtures as nova_fixtures
from nova.tests.functional.api import client
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
from nova.tests.unit import utils as test_utils
from nova import utils
@ -933,7 +932,7 @@ class AggregateMultiTenancyIsolationColdMigrateTest(
def setUp(self):
super(AggregateMultiTenancyIsolationColdMigrateTest, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.glance = self.useFixture(nova_fixtures.GlanceFixture(self))
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(func_fixtures.PlacementFixture())

6
nova/tests/functional/test_availability_zones.py

@ -16,16 +16,16 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
class TestAvailabilityZoneScheduling(
test.TestCase, integrated_helpers.InstanceHelperMixin):
test.TestCase, integrated_helpers.InstanceHelperMixin,
):
def setUp(self):
super(TestAvailabilityZoneScheduling, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.GlanceFixture(self))
self.useFixture(nova_fixtures.NeutronFixture(self))
self.useFixture(func_fixtures.PlacementFixture())

3
nova/tests/functional/test_boot_from_volume.py

@ -19,7 +19,6 @@ from nova.tests import fixtures as nova_fixtures
from nova.tests.functional.api import client as api_client
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
class BootFromVolumeTest(integrated_helpers._IntegratedTestBase):
@ -167,7 +166,7 @@ class BootFromVolumeLargeRequestTest(test.TestCase,
def setUp(self):
super(BootFromVolumeLargeRequestTest, self).setUp()
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.NeutronFixture(self))
self.glance = self.useFixture(nova_fixtures.GlanceFixture(self))
self.useFixture(nova_fixtures.CinderFixture(self))

3
nova/tests/functional/test_compute_mgr.py

@ -18,7 +18,6 @@ from nova.network import model as network_model
from nova import objects
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.unit import cast_as_call
from nova.tests.unit import fake_network
from nova.tests.unit import fake_server_actions
@ -27,7 +26,7 @@ class ComputeManagerTestCase(test.TestCase):
def setUp(self):
super(ComputeManagerTestCase, self).setUp()
self.useFixture(nova_fixtures.SpawnIsSynchronousFixture())
self.useFixture(cast_as_call.CastAsCall(self))
self.useFixture(nova_fixtures.CastAsCallFixture(self))
self.conductor = self.start_service('conductor')
self.start_service('scheduler')
self.compute = self.start_service('compute')

3
nova/tests/functional/test_cross_az_attach.py

@ -15,7 +15,6 @@ from nova.tests import fixtures as nova_fixtures
from nova.tests.functional.api import client as api_client
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import policy_fixture
class CrossAZAttachTestCase(test.TestCase,
@ -29,7 +28,7 @@ class CrossAZAttachTestCase(test.TestCase,
def setUp(self):
super(CrossAZAttachTestCase, self).setUp()
# Use the standard fixtures.
self.useFixture(policy_fixture.RealPolicyFixture())
self.useFixture(nova_fixtures.RealPolicyFixture())
self.useFixture(nova_fixtures.CinderFixture(self, az=self.az))
self.useFixture(nova_fixtures.GlanceFixture(self))
self.useFixture(nova_fixtures.NeutronFixture(self))

5
nova/tests/functional/test_cross_cell_migrate.py

@ -31,7 +31,6 @@ from nova.scheduler import weights
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import cast_as_call
from nova.tests.unit import fake_notifier
from nova import utils
@ -1022,11 +1021,11 @@ class TestMultiCellMigrate(integrated_helpers.ProviderUsageBaseTestCase):
cell = self.cell_mappings[self.host_to_cell_mappings[target_host]]
nova_context.set_target_cell(ctxt, cell)
# Simulate not being able to query the API DB by poisoning calls to
# the instance_mappings table. Use the CastAsCall fixture so we can
# the instance_mappings table. Use CastAsCallFixture so we can
# trap and log errors for assertions in the test.
with test.nested(
osloutils_fixture.TimeFixture(future),
cast_as_call.CastAsCall(self),
nova_fixtures.CastAsCallFixture(self),
mock.patch('nova.objects.InstanceMapping.get_by_instance_uuid',
side_effect=oslo_db_exc.CantStartEngineError)
) as (

3
nova/tests/functional/test_external_networks.py

@ -18,7 +18,6 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers