summaryrefslogtreecommitdiff
path: root/ironic/tests/unit/drivers/modules/test_agent.py
diff options
context:
space:
mode:
authorMohammed Naser <mnaser@vexxhost.com>2021-03-02 02:42:16 -0500
committerMohammed Naser <mnaser@vexxhost.com>2021-03-09 22:28:40 +0000
commit6ba1ecad17bea362f4f9ea8f1641e9d6d87bcfb8 (patch)
tree13a0fd835a060cad75ac09c78559f0db8068a09c /ironic/tests/unit/drivers/modules/test_agent.py
parentf5d9cabef23ccfebd87f33ef81062f3c3f130af3 (diff)
downloadironic-6ba1ecad17bea362f4f9ea8f1641e9d6d87bcfb8.tar.gz
Allow users to configure priority for {create,delete}_configuration
At the moment, users do not have a way to easily prioritize those cleaning steps into automatic cleaning. This patch allows the user to enable those options and prioritize them as needed for automatic cleaning. Change-Id: I3b647e39982c0a98abac7b0a7c1c60215d6db4f2
Diffstat (limited to 'ironic/tests/unit/drivers/modules/test_agent.py')
-rw-r--r--ironic/tests/unit/drivers/modules/test_agent.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/ironic/tests/unit/drivers/modules/test_agent.py b/ironic/tests/unit/drivers/modules/test_agent.py
index 56c971101..8b50b33e4 100644
--- a/ironic/tests/unit/drivers/modules/test_agent.py
+++ b/ironic/tests/unit/drivers/modules/test_agent.py
@@ -1163,15 +1163,21 @@ class TestAgentDeploy(db_base.DbTestCase):
mock_get_steps.assert_called_once_with(
task, 'clean', interface='deploy',
override_priorities={'erase_devices': None,
- 'erase_devices_metadata': None})
+ 'erase_devices_metadata': None,
+ 'delete_configuration': None,
+ 'create_configuration': None})
self.assertEqual(mock_steps, steps)
@mock.patch.object(agent_base, 'get_steps', autospec=True)
def test_get_clean_steps_config_priority(self, mock_get_steps):
# Test that we can override the priority of get clean steps
# Use 0 because it is an edge case (false-y) and used in devstack
+ # for erase_devices, and 42 for RAID cleaning steps as they are
+ # disabled by default.
self.config(erase_devices_priority=0, group='deploy')
self.config(erase_devices_metadata_priority=0, group='deploy')
+ self.config(delete_configuration_priority=42, group='deploy')
+ self.config(create_configuration_priority=42, group='deploy')
mock_steps = [{'priority': 10, 'interface': 'deploy',
'step': 'erase_devices'}]
mock_get_steps.return_value = mock_steps
@@ -1180,7 +1186,9 @@ class TestAgentDeploy(db_base.DbTestCase):
mock_get_steps.assert_called_once_with(
task, 'clean', interface='deploy',
override_priorities={'erase_devices': 0,
- 'erase_devices_metadata': 0})
+ 'erase_devices_metadata': 0,
+ 'delete_configuration': 42,
+ 'create_configuration': 42})
@mock.patch.object(deploy_utils, 'prepare_inband_cleaning', autospec=True)
def test_prepare_cleaning(self, prepare_inband_cleaning_mock):