summaryrefslogtreecommitdiff
path: root/ironic/tests/unit/drivers/modules/test_agent_base.py
diff options
context:
space:
mode:
authorDmitry Tantsur <dtantsur@protonmail.com>2021-09-02 18:30:42 +0200
committerDmitry Tantsur <dtantsur@protonmail.com>2021-09-06 16:01:10 +0200
commit75304deefb4c30cf27ab6a535233a86e889b9d79 (patch)
tree1069cd50db23c9bcadceda1d2f225a56d100986e /ironic/tests/unit/drivers/modules/test_agent_base.py
parent8ea1a438d3f8715622798e01a709ea0dfab89f58 (diff)
downloadironic-75304deefb4c30cf27ab6a535233a86e889b9d79.tar.gz
Fix in-band cleaning for ramdisk and anaconda deploy
We have implemented the cleaning prepare/tear_down, but haven't implemented fetching/running in-band clean steps. This change moves the cleaning logic from AgentDeployMixin to AgentBaseMixin, where it arguably belongs. In a follow-up patch I'm planning to reduce the number of mix-ins we currently have, but that won't be backportable. Change-Id: Ibc5610b14cea487d26191249e5c0333fdcd4b914
Diffstat (limited to 'ironic/tests/unit/drivers/modules/test_agent_base.py')
-rw-r--r--ironic/tests/unit/drivers/modules/test_agent_base.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/ironic/tests/unit/drivers/modules/test_agent_base.py b/ironic/tests/unit/drivers/modules/test_agent_base.py
index 23d45feb1..99e7166fd 100644
--- a/ironic/tests/unit/drivers/modules/test_agent_base.py
+++ b/ironic/tests/unit/drivers/modules/test_agent_base.py
@@ -48,6 +48,11 @@ DRIVER_INFO = db_utils.get_test_agent_driver_info()
DRIVER_INTERNAL_INFO = db_utils.get_test_agent_driver_internal_info()
+class FakeAgentDeploy(agent_base.AgentBaseMixin, agent_base.AgentDeployMixin,
+ fake.FakeDeploy):
+ pass
+
+
class AgentDeployMixinBaseTest(db_base.DbTestCase):
def setUp(self):
@@ -66,7 +71,7 @@ class AgentDeployMixinBaseTest(db_base.DbTestCase):
'default_%s_interface' % iface: impl}
self.config(**config_kwarg)
self.config(enabled_hardware_types=['fake-hardware'])
- self.deploy = agent_base.AgentDeployMixin()
+ self.deploy = FakeAgentDeploy()
n = {
'driver': 'fake-hardware',
'instance_info': INSTANCE_INFO,
@@ -1712,8 +1717,8 @@ class AgentDeployMixinTest(AgentDeployMixinBaseTest):
autospec=True)
@mock.patch.object(manager_utils, 'notify_conductor_resume_operation',
autospec=True)
- @mock.patch.object(agent_base.AgentDeployMixin,
- 'refresh_steps', autospec=True)
+ @mock.patch.object(agent_base.AgentBaseMixin, 'refresh_steps',
+ autospec=True)
@mock.patch.object(agent_client.AgentClient, 'get_commands_status',
autospec=True)
def _test_continue_cleaning_clean_version_mismatch(
@@ -1752,8 +1757,8 @@ class AgentDeployMixinTest(AgentDeployMixinBaseTest):
autospec=True)
@mock.patch.object(manager_utils, 'notify_conductor_resume_operation',
autospec=True)
- @mock.patch.object(agent_base.AgentDeployMixin,
- 'refresh_steps', autospec=True)
+ @mock.patch.object(agent_base.AgentBaseMixin, 'refresh_steps',
+ autospec=True)
@mock.patch.object(agent_client.AgentClient, 'get_commands_status',
autospec=True)
def test_continue_cleaning_clean_version_mismatch_fail(
@@ -1847,6 +1852,7 @@ class TestRefreshCleanSteps(AgentDeployMixinBaseTest):
def setUp(self):
super(TestRefreshCleanSteps, self).setUp()
+ self.deploy = agent_base.AgentBaseMixin()
self.node.driver_internal_info['agent_url'] = 'http://127.0.0.1:9999'
self.ports = [object_utils.create_test_port(self.context,
node_id=self.node.id)]
@@ -1984,10 +1990,6 @@ class TestRefreshCleanSteps(AgentDeployMixinBaseTest):
task.ports)
-class FakeAgentDeploy(agent_base.AgentDeployMixin, fake.FakeDeploy):
- pass
-
-
class StepMethodsTestCase(db_base.DbTestCase):
def setUp(self):