diff --git a/ironic_python_agent/tests/unit/extensions/test_base.py b/ironic_python_agent/tests/unit/extensions/test_base.py index fb6c6f082..51296ea85 100644 --- a/ironic_python_agent/tests/unit/extensions/test_base.py +++ b/ironic_python_agent/tests/unit/extensions/test_base.py @@ -13,11 +13,11 @@ # limitations under the License. import mock -from oslotest import base as test_base from stevedore import extension from ironic_python_agent import errors from ironic_python_agent.extensions import base +from ironic_python_agent.tests.unit import base as test_base def _fake_validator(ext, **kwargs): @@ -60,7 +60,7 @@ class FakeAgent(base.ExecuteCommandMixin): FakeExtension())]) -class TestExecuteCommandMixin(test_base.BaseTestCase): +class TestExecuteCommandMixin(test_base.IronicAgentTest): def setUp(self): super(TestExecuteCommandMixin, self).setUp() self.agent = FakeAgent() @@ -117,7 +117,7 @@ class TestExecuteCommandMixin(test_base.BaseTestCase): self.assertEqual(exc, result.command_error) -class TestExtensionDecorators(test_base.BaseTestCase): +class TestExtensionDecorators(test_base.IronicAgentTest): def setUp(self): super(TestExtensionDecorators, self).setUp() self.agent = FakeAgent() diff --git a/ironic_python_agent/tests/unit/extensions/test_clean.py b/ironic_python_agent/tests/unit/extensions/test_clean.py index 7b9a7f536..3e510d302 100644 --- a/ironic_python_agent/tests/unit/extensions/test_clean.py +++ b/ironic_python_agent/tests/unit/extensions/test_clean.py @@ -13,14 +13,14 @@ # limitations under the License. import mock -from oslotest import base as test_base from ironic_python_agent import errors from ironic_python_agent.extensions import clean +from ironic_python_agent.tests.unit import base @mock.patch('ironic_python_agent.hardware.cache_node', autospec=True) -class TestCleanExtension(test_base.BaseTestCase): +class TestCleanExtension(base.IronicAgentTest): def setUp(self): super(TestCleanExtension, self).setUp() self.agent_extension = clean.CleanExtension() @@ -245,7 +245,7 @@ class TestCleanExtension(test_base.BaseTestCase): @mock.patch('ironic_python_agent.hardware.dispatch_to_all_managers', autospec=True) -class TestCleanVersion(test_base.BaseTestCase): +class TestCleanVersion(base.IronicAgentTest): version = {'generic': '1', 'specific': '1'} def test__get_current_clean_version(self, mock_dispatch): diff --git a/ironic_python_agent/tests/unit/extensions/test_flow.py b/ironic_python_agent/tests/unit/extensions/test_flow.py index 7e6947ae1..58801c510 100644 --- a/ironic_python_agent/tests/unit/extensions/test_flow.py +++ b/ironic_python_agent/tests/unit/extensions/test_flow.py @@ -15,13 +15,13 @@ import time import mock -from oslotest import base as test_base from stevedore import enabled from stevedore import extension from ironic_python_agent import errors from ironic_python_agent.extensions import base from ironic_python_agent.extensions import flow +from ironic_python_agent.tests.unit import base as test_base FLOW_INFO = [ @@ -45,7 +45,7 @@ class FakeExtension(base.BaseAgentExtension): time.sleep(sleep_info['time']) -class TestFlowExtension(test_base.BaseTestCase): +class TestFlowExtension(test_base.IronicAgentTest): def setUp(self): super(TestFlowExtension, self).setUp() self.agent_extension = flow.FlowExtension() diff --git a/ironic_python_agent/tests/unit/extensions/test_image.py b/ironic_python_agent/tests/unit/extensions/test_image.py index 047e97b14..04b6c1799 100644 --- a/ironic_python_agent/tests/unit/extensions/test_image.py +++ b/ironic_python_agent/tests/unit/extensions/test_image.py @@ -19,12 +19,12 @@ import tempfile import mock from oslo_concurrency import processutils -from oslotest import base as test_base from ironic_python_agent import errors from ironic_python_agent.extensions import image from ironic_python_agent.extensions import iscsi from ironic_python_agent import hardware +from ironic_python_agent.tests.unit import base from ironic_python_agent import utils @@ -32,7 +32,7 @@ from ironic_python_agent import utils @mock.patch.object(utils, 'execute', autospec=True) @mock.patch.object(tempfile, 'mkdtemp', lambda *_: '/tmp/fake-dir') @mock.patch.object(shutil, 'rmtree', lambda *_: None) -class TestImageExtension(test_base.BaseTestCase): +class TestImageExtension(base.IronicAgentTest): def setUp(self): super(TestImageExtension, self).setUp() diff --git a/ironic_python_agent/tests/unit/extensions/test_iscsi.py b/ironic_python_agent/tests/unit/extensions/test_iscsi.py index 383c6bbc5..75721f72a 100644 --- a/ironic_python_agent/tests/unit/extensions/test_iscsi.py +++ b/ironic_python_agent/tests/unit/extensions/test_iscsi.py @@ -17,11 +17,11 @@ import mock from ironic_lib import disk_utils from oslo_concurrency import processutils -from oslotest import base as test_base from ironic_python_agent import errors from ironic_python_agent.extensions import iscsi from ironic_python_agent import hardware +from ironic_python_agent.tests.unit import base from ironic_python_agent import utils @@ -35,7 +35,7 @@ class FakeAgent(object): @mock.patch.object(utils, 'execute', autospec=True) @mock.patch.object(iscsi.rtslib_fb, 'RTSRoot', mock.Mock(side_effect=iscsi.rtslib_fb.RTSLibError())) -class TestISCSIExtensionTgt(test_base.BaseTestCase): +class TestISCSIExtensionTgt(base.IronicAgentTest): def setUp(self): super(TestISCSIExtensionTgt, self).setUp() @@ -151,7 +151,7 @@ _ORIG_UTILS = iscsi.rtslib_fb.utils @mock.patch.object(hardware, 'dispatch_to_managers', autospec=True) # Don't mock the utils module, as it contains exceptions @mock.patch.object(iscsi, 'rtslib_fb', utils=_ORIG_UTILS, autospec=True) -class TestISCSIExtensionLIO(test_base.BaseTestCase): +class TestISCSIExtensionLIO(base.IronicAgentTest): def setUp(self): super(TestISCSIExtensionLIO, self).setUp() @@ -283,7 +283,7 @@ class TestISCSIExtensionLIO(test_base.BaseTestCase): @mock.patch.object(iscsi.rtslib_fb, 'RTSRoot', autospec=True) -class TestISCSIExtensionCleanUp(test_base.BaseTestCase): +class TestISCSIExtensionCleanUp(base.IronicAgentTest): def setUp(self): super(TestISCSIExtensionCleanUp, self).setUp() diff --git a/ironic_python_agent/tests/unit/extensions/test_log.py b/ironic_python_agent/tests/unit/extensions/test_log.py index 147d5d4bf..5237ee181 100644 --- a/ironic_python_agent/tests/unit/extensions/test_log.py +++ b/ironic_python_agent/tests/unit/extensions/test_log.py @@ -14,13 +14,13 @@ # under the License. import mock -from oslotest import base as test_base from ironic_python_agent.extensions import log +from ironic_python_agent.tests.unit import base from ironic_python_agent import utils -class TestLogExtension(test_base.BaseTestCase): +class TestLogExtension(base.IronicAgentTest): def setUp(self): super(TestLogExtension, self).setUp() diff --git a/ironic_python_agent/tests/unit/extensions/test_standby.py b/ironic_python_agent/tests/unit/extensions/test_standby.py index 8b404e96f..5ad718c01 100644 --- a/ironic_python_agent/tests/unit/extensions/test_standby.py +++ b/ironic_python_agent/tests/unit/extensions/test_standby.py @@ -16,10 +16,10 @@ import os import mock from oslo_concurrency import processutils -from oslotest import base as test_base from ironic_python_agent import errors from ironic_python_agent.extensions import standby +from ironic_python_agent.tests.unit import base def _build_fake_image_info(): @@ -53,7 +53,7 @@ def _build_fake_partition_image_info(): 'deploy_boot_mode': 'bios'} -class TestStandbyExtension(test_base.BaseTestCase): +class TestStandbyExtension(base.IronicAgentTest): def setUp(self): super(TestStandbyExtension, self).setUp() self.agent_extension = standby.StandbyExtension() @@ -872,7 +872,7 @@ class TestStandbyExtension(test_base.BaseTestCase): self.assertEqual(expected_msg, result_msg) -class TestImageDownload(test_base.BaseTestCase): +class TestImageDownload(base.IronicAgentTest): @mock.patch('hashlib.md5', autospec=True) @mock.patch('requests.get', autospec=True) diff --git a/ironic_python_agent/tests/unit/hardware_managers/test_cna.py b/ironic_python_agent/tests/unit/hardware_managers/test_cna.py index 06ab3836f..3b9226f3a 100644 --- a/ironic_python_agent/tests/unit/hardware_managers/test_cna.py +++ b/ironic_python_agent/tests/unit/hardware_managers/test_cna.py @@ -16,16 +16,16 @@ import os import mock from oslo_config import cfg -from oslotest import base as test_base from ironic_python_agent import hardware from ironic_python_agent.hardware_managers import cna +from ironic_python_agent.tests.unit import base from ironic_python_agent import utils CONF = cfg.CONF -class TestIntelCnaHardwareManager(test_base.BaseTestCase): +class TestIntelCnaHardwareManager(base.IronicAgentTest): def setUp(self): super(TestIntelCnaHardwareManager, self).setUp() self.hardware = cna.IntelCnaHardwareManager() diff --git a/ironic_python_agent/tests/unit/hardware_managers/test_mlnx.py b/ironic_python_agent/tests/unit/hardware_managers/test_mlnx.py index 4167ae887..2530cc3ca 100755 --- a/ironic_python_agent/tests/unit/hardware_managers/test_mlnx.py +++ b/ironic_python_agent/tests/unit/hardware_managers/test_mlnx.py @@ -15,17 +15,17 @@ import os import mock -from oslotest import base as test_base from ironic_python_agent import errors from ironic_python_agent import hardware from ironic_python_agent.hardware_managers import mlnx +from ironic_python_agent.tests.unit import base IB_ADDRESS = 'a0:00:00:27:fe:80:00:00:00:00:00:00:7c:fe:90:03:00:29:26:52' CLIENT_ID = 'ff:00:00:00:00:00:02:00:00:02:c9:00:7c:fe:90:03:00:29:26:52' -class MlnxHardwareManager(test_base.BaseTestCase): +class MlnxHardwareManager(base.IronicAgentTest): def setUp(self): super(MlnxHardwareManager, self).setUp() self.hardware = mlnx.MellanoxDeviceHardwareManager() diff --git a/ironic_python_agent/tests/unit/test_numa_inspector.py b/ironic_python_agent/tests/unit/test_numa_inspector.py index 501853f5d..0d3163403 100644 --- a/ironic_python_agent/tests/unit/test_numa_inspector.py +++ b/ironic_python_agent/tests/unit/test_numa_inspector.py @@ -16,14 +16,14 @@ import os import mock -from oslotest import base as test_base from ironic_python_agent import errors from ironic_python_agent import numa_inspector as numa_insp +from ironic_python_agent.tests.unit import base from ironic_python_agent import utils -class TestCollectNumaTopologyInfo(test_base.BaseTestCase): +class TestCollectNumaTopologyInfo(base.IronicAgentTest): def setUp(self): super(TestCollectNumaTopologyInfo, self).setUp() self.data = {} @@ -115,7 +115,7 @@ class TestCollectNumaTopologyInfo(test_base.BaseTestCase): self.assertFalse(self.failures) -class TestGetNumaTopologyInfo(test_base.BaseTestCase): +class TestGetNumaTopologyInfo(base.IronicAgentTest): def setUp(self): super(TestGetNumaTopologyInfo, self).setUp() self.data = {}