diff options
author | Ramakrishnan G <rameshg87@gmail.com> | 2015-10-08 05:58:01 +0000 |
---|---|---|
committer | Ramakrishnan G <rameshg87@gmail.com> | 2015-10-08 07:33:36 +0000 |
commit | 366e48350580301cf688bbd444600f6a7d47dd38 (patch) | |
tree | 5704e54cdcbcf7cda9068a2372a8c1fd54710523 /ironic/tests/unit/drivers/modules/test_agent_base_vendor.py | |
parent | a19e9ce6759b018025790ca91b200796f63bb7eb (diff) | |
download | ironic-366e48350580301cf688bbd444600f6a7d47dd38.tar.gz |
Add support for in-band cleaning in ISCSIDeploy
This commit adds the following methods to ISCSIDeploy
to enable in-band cleaning.
- get_clean_steps
- execute_clean_step
- prepare_cleaning
- tear_down_cleaning
It also adds the following code to prevent nodes to be
stuck at CLEANWAIT forever if bash ramdisk is used:
- Send the bash ramdisk parameters (deploy_key,
iscsi_target_iqn, etc) while booting the deploy ramdisk
for cleaning. It will enable bash ramdisk to invoke
pass_deploy_info vendor passthru.
- If node is in CLEANWAIT in pass_deploy_info vendor passthru,
then we set the clean steps for the node and ask conductor
to resume cleaning.
- We also skip validation for pass_deploy_info vendor passthru
if node is in CLEANWAIT state.
- ISCSIDeploy.get_clean_steps will return an empty list if
bash ramdisk is used. It is detected by presence of
agent_url in node's driver_internal_info.
Change-Id: Ie89ffc0bf649742a95cc02b4a54e956ae6682503
Implements: blueprint iscsi-deploy-in-band-cleaning
Diffstat (limited to 'ironic/tests/unit/drivers/modules/test_agent_base_vendor.py')
-rw-r--r-- | ironic/tests/unit/drivers/modules/test_agent_base_vendor.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ironic/tests/unit/drivers/modules/test_agent_base_vendor.py b/ironic/tests/unit/drivers/modules/test_agent_base_vendor.py index 2cf23ab3e..db260fa32 100644 --- a/ironic/tests/unit/drivers/modules/test_agent_base_vendor.py +++ b/ironic/tests/unit/drivers/modules/test_agent_base_vendor.py @@ -325,7 +325,7 @@ class TestBaseAgentVendor(db_base.DbTestCase): @mock.patch.object(objects.node.Node, 'touch_provisioning', autospec=True) @mock.patch.object(manager, 'set_node_cleaning_steps', autospec=True) @mock.patch.object(agent_base_vendor.BaseAgentVendor, - '_notify_conductor_resume_clean', autospec=True) + 'notify_conductor_resume_clean', autospec=True) def test_heartbeat_resume_clean(self, mock_notify, mock_set_steps, mock_touch): kwargs = { @@ -407,7 +407,7 @@ class TestBaseAgentVendor(db_base.DbTestCase): @mock.patch.object(agent_base_vendor.BaseAgentVendor, 'reboot_to_instance', autospec=True) @mock.patch.object(agent_base_vendor.BaseAgentVendor, - '_notify_conductor_resume_clean', autospec=True) + 'notify_conductor_resume_clean', autospec=True) def test_heartbeat_noops_maintenance_mode(self, ncrc_mock, rti_mock, cd_mock): """Ensures that heartbeat() no-ops for a maintenance node.""" @@ -685,7 +685,7 @@ class TestBaseAgentVendor(db_base.DbTestCase): self.assertEqual(states.ACTIVE, task.node.target_provision_state) @mock.patch.object(agent_base_vendor.BaseAgentVendor, - '_notify_conductor_resume_clean', autospec=True) + 'notify_conductor_resume_clean', autospec=True) @mock.patch.object(agent_client.AgentClient, 'get_commands_status', autospec=True) def test_continue_cleaning(self, status_mock, notify_mock): @@ -712,7 +712,7 @@ class TestBaseAgentVendor(db_base.DbTestCase): @mock.patch.object(agent_base_vendor, '_get_post_clean_step_hook', autospec=True) @mock.patch.object(agent_base_vendor.BaseAgentVendor, - '_notify_conductor_resume_clean', autospec=True) + 'notify_conductor_resume_clean', autospec=True) @mock.patch.object(agent_client.AgentClient, 'get_commands_status', autospec=True) def test_continue_cleaning_with_hook( @@ -739,7 +739,7 @@ class TestBaseAgentVendor(db_base.DbTestCase): notify_mock.assert_called_once_with(mock.ANY, task) @mock.patch.object(agent_base_vendor.BaseAgentVendor, - '_notify_conductor_resume_clean', autospec=True) + 'notify_conductor_resume_clean', autospec=True) @mock.patch.object(agent_base_vendor, '_get_post_clean_step_hook', autospec=True) @mock.patch.object(manager, 'cleaning_error_handler', autospec=True) @@ -772,7 +772,7 @@ class TestBaseAgentVendor(db_base.DbTestCase): self.assertFalse(notify_mock.called) @mock.patch.object(agent_base_vendor.BaseAgentVendor, - '_notify_conductor_resume_clean', autospec=True) + 'notify_conductor_resume_clean', autospec=True) @mock.patch.object(agent_client.AgentClient, 'get_commands_status', autospec=True) def test_continue_cleaning_old_command(self, status_mock, notify_mock): @@ -801,7 +801,7 @@ class TestBaseAgentVendor(db_base.DbTestCase): self.assertFalse(notify_mock.called) @mock.patch.object(agent_base_vendor.BaseAgentVendor, - '_notify_conductor_resume_clean', autospec=True) + 'notify_conductor_resume_clean', autospec=True) @mock.patch.object(agent_client.AgentClient, 'get_commands_status', autospec=True) def test_continue_cleaning_running(self, status_mock, notify_mock): @@ -835,7 +835,7 @@ class TestBaseAgentVendor(db_base.DbTestCase): @mock.patch('ironic.conductor.manager.set_node_cleaning_steps', autospec=True) @mock.patch.object(agent_base_vendor.BaseAgentVendor, - '_notify_conductor_resume_clean', autospec=True) + 'notify_conductor_resume_clean', autospec=True) @mock.patch.object(agent_client.AgentClient, 'get_commands_status', autospec=True) def test_continue_cleaning_clean_version_mismatch( |