def test__validate_user_clean_steps_no_steps(self, mock_steps): node = obj_utils.create_test_node(self.context) mock_steps.return_value = self.clean_steps with task_manager.acquire(self.context, node.uuid) as task: conductor_steps._validate_user_clean_steps(task, []) mock_steps.assert_called_once_with(task, enabled=False, sort=False)
def test__validate_user_clean_steps_no_steps(self, mock_steps): node = obj_utils.create_test_node(self.context) mock_steps.return_value = self.clean_steps with task_manager.acquire(self.context, node.uuid) as task: conductor_steps._validate_user_clean_steps(task, []) mock_steps.assert_called_once_with(task, enabled=False, sort=False)
def test__validate_user_clean_steps(self, mock_steps): node = obj_utils.create_test_node(self.context) mock_steps.return_value = self.clean_steps user_steps = [{ 'step': 'update_firmware', 'interface': 'power' }, { 'step': 'erase_disks', 'interface': 'deploy' }] with task_manager.acquire(self.context, node.uuid) as task: result = conductor_steps._validate_user_clean_steps( task, user_steps) mock_steps.assert_called_once_with(task, enabled=False, sort=False) expected = [{ 'step': 'update_firmware', 'interface': 'power', 'priority': 10, 'abortable': False }, { 'step': 'erase_disks', 'interface': 'deploy', 'priority': 20, 'abortable': True }] self.assertEqual(expected, result)
def test__validate_user_clean_steps(self, mock_steps): node = obj_utils.create_test_node(self.context) mock_steps.return_value = self.clean_steps user_steps = [{'step': 'update_firmware', 'interface': 'power'}, {'step': 'erase_disks', 'interface': 'deploy'}] with task_manager.acquire(self.context, node.uuid) as task: result = conductor_steps._validate_user_clean_steps(task, user_steps) mock_steps.assert_called_once_with(task, enabled=False, sort=False) expected = [{'step': 'update_firmware', 'interface': 'power', 'priority': 10, 'abortable': False}, {'step': 'erase_disks', 'interface': 'deploy', 'priority': 20, 'abortable': True}] self.assertEqual(expected, result)