diff options
author | Davanum Srinivas <davanum@gmail.com> | 2015-06-17 17:19:49 -0400 |
---|---|---|
committer | Davanum Srinivas (dims) <davanum@gmail.com> | 2015-07-11 02:54:42 +0000 |
commit | 79b280479c864d7c0f16e6b9fffd30662f2394c6 (patch) | |
tree | 7a3a2083cbea322c679f6cdcddd1af8da1f51f77 /nova/tests/unit | |
parent | a0923fc4e27f10f3c1da2a6d0a544ac84a535a7a (diff) | |
download | nova-79b280479c864d7c0f16e6b9fffd30662f2394c6.tar.gz |
Switch to oslo.service library
Modules eventlet_backdoor, loopingcall, periodic_task,
service, sslutils, systemd, threadgroup were removed
from nova. These modules were imported from oslo.service
library.
Co-Authored-By: Marian Horban <mhorban@mirantis.com>
Depends-On: I305cf53bad6213c151395e93d656b53a8a28e1db
Change-Id: Iaef67e16af3d69f845742f7bdcb43667bf1576ee
Diffstat (limited to 'nova/tests/unit')
-rw-r--r-- | nova/tests/unit/image/test_glance.py | 4 | ||||
-rw-r--r-- | nova/tests/unit/test_service.py | 8 | ||||
-rw-r--r-- | nova/tests/unit/virt/ironic/test_driver.py | 2 | ||||
-rw-r--r-- | nova/tests/unit/virt/libvirt/test_driver.py | 4 |
4 files changed, 11 insertions, 7 deletions
diff --git a/nova/tests/unit/image/test_glance.py b/nova/tests/unit/image/test_glance.py index 8d7e75631f..62e752fa59 100644 --- a/nova/tests/unit/image/test_glance.py +++ b/nova/tests/unit/image/test_glance.py @@ -417,8 +417,10 @@ class TestGlanceClientWrapper(test.NoDBTestCase): ) sleep_mock.assert_called_once_with(1) + @mock.patch('oslo_service.sslutils.is_enabled') @mock.patch('glanceclient.Client') - def test_create_glance_client_with_ssl(self, client_mock): + def test_create_glance_client_with_ssl(self, client_mock, + ssl_enable_mock): self.flags(ca_file='foo.cert', cert_file='bar.cert', key_file='wut.key', group='ssl') ctxt = mock.sentinel.ctx diff --git a/nova/tests/unit/test_service.py b/nova/tests/unit/test_service.py index e970380cd2..c3f53617b8 100644 --- a/nova/tests/unit/test_service.py +++ b/nova/tests/unit/test_service.py @@ -24,12 +24,12 @@ import mock from mox3 import mox from oslo_concurrency import processutils from oslo_config import cfg +from oslo_service import service as _service import testtools from nova import exception from nova import manager from nova import objects -from nova.openstack.common import service as _service from nova import rpc from nova import service from nova import test @@ -341,14 +341,16 @@ class TestLauncher(test.NoDBTestCase): def test_launch_app(self, mock_launch): service._launcher = None service.serve(mock.sentinel.service) - mock_launch.assert_called_once_with(mock.sentinel.service, + mock_launch.assert_called_once_with(mock.ANY, + mock.sentinel.service, workers=None) @mock.patch.object(_service, 'launch') def test_launch_app_with_workers(self, mock_launch): service._launcher = None service.serve(mock.sentinel.service, workers=mock.sentinel.workers) - mock_launch.assert_called_once_with(mock.sentinel.service, + mock_launch.assert_called_once_with(mock.ANY, + mock.sentinel.service, workers=mock.sentinel.workers) @mock.patch.object(_service, 'launch') diff --git a/nova/tests/unit/virt/ironic/test_driver.py b/nova/tests/unit/virt/ironic/test_driver.py index 28882f54a5..7cf41d721f 100644 --- a/nova/tests/unit/virt/ironic/test_driver.py +++ b/nova/tests/unit/virt/ironic/test_driver.py @@ -19,6 +19,7 @@ from ironicclient import exc as ironic_exception import mock from oslo_config import cfg from oslo_serialization import jsonutils +from oslo_service import loopingcall from oslo_utils import uuidutils import six @@ -29,7 +30,6 @@ from nova.compute import vm_states from nova import context as nova_context from nova import exception from nova import objects -from nova.openstack.common import loopingcall from nova import test from nova.tests.unit import fake_instance from nova.tests.unit import utils diff --git a/nova/tests/unit/virt/libvirt/test_driver.py b/nova/tests/unit/virt/libvirt/test_driver.py index 81884ddb05..3d2b2164f3 100644 --- a/nova/tests/unit/virt/libvirt/test_driver.py +++ b/nova/tests/unit/virt/libvirt/test_driver.py @@ -37,6 +37,7 @@ from oslo_concurrency import lockutils from oslo_concurrency import processutils from oslo_config import cfg from oslo_serialization import jsonutils +from oslo_service import loopingcall from oslo_utils import encodeutils from oslo_utils import importutils from oslo_utils import timeutils @@ -59,7 +60,6 @@ from nova import exception from nova.network import model as network_model from nova import objects from nova.openstack.common import fileutils -from nova.openstack.common import loopingcall from nova.pci import manager as pci_manager from nova import test from nova.tests.unit import fake_block_device @@ -8144,7 +8144,7 @@ class LibvirtConnTestCase(test.NoDBTestCase): block_device_info) @mock.patch('nova.openstack.common.fileutils.ensure_tree') - @mock.patch('nova.openstack.common.loopingcall.FixedIntervalLoopingCall') + @mock.patch('oslo_service.loopingcall.FixedIntervalLoopingCall') @mock.patch('nova.pci.manager.get_instance_pci_devs') @mock.patch('nova.virt.libvirt.LibvirtDriver._prepare_pci_devices_for_use') @mock.patch('nova.virt.libvirt.LibvirtDriver._create_domain_and_network') |