|
|
@ -800,20 +800,20 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'change_physical_disk_state', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_job, 'wait_for_job_completion', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'commit_config', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
def _test_create_configuration( |
|
|
|
self, expected_state, mock_commit_config, |
|
|
|
mock_wait_for_job_completion, mock_change_physical_disk_state, |
|
|
|
mock_validate_job_queue, mock_list_physical_disks, |
|
|
|
self, expected_state, |
|
|
|
mock_commit_config, |
|
|
|
mock_change_physical_disk_state, |
|
|
|
mock_validate_job_queue, |
|
|
|
mock_list_physical_disks, |
|
|
|
mock__reset_raid_config, mock_get_drac_client): |
|
|
|
mock_client = mock.Mock() |
|
|
|
mock_get_drac_client.return_value = mock_client |
|
|
|
physical_disks = self._generate_physical_disks() |
|
|
|
mock_list_physical_disks.return_value = physical_disks |
|
|
|
mock_commit_config.return_value = '42' |
|
|
|
|
|
|
|
raid_controller_dict = { |
|
|
|
'id': 'RAID.Integrated.1-1', |
|
|
|
'description': 'Integrated RAID Controller 1', |
|
|
@ -831,35 +831,34 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
'is_commit_required': True} |
|
|
|
mock_change_physical_disk_state.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'conversion_results': { |
|
|
|
'RAID.Integrated.1-1': { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True}}, |
|
|
|
'commit_required_ids': ['RAID.Integrated.1-1']} |
|
|
|
mock_commit_config.side_effect = ['42', '12'] |
|
|
|
mock_client.create_virtual_disk.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True} |
|
|
|
mock_commit_config.side_effect = ['42'] |
|
|
|
next_substep = "create_virtual_disks" |
|
|
|
|
|
|
|
with task_manager.acquire(self.context, self.node.uuid, |
|
|
|
shared=False) as task: |
|
|
|
return_value = task.driver.raid.create_configuration( |
|
|
|
task, create_root_volume=True, create_nonroot_volumes=False) |
|
|
|
|
|
|
|
mock_client.create_virtual_disk.assert_called_once_with( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'1', 51200, None, 2, 1) |
|
|
|
|
|
|
|
mock_commit_config.assert_called_with( |
|
|
|
task.node, raid_controller='RAID.Integrated.1-1', reboot=False, |
|
|
|
realtime=True) |
|
|
|
|
|
|
|
self.assertEqual(expected_state, return_value) |
|
|
|
self.assertEqual(2, mock_commit_config.call_count) |
|
|
|
self.assertEqual(1, mock_client.create_virtual_disk.call_count) |
|
|
|
self.assertEqual(1, mock_change_physical_disk_state.call_count) |
|
|
|
self.assertEqual(expected_state, return_value) |
|
|
|
self.assertEqual(1, mock_commit_config.call_count) |
|
|
|
self.assertEqual(1, mock_change_physical_disk_state.call_count) |
|
|
|
|
|
|
|
self.node.refresh() |
|
|
|
self.assertEqual(['42', '12'], |
|
|
|
self.node.driver_internal_info['raid_config_job_ids']) |
|
|
|
self.node.refresh() |
|
|
|
self.assertEqual(next_substep, |
|
|
|
task.node.driver_internal_info[ |
|
|
|
'raid_config_substep']) |
|
|
|
self.assertEqual(['42'], |
|
|
|
task.node.driver_internal_info[ |
|
|
|
'raid_config_job_ids']) |
|
|
|
|
|
|
|
def test_create_configuration_in_clean(self): |
|
|
|
self._test_create_configuration(states.CLEANWAIT) |
|
|
@ -871,18 +870,84 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
|
|
|
|
@mock.patch.object(drac_common, 'get_drac_client', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, '_reset_raid_config', autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'list_physical_disks', autospec=True) |
|
|
|
@mock.patch.object(drac_job, 'validate_job_queue', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'change_physical_disk_state', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_job, 'wait_for_job_completion', spec_set=True, |
|
|
|
@mock.patch.object(drac_raid, 'commit_config', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
def test_create_configuration_without_drives_conversion( |
|
|
|
self, mock_commit_config, |
|
|
|
mock_change_physical_disk_state, |
|
|
|
mock_validate_job_queue, mock_list_physical_disks, |
|
|
|
mock__reset_raid_config, mock_get_drac_client): |
|
|
|
mock_client = mock.Mock() |
|
|
|
mock_get_drac_client.return_value = mock_client |
|
|
|
physical_disks = self._generate_physical_disks() |
|
|
|
mock_list_physical_disks.return_value = physical_disks |
|
|
|
|
|
|
|
raid_controller_dict = { |
|
|
|
'id': 'RAID.Integrated.1-1', |
|
|
|
'description': 'Integrated RAID Controller 1', |
|
|
|
'manufacturer': 'DELL', |
|
|
|
'model': 'PERC H710 Mini', |
|
|
|
'primary_status': 'ok', |
|
|
|
'firmware_version': '21.3.0-0009', |
|
|
|
'bus': '1', |
|
|
|
'supports_realtime': True} |
|
|
|
raid_controller = test_utils.make_raid_controller( |
|
|
|
raid_controller_dict) |
|
|
|
mock_client.list_raid_controllers.return_value = [raid_controller] |
|
|
|
mock__reset_raid_config.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.false, |
|
|
|
'is_commit_required': True} |
|
|
|
mock_change_physical_disk_state.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.false, |
|
|
|
'conversion_results': { |
|
|
|
'RAID.Integrated.1-1': { |
|
|
|
'is_reboot_required': constants.RebootRequired.false, |
|
|
|
'is_commit_required': False}}, |
|
|
|
'commit_required_ids': ['RAID.Integrated.1-1']} |
|
|
|
mock_client.create_virtual_disk.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True} |
|
|
|
mock_commit_config.side_effect = ['42'] |
|
|
|
next_substep = "completed" |
|
|
|
|
|
|
|
with task_manager.acquire(self.context, self.node.uuid, |
|
|
|
shared=False) as task: |
|
|
|
return_value = task.driver.raid.create_configuration( |
|
|
|
task, create_root_volume=True, create_nonroot_volumes=False) |
|
|
|
|
|
|
|
mock_commit_config.assert_called_with( |
|
|
|
task.node, raid_controller='RAID.Integrated.1-1', reboot=False, |
|
|
|
realtime=True) |
|
|
|
|
|
|
|
self.assertEqual(states.CLEANWAIT, return_value) |
|
|
|
self.assertEqual(1, mock_commit_config.call_count) |
|
|
|
self.assertEqual(1, mock_change_physical_disk_state.call_count) |
|
|
|
self.assertEqual(1, mock_client.create_virtual_disk.call_count) |
|
|
|
|
|
|
|
self.node.refresh() |
|
|
|
self.assertEqual(next_substep, |
|
|
|
task.node.driver_internal_info[ |
|
|
|
'raid_config_substep']) |
|
|
|
self.assertEqual(['42'], |
|
|
|
task.node.driver_internal_info[ |
|
|
|
'raid_config_job_ids']) |
|
|
|
|
|
|
|
@mock.patch.object(drac_common, 'get_drac_client', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'list_physical_disks', autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'change_physical_disk_state', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'commit_config', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
def test_create_configuration_no_change( |
|
|
|
self, mock_commit_config, mock_wait_for_job_completion, |
|
|
|
mock_change_physical_disk_state, mock_validate_job_queue, |
|
|
|
self, mock_commit_config, |
|
|
|
mock_change_physical_disk_state, |
|
|
|
mock_list_physical_disks, mock_get_drac_client): |
|
|
|
mock_client = mock.Mock() |
|
|
|
mock_get_drac_client.return_value = mock_client |
|
|
@ -892,9 +957,6 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'commit_required_ids': ['RAID.Integrated.1-1']} |
|
|
|
mock_commit_config.return_value = '42' |
|
|
|
mock_client.create_virtual_disk.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True} |
|
|
|
|
|
|
|
with task_manager.acquire(self.context, self.node.uuid, |
|
|
|
shared=False) as task: |
|
|
@ -917,8 +979,6 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
@mock.patch.object(drac_raid, 'list_physical_disks', autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'change_physical_disk_state', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_job, 'wait_for_job_completion', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_job, 'validate_job_queue', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'commit_config', spec_set=True, |
|
|
@ -926,7 +986,6 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
def test_create_configuration_delete_existing( |
|
|
|
self, mock_commit_config, |
|
|
|
mock_validate_job_queue, |
|
|
|
mock_wait_for_job_completion, |
|
|
|
mock_change_physical_disk_state, |
|
|
|
mock_list_physical_disks, |
|
|
|
mock_list_virtual_disks, |
|
|
@ -950,7 +1009,7 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
raid_controller = test_utils.make_raid_controller( |
|
|
|
raid_controller_dict) |
|
|
|
mock_list_physical_disks.return_value = physical_disks |
|
|
|
mock_commit_config.side_effect = ['42', '12'] |
|
|
|
mock_commit_config.side_effect = ['12'] |
|
|
|
mock_client.list_raid_controllers.return_value = [raid_controller] |
|
|
|
mock__reset_raid_config.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
@ -958,32 +1017,27 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
|
|
|
|
mock_change_physical_disk_state.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'conversion_results': { |
|
|
|
'RAID.Integrated.1-1': { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True}}, |
|
|
|
'commit_required_ids': ['RAID.Integrated.1-1']} |
|
|
|
|
|
|
|
mock_client.create_virtual_disk.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True |
|
|
|
} |
|
|
|
|
|
|
|
with task_manager.acquire(self.context, self.node.uuid, |
|
|
|
shared=False) as task: |
|
|
|
return_value = task.driver.raid.create_configuration( |
|
|
|
task, create_root_volume=True, create_nonroot_volumes=False, |
|
|
|
delete_existing=True) |
|
|
|
mock_client.create_virtual_disk.assert_called_once_with( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'1', 51200, None, 2, 1) |
|
|
|
|
|
|
|
mock_commit_config.assert_called_with( |
|
|
|
task.node, raid_controller='RAID.Integrated.1-1', |
|
|
|
realtime=True, reboot=False) |
|
|
|
|
|
|
|
self.assertEqual(2, mock_commit_config.call_count) |
|
|
|
self.assertEqual(1, mock_commit_config.call_count) |
|
|
|
|
|
|
|
self.assertEqual(states.DEPLOYWAIT, return_value) |
|
|
|
self.node.refresh() |
|
|
|
self.assertEqual(['42', '12'], |
|
|
|
self.assertEqual(['12'], |
|
|
|
self.node.driver_internal_info['raid_config_job_ids']) |
|
|
|
|
|
|
|
@mock.patch.object(drac_common, 'get_drac_client', spec_set=True, |
|
|
@ -993,14 +1047,12 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'change_physical_disk_state', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_job, 'wait_for_job_completion', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'commit_config', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
def test_create_configuration_with_nested_raid_level( |
|
|
|
self, mock_commit_config, mock_wait_for_job_completion, |
|
|
|
mock_change_physical_disk_state, mock_validate_job_queue, |
|
|
|
mock_list_physical_disks, mock_get_drac_client): |
|
|
|
self, mock_commit_config, mock_change_physical_disk_state, |
|
|
|
mock_validate_job_queue, mock_list_physical_disks, |
|
|
|
mock_get_drac_client): |
|
|
|
mock_client = mock.Mock() |
|
|
|
mock_get_drac_client.return_value = mock_client |
|
|
|
|
|
|
@ -1017,13 +1069,14 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
|
|
|
|
physical_disks = self._generate_physical_disks() |
|
|
|
mock_list_physical_disks.return_value = physical_disks |
|
|
|
mock_commit_config.side_effect = ['42', '12'] |
|
|
|
mock_commit_config.side_effect = ['42'] |
|
|
|
mock_change_physical_disk_state.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'conversion_results': { |
|
|
|
'RAID.Integrated.1-1': { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True}}, |
|
|
|
'commit_required_ids': ['RAID.Integrated.1-1']} |
|
|
|
mock_client.create_virtual_disk.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True} |
|
|
|
|
|
|
|
with task_manager.acquire(self.context, self.node.uuid, |
|
|
|
shared=False) as task: |
|
|
@ -1031,27 +1084,16 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
task, create_root_volume=True, create_nonroot_volumes=True, |
|
|
|
delete_existing=False) |
|
|
|
|
|
|
|
mock_client.create_virtual_disk.assert_called_once_with( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.3:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.4:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.5:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'5+0', 102400, None, 3, 2) |
|
|
|
|
|
|
|
# Commits to the controller |
|
|
|
mock_commit_config.assert_called_with( |
|
|
|
mock.ANY, raid_controller='RAID.Integrated.1-1', reboot=False, |
|
|
|
realtime=True) |
|
|
|
|
|
|
|
self.assertEqual(2, mock_commit_config.call_count) |
|
|
|
self.assertEqual(1, mock_client.create_virtual_disk.call_count) |
|
|
|
self.assertEqual(1, mock_commit_config.call_count) |
|
|
|
self.assertEqual(1, mock_change_physical_disk_state.call_count) |
|
|
|
|
|
|
|
self.node.refresh() |
|
|
|
self.assertEqual(['42', '12'], |
|
|
|
self.assertEqual(['42'], |
|
|
|
self.node.driver_internal_info['raid_config_job_ids']) |
|
|
|
|
|
|
|
@mock.patch.object(drac_common, 'get_drac_client', spec_set=True, |
|
|
@ -1061,14 +1103,12 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'change_physical_disk_state', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_job, 'wait_for_job_completion', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'commit_config', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
def test_create_configuration_with_nested_raid_10( |
|
|
|
self, mock_commit_config, mock_wait_for_job_completion, |
|
|
|
mock_change_physical_disk_state, mock_validate_job_queue, |
|
|
|
mock_list_physical_disks, mock_get_drac_client): |
|
|
|
self, mock_commit_config, mock_change_physical_disk_state, |
|
|
|
mock_validate_job_queue, mock_list_physical_disks, |
|
|
|
mock_get_drac_client): |
|
|
|
mock_client = mock.Mock() |
|
|
|
mock_get_drac_client.return_value = mock_client |
|
|
|
|
|
|
@ -1085,13 +1125,14 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
physical_disks = self._generate_physical_disks() |
|
|
|
mock_list_physical_disks.return_value = physical_disks |
|
|
|
|
|
|
|
mock_commit_config.side_effect = ['42', '12'] |
|
|
|
mock_commit_config.side_effect = ['42'] |
|
|
|
mock_change_physical_disk_state.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'conversion_results': { |
|
|
|
'RAID.Integrated.1-1': { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True}}, |
|
|
|
'commit_required_ids': ['RAID.Integrated.1-1']} |
|
|
|
mock_client.create_virtual_disk.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True} |
|
|
|
|
|
|
|
with task_manager.acquire(self.context, self.node.uuid, |
|
|
|
shared=False) as task: |
|
|
@ -1099,25 +1140,16 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
task, create_root_volume=True, create_nonroot_volumes=True, |
|
|
|
delete_existing=False) |
|
|
|
|
|
|
|
mock_client.create_virtual_disk.assert_called_once_with( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.3:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'1+0', 102400, None, None, None) |
|
|
|
|
|
|
|
# Commits to the controller |
|
|
|
mock_commit_config.assert_called_with( |
|
|
|
mock.ANY, raid_controller='RAID.Integrated.1-1', reboot=False, |
|
|
|
realtime=True) |
|
|
|
|
|
|
|
self.assertEqual(2, mock_commit_config.call_count) |
|
|
|
self.assertEqual(1, mock_client.create_virtual_disk.call_count) |
|
|
|
self.assertEqual(1, mock_commit_config.call_count) |
|
|
|
self.assertEqual(1, mock_change_physical_disk_state.call_count) |
|
|
|
|
|
|
|
self.node.refresh() |
|
|
|
self.assertEqual(['42', '12'], |
|
|
|
self.assertEqual(['42'], |
|
|
|
self.node.driver_internal_info['raid_config_job_ids']) |
|
|
|
|
|
|
|
@mock.patch.object(drac_common, 'get_drac_client', spec_set=True, |
|
|
@ -1127,14 +1159,12 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'change_physical_disk_state', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_job, 'wait_for_job_completion', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'commit_config', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
def test_create_configuration_with_multiple_controllers( |
|
|
|
self, mock_commit_config, mock_wait_for_job_completion, |
|
|
|
mock_change_physical_disk_state, mock_validate_job_queue, |
|
|
|
mock_list_physical_disks, mock_get_drac_client): |
|
|
|
self, mock_commit_config, mock_change_physical_disk_state, |
|
|
|
mock_validate_job_queue, mock_list_physical_disks, |
|
|
|
mock_get_drac_client): |
|
|
|
mock_client = mock.Mock() |
|
|
|
mock_get_drac_client.return_value = mock_client |
|
|
|
|
|
|
@ -1143,59 +1173,24 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
physical_disks = self._generate_physical_disks() |
|
|
|
mock_list_physical_disks.return_value = physical_disks |
|
|
|
|
|
|
|
mock_commit_config.side_effect = ['42', '12', '13', '14'] |
|
|
|
mock_commit_config.side_effect = ['42'] |
|
|
|
|
|
|
|
mock_change_physical_disk_state.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'conversion_results': { |
|
|
|
'RAID.Integrated.1-1': { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True}}, |
|
|
|
'commit_required_ids': ['RAID.Integrated.1-1']} |
|
|
|
|
|
|
|
mock_client.create_virtual_disk.side_effect = [{ |
|
|
|
'is_reboot_required': constants.RebootRequired.true, |
|
|
|
'is_commit_required': True |
|
|
|
}, { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True |
|
|
|
}, { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True |
|
|
|
}] |
|
|
|
|
|
|
|
with task_manager.acquire(self.context, self.node.uuid, |
|
|
|
shared=False) as task: |
|
|
|
task.driver.raid.create_configuration( |
|
|
|
task, create_root_volume=True, create_nonroot_volumes=True, |
|
|
|
delete_existing=False) |
|
|
|
mock_client.create_virtual_disk.assert_has_calls( |
|
|
|
[mock.call( |
|
|
|
'controller-2', |
|
|
|
['Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'1', 51200, None, 2, 1), |
|
|
|
mock.call( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.3:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.4:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'5', 102400, None, 3, 1), |
|
|
|
mock.call( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.5:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.6:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.7:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'5', 102400, None, 3, 1) |
|
|
|
], |
|
|
|
any_order=True) |
|
|
|
|
|
|
|
# Commits to both controller |
|
|
|
mock_commit_config.assert_has_calls( |
|
|
|
[mock.call(mock.ANY, raid_controller='controller-2', |
|
|
|
reboot=mock.ANY, realtime=mock.ANY), |
|
|
|
mock.call(mock.ANY, raid_controller='RAID.Integrated.1-1', |
|
|
|
reboot=mock.ANY, realtime=mock.ANY)], |
|
|
|
any_order=True) |
|
|
|
|
|
|
|
self.node.refresh() |
|
|
|
self.assertEqual(['42', '12', '13', '14'], |
|
|
|
self.assertEqual(['42'], |
|
|
|
self.node.driver_internal_info['raid_config_job_ids']) |
|
|
|
|
|
|
|
@mock.patch.object(drac_common, 'get_drac_client', spec_set=True, |
|
|
@ -1205,14 +1200,12 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'change_physical_disk_state', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_job, 'wait_for_job_completion', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'commit_config', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
def test_create_configuration_with_backing_physical_disks( |
|
|
|
self, mock_commit_config, mock_wait_for_job_completion, |
|
|
|
mock_change_physical_disk_state, mock_validate_job_queue, |
|
|
|
mock_list_physical_disks, mock_get_drac_client): |
|
|
|
self, mock_commit_config, mock_change_physical_disk_state, |
|
|
|
mock_validate_job_queue, mock_list_physical_disks, |
|
|
|
mock_get_drac_client): |
|
|
|
mock_client = mock.Mock() |
|
|
|
mock_get_drac_client.return_value = mock_client |
|
|
|
|
|
|
@ -1228,40 +1221,20 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
physical_disks = self._generate_physical_disks() |
|
|
|
mock_list_physical_disks.return_value = physical_disks |
|
|
|
|
|
|
|
mock_commit_config.side_effect = ['42', '12'] |
|
|
|
mock_commit_config.side_effect = ['42'] |
|
|
|
mock_change_physical_disk_state.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'conversion_results': { |
|
|
|
'RAID.Integrated.1-1': { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True}}, |
|
|
|
'commit_required_ids': ['RAID.Integrated.1-1']} |
|
|
|
|
|
|
|
mock_client.create_virtual_disk.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True |
|
|
|
} |
|
|
|
|
|
|
|
with task_manager.acquire(self.context, self.node.uuid, |
|
|
|
shared=False) as task: |
|
|
|
task.driver.raid.create_configuration( |
|
|
|
task, create_root_volume=True, create_nonroot_volumes=True, |
|
|
|
delete_existing=False) |
|
|
|
mock_client.create_virtual_disk.assert_has_calls( |
|
|
|
[mock.call( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.3:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.4:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'1', 51200, None, 2, 1), |
|
|
|
mock.call( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'5', 102400, None, 3, 1), |
|
|
|
mock.call( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.5:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.6:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.7:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'5', 102400, None, 3, 1)], |
|
|
|
any_order=True) |
|
|
|
|
|
|
|
# Commits to the controller |
|
|
|
mock_commit_config.assert_called_with( |
|
|
@ -1269,7 +1242,7 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
reboot=False, realtime=True) |
|
|
|
|
|
|
|
self.node.refresh() |
|
|
|
self.assertEqual(['42', '12'], |
|
|
|
self.assertEqual(['42'], |
|
|
|
self.node.driver_internal_info['raid_config_job_ids']) |
|
|
|
|
|
|
|
@mock.patch.object(drac_common, 'get_drac_client', spec_set=True, |
|
|
@ -1279,14 +1252,12 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'change_physical_disk_state', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_job, 'wait_for_job_completion', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'commit_config', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
def test_create_configuration_with_predefined_number_of_phyisical_disks( |
|
|
|
self, mock_commit_config, mock_wait_for_job_completion, |
|
|
|
mock_change_physical_disk_state, mock_validate_job_queue, |
|
|
|
mock_list_physical_disks, mock_get_drac_client): |
|
|
|
def test_create_configuration_with_predefined_number_of_physical_disks( |
|
|
|
self, mock_commit_config, mock_change_physical_disk_state, |
|
|
|
mock_validate_job_queue, mock_list_physical_disks, |
|
|
|
mock_get_drac_client): |
|
|
|
mock_client = mock.Mock() |
|
|
|
mock_get_drac_client.return_value = mock_client |
|
|
|
|
|
|
@ -1300,14 +1271,14 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
|
|
|
|
physical_disks = self._generate_physical_disks() |
|
|
|
mock_list_physical_disks.return_value = physical_disks |
|
|
|
mock_commit_config.side_effect = ['42', '12'] |
|
|
|
mock_commit_config.side_effect = ['42'] |
|
|
|
mock_change_physical_disk_state.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'conversion_results': { |
|
|
|
'RAID.Integrated.1-1': { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True}}, |
|
|
|
'commit_required_ids': ['RAID.Integrated.1-1']} |
|
|
|
mock_client.create_virtual_disk.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True |
|
|
|
} |
|
|
|
|
|
|
|
with task_manager.acquire(self.context, self.node.uuid, |
|
|
|
shared=False) as task: |
|
|
@ -1315,28 +1286,13 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
task, create_root_volume=True, create_nonroot_volumes=True, |
|
|
|
delete_existing=False) |
|
|
|
|
|
|
|
mock_client.create_virtual_disk.assert_has_calls( |
|
|
|
[mock.call( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'0', 51200, None, 3, 1), |
|
|
|
mock.call( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.3:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.4:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.5:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'5', 102400, None, 3, 1)], |
|
|
|
any_order=True) |
|
|
|
|
|
|
|
# Commits to the controller |
|
|
|
mock_commit_config.assert_called_with( |
|
|
|
mock.ANY, raid_controller='RAID.Integrated.1-1', |
|
|
|
reboot=False, realtime=True) |
|
|
|
|
|
|
|
self.node.refresh() |
|
|
|
self.assertEqual(['42', '12'], |
|
|
|
self.assertEqual(['42'], |
|
|
|
self.node.driver_internal_info['raid_config_job_ids']) |
|
|
|
|
|
|
|
@mock.patch.object(drac_common, 'get_drac_client', spec_set=True, |
|
|
@ -1346,14 +1302,12 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'change_physical_disk_state', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_job, 'wait_for_job_completion', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'commit_config', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
def test_create_configuration_with_max_size( |
|
|
|
self, mock_commit_config, mock_wait_for_job_completion, |
|
|
|
mock_change_physical_disk_state, mock_validate_job_queue, |
|
|
|
mock_list_physical_disks, mock_get_drac_client): |
|
|
|
self, mock_commit_config, mock_change_physical_disk_state, |
|
|
|
mock_validate_job_queue, mock_list_physical_disks, |
|
|
|
mock_get_drac_client): |
|
|
|
mock_client = mock.Mock() |
|
|
|
mock_get_drac_client.return_value = mock_client |
|
|
|
|
|
|
@ -1374,14 +1328,14 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
physical_disks = self._generate_physical_disks() |
|
|
|
mock_list_physical_disks.return_value = physical_disks |
|
|
|
|
|
|
|
mock_commit_config.side_effect = ['42', '12'] |
|
|
|
mock_commit_config.side_effect = ['12'] |
|
|
|
mock_change_physical_disk_state.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'conversion_results': { |
|
|
|
'RAID.Integrated.1-1': { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True}}, |
|
|
|
'commit_required_ids': ['RAID.Integrated.1-1']} |
|
|
|
mock_client.create_virtual_disk.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True |
|
|
|
} |
|
|
|
|
|
|
|
with task_manager.acquire(self.context, self.node.uuid, |
|
|
|
shared=False) as task: |
|
|
@ -1389,33 +1343,13 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
task, create_root_volume=True, create_nonroot_volumes=True, |
|
|
|
delete_existing=False) |
|
|
|
|
|
|
|
mock_client.create_virtual_disk.assert_has_calls( |
|
|
|
[mock.call( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.4:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.5:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'1', 571776, None, 2, 1), |
|
|
|
mock.call( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'5', 102400, None, 3, 1), |
|
|
|
mock.call( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.3:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.6:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.7:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'5', 102400, None, 3, 1)], |
|
|
|
any_order=True) |
|
|
|
|
|
|
|
# Commits to the controller |
|
|
|
mock_commit_config.assert_called_with( |
|
|
|
mock.ANY, raid_controller='RAID.Integrated.1-1', reboot=False, |
|
|
|
realtime=True) |
|
|
|
|
|
|
|
self.node.refresh() |
|
|
|
self.assertEqual(['42', '12'], |
|
|
|
self.assertEqual(['12'], |
|
|
|
self.node.driver_internal_info['raid_config_job_ids']) |
|
|
|
|
|
|
|
@mock.patch.object(drac_common, 'get_drac_client', spec_set=True, |
|
|
@ -1454,14 +1388,12 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'change_physical_disk_state', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_job, 'wait_for_job_completion', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'commit_config', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
def test_create_configuration_with_share_physical_disks( |
|
|
|
self, mock_commit_config, mock_wait_for_job_completion, |
|
|
|
mock_change_physical_disk_state, mock_validate_job_queue, |
|
|
|
mock_list_physical_disks, mock_get_drac_client): |
|
|
|
self, mock_commit_config, mock_change_physical_disk_state, |
|
|
|
mock_validate_job_queue, mock_list_physical_disks, |
|
|
|
mock_get_drac_client): |
|
|
|
mock_client = mock.Mock() |
|
|
|
mock_get_drac_client.return_value = mock_client |
|
|
|
|
|
|
@ -1476,14 +1408,14 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
physical_disks = self._generate_physical_disks() |
|
|
|
mock_list_physical_disks.return_value = physical_disks |
|
|
|
|
|
|
|
mock_commit_config.side_effect = ['42', '12'] |
|
|
|
mock_commit_config.side_effect = ['42'] |
|
|
|
mock_change_physical_disk_state.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'conversion_results': { |
|
|
|
'RAID.Integrated.1-1': { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True}}, |
|
|
|
'commit_required_ids': ['RAID.Integrated.1-1']} |
|
|
|
mock_client.create_virtual_disk.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True |
|
|
|
} |
|
|
|
|
|
|
|
with task_manager.acquire(self.context, self.node.uuid, |
|
|
|
shared=False) as task: |
|
|
@ -1491,27 +1423,13 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
task, create_root_volume=True, create_nonroot_volumes=True, |
|
|
|
delete_existing=False) |
|
|
|
|
|
|
|
mock_client.create_virtual_disk.assert_has_calls( |
|
|
|
[mock.call( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'5', 102400, None, 3, 1), |
|
|
|
mock.call( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'5', 102400, None, 3, 1)]) |
|
|
|
|
|
|
|
# Commits to the controller |
|
|
|
mock_commit_config.assert_called_with( |
|
|
|
mock.ANY, raid_controller='RAID.Integrated.1-1', reboot=False, |
|
|
|
realtime=True) |
|
|
|
|
|
|
|
self.node.refresh() |
|
|
|
self.assertEqual(['42', '12'], |
|
|
|
self.assertEqual(['42'], |
|
|
|
self.node.driver_internal_info['raid_config_job_ids']) |
|
|
|
|
|
|
|
@mock.patch.object(drac_common, 'get_drac_client', spec_set=True, |
|
|
@ -1552,9 +1470,6 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
raid_controller_dict) |
|
|
|
mock_client.list_raid_controllers.return_value = [raid_controller] |
|
|
|
mock_commit_config.return_value = '42' |
|
|
|
mock_client.create_virtual_disk.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True} |
|
|
|
|
|
|
|
with task_manager.acquire(self.context, self.node.uuid, |
|
|
|
shared=False) as task: |
|
|
@ -1570,14 +1485,12 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'change_physical_disk_state', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_job, 'wait_for_job_completion', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'commit_config', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
def test_create_configuration_with_max_size_and_share_physical_disks( |
|
|
|
self, mock_commit_config, mock_wait_for_job_completion, |
|
|
|
mock_change_physical_disk_state, mock_validate_job_queue, |
|
|
|
mock_list_physical_disks, mock_get_drac_client): |
|
|
|
self, mock_commit_config, mock_change_physical_disk_state, |
|
|
|
mock_validate_job_queue, mock_list_physical_disks, |
|
|
|
mock_get_drac_client): |
|
|
|
mock_client = mock.Mock() |
|
|
|
mock_get_drac_client.return_value = mock_client |
|
|
|
|
|
|
@ -1597,14 +1510,14 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
physical_disks = self._generate_physical_disks() |
|
|
|
mock_list_physical_disks.return_value = physical_disks |
|
|
|
|
|
|
|
mock_commit_config.side_effect = ['42', '12'] |
|
|
|
mock_commit_config.side_effect = ['42'] |
|
|
|
mock_change_physical_disk_state.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'conversion_results': { |
|
|
|
'RAID.Integrated.1-1': { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True}}, |
|
|
|
'commit_required_ids': ['RAID.Integrated.1-1']} |
|
|
|
mock_client.create_virtual_disk.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True |
|
|
|
} |
|
|
|
|
|
|
|
with task_manager.acquire(self.context, self.node.uuid, |
|
|
|
shared=False) as task: |
|
|
@ -1612,29 +1525,14 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
task, create_root_volume=True, create_nonroot_volumes=True, |
|
|
|
delete_existing=False) |
|
|
|
|
|
|
|
mock_client.create_virtual_disk.assert_has_calls( |
|
|
|
[mock.call( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'5', 1041152, None, 3, 1), |
|
|
|
mock.call( |
|
|
|
'RAID.Integrated.1-1', |
|
|
|
['Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1', |
|
|
|
'Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1'], |
|
|
|
'5', 102400, None, 3, 1)], |
|
|
|
any_order=True) |
|
|
|
|
|
|
|
# Commits to the controller |
|
|
|
mock_commit_config.assert_called_with( |
|
|
|
mock.ANY, raid_controller='RAID.Integrated.1-1', reboot=False, |
|
|
|
realtime=True) |
|
|
|
|
|
|
|
self.node.refresh() |
|
|
|
self.assertEqual(['42', '12'], |
|
|
|
self.node.driver_internal_info['raid_config_job_ids']) |
|
|
|
self.assertEqual(['42'], self.node.driver_internal_info[ |
|
|
|
'raid_config_job_ids']) |
|
|
|
|
|
|
|
@mock.patch.object(drac_common, 'get_drac_client', spec_set=True, |
|
|
|
autospec=True) |
|
|
@ -1671,9 +1569,6 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
mock_list_physical_disks.return_value = physical_disks |
|
|
|
|
|
|
|
mock_commit_config.return_value = '42' |
|
|
|
mock_client.create_virtual_disk.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True} |
|
|
|
|
|
|
|
with task_manager.acquire(self.context, self.node.uuid, |
|
|
|
shared=False) as task: |
|
|
@ -1691,10 +1586,8 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'commit_config', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'create_virtual_disk', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
def test_create_configuration_fails_if_not_enough_space( |
|
|
|
self, mock_create_virtual_disk, mock_commit_config, |
|
|
|
self, mock_commit_config, |
|
|
|
mock_validate_job_queue, mock_list_physical_disks, |
|
|
|
mock__reset_raid_config, mock_get_drac_client): |
|
|
|
mock_client = mock.Mock() |
|
|
@ -1729,9 +1622,6 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
'is_commit_required': True} |
|
|
|
|
|
|
|
mock_commit_config.return_value = '42' |
|
|
|
mock_create_virtual_disk.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True} |
|
|
|
|
|
|
|
with task_manager.acquire(self.context, self.node.uuid, |
|
|
|
shared=False) as task: |
|
|
@ -1749,10 +1639,8 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'commit_config', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
@mock.patch.object(drac_raid, 'create_virtual_disk', spec_set=True, |
|
|
|
autospec=True) |
|
|
|
def test_create_configuration_fails_if_disk_already_reserved( |
|
|
|
self, mock_create_virtual_disk, mock_commit_config, |
|
|
|
self, mock_commit_config, |
|
|
|
mock_validate_job_queue, mock_list_physical_disks, |
|
|
|
mock__reset_raid_config, mock_get_drac_client): |
|
|
|
mock_client = mock.Mock() |
|
|
@ -1791,10 +1679,6 @@ class DracRaidInterfaceTestCase(test_utils.BaseDracTest): |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True} |
|
|
|
|
|
|
|
mock_create_virtual_disk.return_value = { |
|
|
|
'is_reboot_required': constants.RebootRequired.optional, |
|
|
|
'is_commit_required': True} |
|
|
|
|
|
|
|
with task_manager.acquire(self.context, self.node.uuid, |
|
|
|
shared=False) as task: |
|
|
|
self.assertRaises( |
|
|
|