Пример #1
0
    def setUp(self):
        super(DracManagementInternalMethodsTestCase, self).setUp()
        mgr_utils.mock_the_extension_manager(driver='fake_drac')
        self.node = obj_utils.create_test_node(self.context,
                                               driver='fake_drac',
                                               driver_info=INFO_DICT)

        self.boot_device_pxe = {
            'id': 'BIOS.Setup.1-1#BootSeq#NIC.Embedded.1-1-1',
            'boot_mode': 'IPL',
            'current_assigned_sequence': 0,
            'pending_assigned_sequence': 0,
            'bios_boot_string': 'Embedded NIC 1 Port 1 Partition 1'
        }
        self.boot_device_disk = {
            'id': 'BIOS.Setup.1-1#BootSeq#HardDisk.List.1-1',
            'boot_mode': 'IPL',
            'current_assigned_sequence': 1,
            'pending_assigned_sequence': 1,
            'bios_boot_string': 'Hard drive C: BootSeq'
        }
        self.ipl_boot_devices = [
            test_utils.dict_to_namedtuple(values=self.boot_device_pxe),
            test_utils.dict_to_namedtuple(values=self.boot_device_disk)
        ]
        self.boot_devices = {
            'IPL': self.ipl_boot_devices,
            'OneTime': self.ipl_boot_devices
        }
Пример #2
0
    def test_set_boot_device_called_with_no_change(self,
                                                   mock_validate_job_queue,
                                                   mock__get_boot_device,
                                                   mock_get_drac_client):
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.list_boot_modes.return_value = [
            test_utils.dict_to_namedtuple(values=self.boot_mode_ipl),
            test_utils.dict_to_namedtuple(values=self.boot_mode_one_time)
        ]
        mock_client.list_boot_devices.return_value = {
            'IPL': [
                test_utils.dict_to_namedtuple(values=self.boot_device_pxe),
                test_utils.dict_to_namedtuple(values=self.boot_device_disk)
            ]
        }
        boot_device = {
            'boot_device': ironic.common.boot_devices.PXE,
            'persistent': True
        }
        mock__get_boot_device.return_value = boot_device

        boot_device = drac_mgmt.set_boot_device(self.node,
                                                ironic.common.boot_devices.PXE,
                                                persistent=True)

        mock_validate_job_queue.assert_called_once_with(self.node)
        self.assertEqual(0, mock_client.change_boot_device_order.call_count)
        self.assertEqual(0, mock_client.commit_pending_bios_changes.call_count)
Пример #3
0
    def test__check_node_raid_jobs_with_failed_job(self, mock_get_drac_client):
        # mock node.driver_internal_info
        driver_internal_info = {'raid_config_job_ids': ['42']}
        self.node.driver_internal_info = driver_internal_info
        self.node.save()
        # mock task
        task = mock.Mock(node=self.node, context=self.context)
        # mock dracclient.get_job
        self.job['state'] = 'Failed'
        self.job['message'] = 'boom'
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.get_job.return_value = test_utils.dict_to_namedtuple(
            values=self.job)
        # mock dracclient.list_virtual_disks
        mock_client.list_virtual_disks.return_value = [
            test_utils.dict_to_namedtuple(values=self.virtual_disk)]

        self.driver.raid._check_node_raid_jobs(task)

        mock_client.get_job.assert_called_once_with('42')
        self.assertEqual(0, mock_client.list_virtual_disks.call_count)
        self.node.refresh()
        self.assertEqual([],
                         self.node.driver_internal_info['raid_config_job_ids'])
        self.assertEqual({}, self.node.raid_config)
        task.process_event.assert_called_once_with('fail')
Пример #4
0
    def test_set_boot_device(self, mock_validate_job_queue,
                             mock__get_boot_device, mock_get_drac_client):
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.list_boot_modes.return_value = [
            test_utils.dict_to_namedtuple(values=self.boot_mode_ipl),
            test_utils.dict_to_namedtuple(values=self.boot_mode_one_time)
        ]
        mock_client.list_boot_devices.return_value = {
            'IPL': [
                test_utils.dict_to_namedtuple(values=self.boot_device_pxe),
                test_utils.dict_to_namedtuple(values=self.boot_device_disk)
            ]
        }
        boot_device = {
            'boot_device': ironic.common.boot_devices.DISK,
            'persistent': True
        }
        mock__get_boot_device.return_value = boot_device

        boot_device = drac_mgmt.set_boot_device(self.node,
                                                ironic.common.boot_devices.PXE,
                                                persistent=False)

        mock_validate_job_queue.assert_called_once_with(self.node)
        mock_client.change_boot_device_order.assert_called_once_with(
            'OneTime', 'BIOS.Setup.1-1#BootSeq#NIC.Embedded.1-1-1')
        mock_client.commit_pending_bios_changes.assert_called_once_with()
Пример #5
0
    def test__check_node_raid_jobs_with_failed_job(self, mock_get_drac_client):
        # mock node.driver_internal_info
        driver_internal_info = {'raid_config_job_ids': ['42']}
        self.node.driver_internal_info = driver_internal_info
        self.node.save()
        # mock task
        task = mock.Mock(node=self.node, context=self.context)
        # mock dracclient.get_job
        self.job['state'] = 'Failed'
        self.job['message'] = 'boom'
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.get_job.return_value = test_utils.dict_to_namedtuple(
            values=self.job)
        # mock dracclient.list_virtual_disks
        mock_client.list_virtual_disks.return_value = [
            test_utils.dict_to_namedtuple(values=self.virtual_disk)
        ]

        self.driver.raid._check_node_raid_jobs(task)

        mock_client.get_job.assert_called_once_with('42')
        self.assertEqual(0, mock_client.list_virtual_disks.call_count)
        self.node.refresh()
        self.assertEqual([],
                         self.node.driver_internal_info['raid_config_job_ids'])
        self.assertEqual({}, self.node.raid_config)
        task.process_event.assert_called_once_with('fail')
Пример #6
0
    def setUp(self):
        super(DracManagementInternalMethodsTestCase, self).setUp()
        self.node = obj_utils.create_test_node(self.context,
                                               driver='idrac',
                                               driver_info=INFO_DICT)

        boot_device_ipl_pxe = {
            'id': 'BIOS.Setup.1-1#BootSeq#NIC.Embedded.1-1-1',
            'boot_mode': 'IPL',
            'current_assigned_sequence': 0,
            'pending_assigned_sequence': 0,
            'bios_boot_string': 'Embedded NIC 1 Port 1 Partition 1'
        }
        boot_device_ipl_disk = {
            'id': 'BIOS.Setup.1-1#BootSeq#HardDisk.List.1-1',
            'boot_mode': 'IPL',
            'current_assigned_sequence': 1,
            'pending_assigned_sequence': 1,
            'bios_boot_string': 'Hard drive C: BootSeq'
        }
        ipl_boot_device_namedtuples = [
            test_utils.dict_to_namedtuple(values=boot_device_ipl_pxe),
            test_utils.dict_to_namedtuple(values=boot_device_ipl_disk)
        ]
        ipl_boot_devices = {
            'IPL': ipl_boot_device_namedtuples,
            'OneTime': ipl_boot_device_namedtuples
        }

        boot_device_uefi_pxe = {
            'id': 'UEFI:BIOS.Setup.1-1#UefiBootSeq#NIC.PxeDevice.1-1',
            'boot_mode': 'UEFI',
            'current_assigned_sequence': 0,
            'pending_assigned_sequence': 0,
            'bios_boot_string':
            'PXE Device 1: Integrated NIC 1 Port 1 Partition 1'
        }
        uefi_boot_device_namedtuples = [
            test_utils.dict_to_namedtuple(values=boot_device_uefi_pxe)
        ]
        uefi_boot_devices = {
            'UEFI': uefi_boot_device_namedtuples,
            'OneTime': uefi_boot_device_namedtuples
        }

        self.boot_devices = {
            'IPL': ipl_boot_devices,
            'UEFI': uefi_boot_devices
        }
Пример #7
0
    def _test__check_node_raid_jobs_with_completed_job_already_failed(
            self, mock_notify_conductor_resume,
            mock_get_logical_disks, mock_get_drac_client):
        expected_logical_disk = {'size_gb': 558,
                                 'raid_level': '1',
                                 'name': 'disk 0'}
        # mock node.driver_internal_info
        driver_internal_info = {'raid_config_job_ids': ['42'],
                                'raid_config_job_failure': True}
        self.node.driver_internal_info = driver_internal_info
        self.node.save()
        # mock task
        task = mock.Mock(node=self.node, context=self.context)
        # mock dracclient.get_job
        self.job['status'] = 'Completed'
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.get_job.return_value = test_utils.dict_to_namedtuple(
            values=self.job)
        # mock driver.raid.get_logical_disks
        mock_get_logical_disks.return_value = {
            'logical_disks': [expected_logical_disk]
        }

        self.raid._check_node_raid_jobs(task)

        mock_client.get_job.assert_called_once_with('42')
        self.node.refresh()
        self.assertEqual([],
                         self.node.driver_internal_info['raid_config_job_ids'])
        self.assertNotIn('raid_config_job_failure',
                         self.node.driver_internal_info)
        self.assertNotIn('logical_disks', self.node.raid_config)
        task.process_event.assert_called_once_with('fail')
        self.assertFalse(mock_notify_conductor_resume.called)
Пример #8
0
    def setUp(self):
        super(DracBIOSConfigurationTestCase, self).setUp()
        mgr_utils.mock_the_extension_manager(driver='fake_drac')
        self.node = obj_utils.create_test_node(self.context,
                                               driver='fake_drac',
                                               driver_info=INFO_DICT)

        patch_get_drac_client = mock.patch.object(drac_common,
                                                  'get_drac_client',
                                                  spec_set=True,
                                                  autospec=True)
        mock_get_drac_client = patch_get_drac_client.start()
        self.mock_client = mock.Mock()
        mock_get_drac_client.return_value = self.mock_client
        self.addCleanup(patch_get_drac_client.stop)

        proc_virt_attr = {
            'name': 'ProcVirtualization',
            'current_value': 'Enabled',
            'pending_value': None,
            'read_only': False,
            'possible_values': ['Enabled', 'Disabled']
        }
        self.bios_attrs = {
            'ProcVirtualization':
            test_utils.dict_to_namedtuple(values=proc_virt_attr)
        }
Пример #9
0
    def test__check_node_raid_jobs_with_completed_job(
            self, mock_notify_conductor_resume_clean, mock_get_logical_disks,
            mock_get_drac_client):
        expected_logical_disk = {
            'size_gb': 558,
            'raid_level': '1',
            'name': 'disk 0'
        }
        # mock node.driver_internal_info
        driver_internal_info = {'raid_config_job_ids': ['42']}
        self.node.driver_internal_info = driver_internal_info
        self.node.save()
        # mock task
        task = mock.Mock(node=self.node, context=self.context)
        # mock dracclient.get_job
        self.job['state'] = 'Completed'
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.get_job.return_value = test_utils.dict_to_namedtuple(
            values=self.job)
        # mock driver.raid.get_logical_disks
        mock_get_logical_disks.return_value = {
            'logical_disks': [expected_logical_disk]
        }

        self.driver.raid._check_node_raid_jobs(task)

        mock_client.get_job.assert_called_once_with('42')
        self.node.refresh()
        self.assertEqual([],
                         self.node.driver_internal_info['raid_config_job_ids'])
        self.assertEqual([expected_logical_disk],
                         self.node.raid_config['logical_disks'])
        mock_notify_conductor_resume_clean.assert_called_once_with(task)
Пример #10
0
    def test__check_node_raid_jobs_with_multiple_jobs_completed(
            self, mock_notify_conductor_resume_clean,
            mock_get_logical_disks, mock_get_drac_client):
        expected_logical_disk = {'size_gb': 558,
                                 'raid_level': '1',
                                 'name': 'disk 0'}
        # mock node.driver_internal_info
        driver_internal_info = {'raid_config_job_ids': ['42', '36']}
        self.node.driver_internal_info = driver_internal_info
        self.node.save()
        # mock task
        task = mock.Mock(node=self.node, context=self.context)
        # mock dracclient.get_job
        self.job['state'] = 'Completed'
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.get_job.return_value = test_utils.dict_to_namedtuple(
            values=self.job)
        # mock driver.raid.get_logical_disks
        mock_get_logical_disks.return_value = {
            'logical_disks': [expected_logical_disk]
        }

        self.driver.raid._check_node_raid_jobs(task)

        mock_client.get_job.assert_has_calls([mock.call('42'),
                                              mock.call('36')])
        self.node.refresh()
        self.assertEqual([],
                         self.node.driver_internal_info['raid_config_job_ids'])
        self.assertNotIn('raid_config_job_failure',
                         self.node.driver_internal_info)
        self.assertEqual([expected_logical_disk],
                         self.node.raid_config['logical_disks'])
        mock_notify_conductor_resume_clean.assert_called_once_with(task)
Пример #11
0
    def test__get_boot_device(self, mock_get_drac_client):
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.list_boot_modes.return_value = [
            test_utils.dict_to_namedtuple(values=self.boot_mode_ipl),
            test_utils.dict_to_namedtuple(values=self.boot_mode_one_time)]
        mock_client.list_boot_devices.return_value = {
            'IPL': [test_utils.dict_to_namedtuple(values=self.boot_device_pxe),
                    test_utils.dict_to_namedtuple(
                        values=self.boot_device_disk)]}

        boot_device = drac_mgmt._get_boot_device(self.node)

        expected_boot_device = {'boot_device': 'pxe', 'persistent': True}
        self.assertEqual(expected_boot_device, boot_device)
        mock_client.list_boot_modes.assert_called_once_with()
        mock_client.list_boot_devices.assert_called_once_with()
Пример #12
0
    def _test__check_node_raid_jobs_with_multiple_jobs_failed(
            self, mock_notify_conductor_resume,
            mock_get_logical_disks, mock_get_drac_client,
            mock_cleaning_error_handler, mock_deploying_error_handler):
        expected_logical_disk = {'size_gb': 558,
                                 'raid_level': '1',
                                 'name': 'disk 0'}
        # mock node.driver_internal_info
        driver_internal_info = {'raid_config_job_ids': ['42', '36']}
        self.node.driver_internal_info = driver_internal_info
        self.node.save()
        # mock task
        task = mock.Mock(node=self.node, context=self.context)
        # mock dracclient.get_job
        self.job['status'] = 'Completed'
        failed_job = self.job.copy()
        failed_job['status'] = 'Failed'
        failed_job['message'] = 'boom'
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.get_job.side_effect = [
            test_utils.dict_to_namedtuple(values=failed_job),
            test_utils.dict_to_namedtuple(values=self.job)]
        # mock driver.raid.get_logical_disks
        mock_get_logical_disks.return_value = {
            'logical_disks': [expected_logical_disk]
        }

        self.raid._check_node_raid_jobs(task)

        mock_client.get_job.assert_has_calls([mock.call('42'),
                                              mock.call('36')])
        self.node.refresh()
        self.assertEqual([],
                         self.node.driver_internal_info['raid_config_job_ids'])
        self.assertNotIn('raid_config_job_failure',
                         self.node.driver_internal_info)
        self.assertNotIn('logical_disks', self.node.raid_config)
        if self.node.clean_step:
            mock_cleaning_error_handler.assert_called_once_with(task, mock.ANY)
        else:
            mock_deploying_error_handler.assert_called_once_with(task,
                                                                 mock.ANY,
                                                                 mock.ANY)
        self.assertFalse(mock_notify_conductor_resume.called)
Пример #13
0
 def boot_modes(self, *next_modes):
     modes = [
         {'id': 'IPL', 'name': 'BootSeq',
          'is_current': True, 'is_next': False},
         {'id': 'OneTime', 'name': 'OneTimeBootMode',
          'is_current': False, 'is_next': False}]
     for mode in modes:
         if mode['id'] in next_modes:
             mode['is_next'] = True
     return [test_utils.dict_to_namedtuple(values=mode) for mode in modes]
Пример #14
0
 def boot_modes(self, *next_modes):
     modes = [
         {'id': 'IPL', 'name': 'BootSeq',
          'is_current': True, 'is_next': False},
         {'id': 'OneTime', 'name': 'OneTimeBootMode',
          'is_current': False, 'is_next': False}]
     for mode in modes:
         if mode['id'] in next_modes:
             mode['is_next'] = True
     return [test_utils.dict_to_namedtuple(values=mode) for mode in modes]
Пример #15
0
    def test__get_boot_device(self, mock_get_drac_client):
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.list_boot_modes.return_value = [
            test_utils.dict_to_namedtuple(values=self.boot_mode_ipl),
            test_utils.dict_to_namedtuple(values=self.boot_mode_one_time)
        ]
        mock_client.list_boot_devices.return_value = {
            'IPL': [
                test_utils.dict_to_namedtuple(values=self.boot_device_pxe),
                test_utils.dict_to_namedtuple(values=self.boot_device_disk)
            ]
        }

        boot_device = drac_mgmt._get_boot_device(self.node)

        expected_boot_device = {'boot_device': 'pxe', 'persistent': True}
        self.assertEqual(expected_boot_device, boot_device)
        mock_client.list_boot_modes.assert_called_once_with()
        mock_client.list_boot_devices.assert_called_once_with()
Пример #16
0
    def test_set_boot_device_called_with_no_drac_boot_device(
            self, mock_list_unfinished_jobs, mock__get_boot_device,
            mock__get_next_persistent_boot_mode,
            mock__is_boot_order_flexibly_programmable,
            mock__flexibly_program_boot_order, mock_get_drac_client):
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.list_boot_devices.return_value = self.boot_devices['UEFI']
        mock_list_unfinished_jobs.return_value = []

        mock_job = mock.Mock()
        mock_job.status = "Scheduled"
        mock_client.get_job.return_value = mock_job
        boot_device = {
            'boot_device': ironic.common.boot_devices.PXE,
            'persistent': False
        }
        mock__get_boot_device.return_value = boot_device
        mock__get_next_persistent_boot_mode.return_value = 'UEFI'
        settings = [
            {
                'name': 'BootMode',
                'instance_id': 'BIOS.Setup.1-1:BootMode',
                'current_value': 'Uefi',
                'pending_value': None,
                'read_only': False,
                'possible_values': ['Bios', 'Uefi']
            },
        ]
        bios_settings = {
            s['name']: test_utils.dict_to_namedtuple(values=s)
            for s in settings
        }
        mock_client.list_bios_settings.return_value = bios_settings
        mock__is_boot_order_flexibly_programmable.return_value = True
        flexibly_program_settings = {
            'SetBootOrderFqdd1': '*.*.*',
            'SetBootOrderFqdd2': 'NIC.*.*',
            'SetBootOrderFqdd3': 'Optical.*.*',
            'SetBootOrderFqdd4': 'Floppy.*.*',
        }
        mock__flexibly_program_boot_order.return_value = \
            flexibly_program_settings

        drac_mgmt.set_boot_device(self.node,
                                  ironic.common.boot_devices.DISK,
                                  persistent=True)

        mock_list_unfinished_jobs.assert_called_once_with(self.node)
        self.assertEqual(0, mock_client.change_boot_device_order.call_count)
        mock_client.set_bios_settings.assert_called_once_with(
            flexibly_program_settings)
        mock_client.commit_pending_bios_changes.assert_called_once_with()
Пример #17
0
    def test_set_boot_device_called_with_no_change(
            self, mock_validate_job_queue, mock__get_boot_device,
            mock_get_drac_client):
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.list_boot_modes.return_value = [
            test_utils.dict_to_namedtuple(values=self.boot_mode_ipl),
            test_utils.dict_to_namedtuple(values=self.boot_mode_one_time)]
        mock_client.list_boot_devices.return_value = {
            'IPL': [test_utils.dict_to_namedtuple(values=self.boot_device_pxe),
                    test_utils.dict_to_namedtuple(
                        values=self.boot_device_disk)]}
        boot_device = {'boot_device': ironic.common.boot_devices.PXE,
                       'persistent': True}
        mock__get_boot_device.return_value = boot_device

        boot_device = drac_mgmt.set_boot_device(
            self.node, ironic.common.boot_devices.PXE, persistent=True)

        mock_validate_job_queue.assert_called_once_with(self.node)
        self.assertEqual(0, mock_client.change_boot_device_order.call_count)
        self.assertEqual(0, mock_client.commit_pending_bios_changes.call_count)
Пример #18
0
    def test_set_boot_device(self, mock_validate_job_queue,
                             mock__get_boot_device, mock_get_drac_client):
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.list_boot_modes.return_value = [
            test_utils.dict_to_namedtuple(values=self.boot_mode_ipl),
            test_utils.dict_to_namedtuple(values=self.boot_mode_one_time)]
        mock_client.list_boot_devices.return_value = {
            'IPL': [test_utils.dict_to_namedtuple(values=self.boot_device_pxe),
                    test_utils.dict_to_namedtuple(
                        values=self.boot_device_disk)]}
        boot_device = {'boot_device': ironic.common.boot_devices.DISK,
                       'persistent': True}
        mock__get_boot_device.return_value = boot_device

        boot_device = drac_mgmt.set_boot_device(
            self.node, ironic.common.boot_devices.PXE, persistent=False)

        mock_validate_job_queue.assert_called_once_with(self.node)
        mock_client.change_boot_device_order.assert_called_once_with(
            'OneTime', 'BIOS.Setup.1-1#BootSeq#NIC.Embedded.1-1-1')
        mock_client.commit_pending_bios_changes.assert_called_once_with()
Пример #19
0
    def setUp(self):
        super(DracManagementInternalMethodsTestCase, self).setUp()
        self.node = obj_utils.create_test_node(self.context,
                                               driver='idrac',
                                               driver_info=INFO_DICT)

        boot_device_ipl_pxe = {
            'id': 'BIOS.Setup.1-1#BootSeq#NIC.Embedded.1-1-1',
            'boot_mode': 'IPL',
            'current_assigned_sequence': 0,
            'pending_assigned_sequence': 0,
            'bios_boot_string': 'Embedded NIC 1 Port 1 Partition 1'}
        boot_device_ipl_disk = {
            'id': 'BIOS.Setup.1-1#BootSeq#HardDisk.List.1-1',
            'boot_mode': 'IPL',
            'current_assigned_sequence': 1,
            'pending_assigned_sequence': 1,
            'bios_boot_string': 'Hard drive C: BootSeq'}
        ipl_boot_device_namedtuples = [
            test_utils.dict_to_namedtuple(values=boot_device_ipl_pxe),
            test_utils.dict_to_namedtuple(values=boot_device_ipl_disk)]
        ipl_boot_devices = {'IPL': ipl_boot_device_namedtuples,
                            'OneTime': ipl_boot_device_namedtuples}

        boot_device_uefi_pxe = {
            'id': 'UEFI:BIOS.Setup.1-1#UefiBootSeq#NIC.PxeDevice.1-1',
            'boot_mode': 'UEFI',
            'current_assigned_sequence': 0,
            'pending_assigned_sequence': 0,
            'bios_boot_string':
                'PXE Device 1: Integrated NIC 1 Port 1 Partition 1'}
        uefi_boot_device_namedtuples = [
            test_utils.dict_to_namedtuple(values=boot_device_uefi_pxe)]
        uefi_boot_devices = {'UEFI': uefi_boot_device_namedtuples,
                             'OneTime': uefi_boot_device_namedtuples}

        self.boot_devices = {'IPL': ipl_boot_devices,
                             'UEFI': uefi_boot_devices}
Пример #20
0
 def setUp(self):
     super(DracJobTestCase, self).setUp()
     self.node = obj_utils.create_test_node(self.context,
                                            driver='idrac',
                                            driver_info=INFO_DICT)
     self.job_dict = {
         'id': 'JID_001436912645',
         'name': 'ConfigBIOS:BIOS.Setup.1-1',
         'start_time': '00000101000000',
         'until_time': 'TIME_NA',
         'message': 'Job in progress',
         'state': 'Running',
         'percent_complete': 34}
     self.job = test_utils.dict_to_namedtuple(values=self.job_dict)
Пример #21
0
    def test_inspect_hardware_no_supported_gpu(self, mock_port_create,
                                               mock_get_drac_client):
        controllers = [{
            'id': 'Video.Embedded.1-1',
            'description': 'Integrated Matrox G200eW3 Graphics Controller',
            'function_number': 0,
            'manufacturer': 'Matrox Electronics Systems Ltd.',
            'pci_device_id': '0536',
            'pci_vendor_id': '102B',
            'pci_subdevice_id': '0737',
            'pci_subvendor_id': '1028'
        }, {
            'id': 'Video.Slot.7-1',
            'description': 'GV100 [TITAN V]',
            'function_number': 0,
            'manufacturer': 'NVIDIA Corporation',
            'pci_device_id': '1D81',
            'pci_vendor_id': '10DE',
            'pci_subdevice_id': '1214',
            'pci_subvendor_id': '10DE'
        }]

        expected_node_properties = {
            'memory_mb': 32768,
            'local_gb': 279,
            'cpus': 18,
            'cpu_arch': 'x86_64',
            'capabilities': 'boot_mode:uefi,pci_gpu_devices:0'
        }
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.list_memory.return_value = self.memory
        mock_client.list_cpus.return_value = self.cpus
        mock_client.list_virtual_disks.return_value = []
        mock_client.list_physical_disks.return_value = self.physical_disks
        mock_client.list_nics.return_value = self.nics
        mock_client.list_bios_settings.return_value = self.uefi_boot_settings
        video_controllers = [
            test_utils.dict_to_namedtuple(values=vc) for vc in controllers
        ]
        mock_client.list_video_controllers.return_value = video_controllers

        with task_manager.acquire(self.context, self.node.uuid,
                                  shared=True) as task:
            return_value = task.driver.inspect.inspect_hardware(task)

        self.node.refresh()
        self.assertEqual(expected_node_properties, self.node.properties)
        self.assertEqual(states.MANAGEABLE, return_value)
        self.assertEqual(2, mock_port_create.call_count)
Пример #22
0
    def test_inspect_hardware_multiple_supported_gpu(self, mock_port_create,
                                                     mock_get_drac_client):
        controllers = [{
            'id': 'Video.Slot.7-1',
            'description': 'TU104GL [Tesla T4]',
            'function_number': 0,
            'manufacturer': 'NVIDIA Corporation',
            'pci_device_id': '1EB8',
            'pci_vendor_id': '10DE',
            'pci_subdevice_id': '12A2',
            'pci_subvendor_id': '10DE'
        }, {
            'id': 'Video.Slot.8-1',
            'description': 'GV100GL [Tesla V100 PCIe 16GB]',
            'function_number': 0,
            'manufacturer': 'NVIDIA Corporation',
            'pci_device_id': '1DB4',
            'pci_vendor_id': '10DE',
            'pci_subdevice_id': '1214',
            'pci_subvendor_id': '10DE'
        }]

        expected_node_properties = {
            'memory_mb': 32768,
            'local_gb': 279,
            'cpus': 18,
            'cpu_arch': 'x86_64',
            'capabilities': 'boot_mode:uefi,pci_gpu_devices:2'
        }
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.list_memory.return_value = self.memory
        mock_client.list_cpus.return_value = self.cpus
        mock_client.list_virtual_disks.return_value = []
        mock_client.list_physical_disks.return_value = self.physical_disks
        mock_client.list_nics.return_value = self.nics
        mock_client.list_bios_settings.return_value = self.uefi_boot_settings
        video_controllers = [
            test_utils.dict_to_namedtuple(values=vc) for vc in controllers
        ]
        mock_client.list_video_controllers.return_value = video_controllers

        with task_manager.acquire(self.context, self.node.uuid,
                                  shared=True) as task:
            return_value = task.driver.inspect.inspect_hardware(task)

        self.node.refresh()
        self.assertEqual(expected_node_properties, self.node.properties)
        self.assertEqual(states.MANAGEABLE, return_value)
        self.assertEqual(2, mock_port_create.call_count)
Пример #23
0
 def setUp(self):
     super(DracJobTestCase, self).setUp()
     mgr_utils.mock_the_extension_manager(driver='fake_drac')
     self.node = obj_utils.create_test_node(self.context,
                                            driver='fake_drac',
                                            driver_info=INFO_DICT)
     self.job_dict = {
         'id': 'JID_001436912645',
         'name': 'ConfigBIOS:BIOS.Setup.1-1',
         'start_time': '00000101000000',
         'until_time': 'TIME_NA',
         'message': 'Job in progress',
         'state': 'Running',
         'percent_complete': 34}
     self.job = test_utils.dict_to_namedtuple(values=self.job_dict)
Пример #24
0
    def setUp(self):
        super(DracManagementInternalMethodsTestCase, self).setUp()
        mgr_utils.mock_the_extension_manager(driver='fake_drac')
        self.node = obj_utils.create_test_node(self.context,
                                               driver='fake_drac',
                                               driver_info=INFO_DICT)

        self.boot_device_pxe = {
            'id': 'BIOS.Setup.1-1#BootSeq#NIC.Embedded.1-1-1',
            'boot_mode': 'IPL',
            'current_assigned_sequence': 0,
            'pending_assigned_sequence': 0,
            'bios_boot_string': 'Embedded NIC 1 Port 1 Partition 1'}
        self.boot_device_disk = {
            'id': 'BIOS.Setup.1-1#BootSeq#HardDisk.List.1-1',
            'boot_mode': 'IPL',
            'current_assigned_sequence': 1,
            'pending_assigned_sequence': 1,
            'bios_boot_string': 'Hard drive C: BootSeq'}
        self.ipl_boot_devices = [
            test_utils.dict_to_namedtuple(values=self.boot_device_pxe),
            test_utils.dict_to_namedtuple(values=self.boot_device_disk)]
        self.boot_devices = {'IPL': self.ipl_boot_devices,
                             'OneTime': self.ipl_boot_devices}
Пример #25
0
    def test_set_boot_device_called_with_no_drac_boot_device(
            self, mock_validate_job_queue, mock__get_boot_device,
            mock__get_next_persistent_boot_mode,
            mock__is_boot_order_flexibly_programmable,
            mock__flexibly_program_boot_order,
            mock_get_drac_client):
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.list_boot_devices.return_value = self.boot_devices['UEFI']
        boot_device = {'boot_device': ironic.common.boot_devices.PXE,
                       'persistent': False}
        mock__get_boot_device.return_value = boot_device
        mock__get_next_persistent_boot_mode.return_value = 'UEFI'
        settings = [
            {
                'name': 'BootMode',
                'instance_id': 'BIOS.Setup.1-1:BootMode',
                'current_value': 'Uefi',
                'pending_value': None,
                'read_only': False,
                'possible_values': ['Bios', 'Uefi']
            },
        ]
        bios_settings = {
            s['name']: test_utils.dict_to_namedtuple(
                values=s) for s in settings}
        mock_client.list_bios_settings.return_value = bios_settings
        mock__is_boot_order_flexibly_programmable.return_value = True
        flexibly_program_settings = {
            'SetBootOrderFqdd1': '*.*.*',
            'SetBootOrderFqdd2': 'NIC.*.*',
            'SetBootOrderFqdd3': 'Optical.*.*',
            'SetBootOrderFqdd4': 'Floppy.*.*',
        }
        mock__flexibly_program_boot_order.return_value = \
            flexibly_program_settings

        drac_mgmt.set_boot_device(self.node, ironic.common.boot_devices.DISK,
                                  persistent=True)

        mock_validate_job_queue.assert_called_once_with(self.node)
        self.assertEqual(0, mock_client.change_boot_device_order.call_count)
        mock_client.set_bios_settings.assert_called_once_with(
            flexibly_program_settings)
        mock_client.commit_pending_bios_changes.assert_called_once_with()
Пример #26
0
    def init_system_mock(self, system_mock, **properties):
        system_mock.reset()
        system_mock.boot.mode = 'uefi'
        system_mock.bios.attributes = {
            'PxeDev1EnDis': 'Enabled',
            'PxeDev2EnDis': 'Disabled',
            'PxeDev3EnDis': 'Disabled',
            'PxeDev4EnDis': 'Disabled',
            'PxeDev1Interface': 'NIC.Integrated.1-1-1',
            'PxeDev2Interface': None,
            'PxeDev3Interface': None,
            'PxeDev4Interface': None
        }

        system_mock.memory_summary.size_gib = 2

        system_mock.processors.summary = '8', 'MIPS'

        system_mock.simple_storage.disks_sizes_bytes = (1 * units.Gi,
                                                        units.Gi * 3,
                                                        units.Gi * 5)
        system_mock.storage.volumes_sizes_bytes = (2 * units.Gi, units.Gi * 4,
                                                   units.Gi * 6)

        system_mock.ethernet_interfaces.summary = {
            '00:11:22:33:44:55': sushy.STATE_ENABLED,
            '24:6E:96:70:49:00': sushy.STATE_DISABLED
        }
        member_data = [{
            'description': 'Integrated NIC 1 Port 1 Partition 1',
            'name': 'System Ethernet Interface',
            'full_duplex': False,
            'identity': 'NIC.Integrated.1-1-1',
            'mac_address': '24:6E:96:70:49:00',
            'mtu_size': None,
            'speed_mbps': 0,
            'vlan': None
        }]
        system_mock.ethernet_interfaces.get_members.return_value = [
            test_utils.dict_to_namedtuple(values=interface)
            for interface in member_data
        ]
        return system_mock
Пример #27
0
    def test_set_boot_device_called_with_unknown_boot_mode(
            self, mock_list_unfinished_jobs, mock__get_boot_device,
            mock__get_next_persistent_boot_mode,
            mock__is_boot_order_flexibly_programmable, mock_get_drac_client):
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client

        mock_client.list_boot_devices.return_value = self.boot_devices['UEFI']
        boot_device = {
            'boot_device': ironic.common.boot_devices.PXE,
            'persistent': False
        }
        mock__get_boot_device.return_value = boot_device
        mock__get_next_persistent_boot_mode.return_value = 'UEFI'
        settings = [
            {
                'name': 'BootMode',
                'instance_id': 'BIOS.Setup.1-1:BootMode',
                'current_value': 'Bad',
                'pending_value': None,
                'read_only': False,
                'possible_values': ['Bios', 'Uefi', 'Bad']
            },
        ]
        bios_settings = {
            s['name']: test_utils.dict_to_namedtuple(values=s)
            for s in settings
        }
        mock_client.list_bios_settings.return_value = bios_settings
        mock__is_boot_order_flexibly_programmable.return_value = True
        mock_list_unfinished_jobs.return_value = []
        self.assertRaises(exception.DracOperationError,
                          drac_mgmt.set_boot_device,
                          self.node,
                          ironic.common.boot_devices.DISK,
                          persistent=True)
        mock_list_unfinished_jobs.assert_called_once_with(self.node)
        self.assertEqual(0, mock_client.change_boot_device_order.call_count)
        self.assertEqual(0, mock_client.set_bios_settings.call_count)
        self.assertEqual(0, mock_client.commit_pending_bios_changes.call_count)
Пример #28
0
    def test__check_node_raid_jobs_without_update(self, mock_get_drac_client):
        # mock node.driver_internal_info
        driver_internal_info = {'raid_config_job_ids': ['42']}
        self.node.driver_internal_info = driver_internal_info
        self.node.save()
        # mock task
        task = mock.Mock(node=self.node)
        # mock dracclient.get_job
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.get_job.return_value = test_utils.dict_to_namedtuple(
            values=self.job)

        self.driver.raid._check_node_raid_jobs(task)

        mock_client.get_job.assert_called_once_with('42')
        self.assertEqual(0, mock_client.list_virtual_disks.call_count)
        self.node.refresh()
        self.assertEqual(['42'],
                         self.node.driver_internal_info['raid_config_job_ids'])
        self.assertEqual({}, self.node.raid_config)
        self.assertIs(False, self.node.maintenance)
Пример #29
0
    def test__check_node_raid_jobs_without_update(self, mock_get_drac_client):
        # mock node.driver_internal_info
        driver_internal_info = {'raid_config_job_ids': ['42']}
        self.node.driver_internal_info = driver_internal_info
        self.node.save()
        # mock task
        task = mock.Mock(node=self.node)
        # mock dracclient.get_job
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.get_job.return_value = test_utils.dict_to_namedtuple(
            values=self.job)

        self.driver.raid._check_node_raid_jobs(task)

        mock_client.get_job.assert_called_once_with('42')
        self.assertEqual(0, mock_client.list_virtual_disks.call_count)
        self.node.refresh()
        self.assertEqual(['42'],
                         self.node.driver_internal_info['raid_config_job_ids'])
        self.assertEqual({}, self.node.raid_config)
        self.assertEqual(False, self.node.maintenance)
Пример #30
0
    def test_set_boot_device_called_with_unknown_boot_mode(
            self, mock_validate_job_queue, mock__get_boot_device,
            mock__get_next_persistent_boot_mode,
            mock__is_boot_order_flexibly_programmable,
            mock_get_drac_client):
        mock_client = mock.Mock()
        mock_get_drac_client.return_value = mock_client
        mock_client.list_boot_devices.return_value = self.boot_devices['UEFI']
        boot_device = {'boot_device': ironic.common.boot_devices.PXE,
                       'persistent': False}
        mock__get_boot_device.return_value = boot_device
        mock__get_next_persistent_boot_mode.return_value = 'UEFI'
        settings = [
            {
                'name': 'BootMode',
                'instance_id': 'BIOS.Setup.1-1:BootMode',
                'current_value': 'Bad',
                'pending_value': None,
                'read_only': False,
                'possible_values': ['Bios', 'Uefi', 'Bad']
            },
        ]
        bios_settings = {
            s['name']: test_utils.dict_to_namedtuple(
                values=s) for s in settings}
        mock_client.list_bios_settings.return_value = bios_settings
        mock__is_boot_order_flexibly_programmable.return_value = True

        self.assertRaises(exception.DracOperationError,
                          drac_mgmt.set_boot_device, self.node,
                          ironic.common.boot_devices.DISK, persistent=True)

        mock_validate_job_queue.assert_called_once_with(self.node)
        self.assertEqual(0, mock_client.change_boot_device_order.call_count)
        self.assertEqual(0, mock_client.set_bios_settings.call_count)
        self.assertEqual(0, mock_client.commit_pending_bios_changes.call_count)
Пример #31
0
    def setUp(self):
        super(DracInspectionTestCase, self).setUp()
        self.node = obj_utils.create_test_node(self.context,
                                               driver='idrac',
                                               driver_info=INFO_DICT)
        memory = [{
            'id': 'DIMM.Socket.A1',
            'size_mb': 16384,
            'speed': 2133,
            'manufacturer': 'Samsung',
            'model': 'DDR4 DIMM',
            'state': 'ok'
        }, {
            'id': 'DIMM.Socket.B1',
            'size_mb': 16384,
            'speed': 2133,
            'manufacturer': 'Samsung',
            'model': 'DDR4 DIMM',
            'state': 'ok'
        }]
        cpus = [{
            'id': 'CPU.Socket.1',
            'cores': 6,
            'speed': 2400,
            'model': 'Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz',
            'state': 'ok',
            'ht_enabled': True,
            'turbo_enabled': True,
            'vt_enabled': True,
            'arch64': True
        }, {
            'id': 'CPU.Socket.2',
            'cores': 6,
            'speed': 2400,
            'model': 'Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz',
            'state': 'ok',
            'ht_enabled': False,
            'turbo_enabled': True,
            'vt_enabled': True,
            'arch64': True
        }]
        virtual_disks = [{
            'id': 'Disk.Virtual.0:RAID.Integrated.1-1',
            'name': 'disk 0',
            'description': 'Virtual Disk 0 on Integrated RAID Controller 1',
            'controller': 'RAID.Integrated.1-1',
            'raid_level': '1',
            'size_mb': 1143552,
            'state': 'ok',
            'raid_state': 'online',
            'span_depth': 1,
            'span_length': 2,
            'pending_operations': None
        }]
        physical_disks = [{
            'id':
            'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1',
            'description': ('Disk 1 in Backplane 1 of '
                            'Integrated RAID Controller 1'),
            'controller':
            'RAID.Integrated.1-1',
            'manufacturer':
            'SEAGATE',
            'model':
            'ST600MM0006',
            'media_type':
            'hdd',
            'interface_type':
            'sas',
            'size_mb':
            571776,
            'free_size_mb':
            571776,
            'serial_number':
            'S0M3EY2Z',
            'firmware_version':
            'LS0A',
            'state':
            'ok',
            'raid_state':
            'ready'
        }, {
            'id':
            'Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1',
            'description': ('Disk 1 in Backplane 1 of '
                            'Integrated RAID Controller 1'),
            'controller':
            'RAID.Integrated.1-1',
            'manufacturer':
            'SEAGATE',
            'model':
            'ST600MM0006',
            'media_type':
            'hdd',
            'interface_type':
            'sas',
            'size_mb':
            285888,
            'free_size_mb':
            285888,
            'serial_number':
            'S0M3EY2Z',
            'firmware_version':
            'LS0A',
            'state':
            'ok',
            'raid_state':
            'ready'
        }]
        nics = [{
            'id': 'NIC.Embedded.1-1-1',
            'mac': 'B0:83:FE:C6:6F:A1',
            'model': 'Broadcom Gigabit Ethernet BCM5720 - B0:83:FE:C6:6F:A1',
            'speed': '1000 Mbps',
            'duplex': 'full duplex',
            'media_type': 'Base T'
        }, {
            'id': 'NIC.Embedded.2-1-1',
            'mac': 'B0:83:FE:C6:6F:A2',
            'model': 'Broadcom Gigabit Ethernet BCM5720 - B0:83:FE:C6:6F:A2',
            'speed': '1000 Mbps',
            'duplex': 'full duplex',
            'media_type': 'Base T'
        }]
        bios_boot_settings = {'BootMode': {'current_value': 'Bios'}}
        uefi_boot_settings = {
            'BootMode': {
                'current_value': 'Uefi'
            },
            'PxeDev1EnDis': {
                'current_value': 'Enabled'
            },
            'PxeDev2EnDis': {
                'current_value': 'Disabled'
            },
            'PxeDev3EnDis': {
                'current_value': 'Disabled'
            },
            'PxeDev4EnDis': {
                'current_value': 'Disabled'
            },
            'PxeDev1Interface': {
                'current_value': 'NIC.Embedded.1-1-1'
            },
            'PxeDev2Interface': None,
            'PxeDev3Interface': None,
            'PxeDev4Interface': None
        }
        nic_settings = {
            'LegacyBootProto': {
                'current_value': 'PXE'
            },
            'FQDD': 'NIC.Embedded.1-1-1'
        }

        self.memory = [test_utils.dict_to_namedtuple(values=m) for m in memory]
        self.cpus = [test_utils.dict_to_namedtuple(values=c) for c in cpus]
        self.virtual_disks = [
            test_utils.dict_to_namedtuple(values=vd) for vd in virtual_disks
        ]
        self.physical_disks = [
            test_utils.dict_to_namedtuple(values=pd) for pd in physical_disks
        ]
        self.nics = [test_utils.dict_to_namedtuple(values=n) for n in nics]
        self.bios_boot_settings = test_utils.dict_of_object(bios_boot_settings)
        self.uefi_boot_settings = test_utils.dict_of_object(uefi_boot_settings)
        self.nic_settings = test_utils.dict_of_object(nic_settings)
Пример #32
0
    def setUp(self):
        super(DracInspectionTestCase, self).setUp()
        self.node = obj_utils.create_test_node(self.context,
                                               driver='idrac',
                                               driver_info=INFO_DICT)
        memory = [{'id': 'DIMM.Socket.A1',
                   'size_mb': 16384,
                   'speed': 2133,
                   'manufacturer': 'Samsung',
                   'model': 'DDR4 DIMM',
                   'state': 'ok'},
                  {'id': 'DIMM.Socket.B1',
                   'size_mb': 16384,
                   'speed': 2133,
                   'manufacturer': 'Samsung',
                   'model': 'DDR4 DIMM',
                   'state': 'ok'}]
        cpus = [{'id': 'CPU.Socket.1',
                 'cores': 6,
                 'speed': 2400,
                 'model': 'Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz',
                 'state': 'ok',
                 'ht_enabled': True,
                 'turbo_enabled': True,
                 'vt_enabled': True,
                 'arch64': True},
                {'id': 'CPU.Socket.2',
                 'cores': 6,
                 'speed': 2400,
                 'model': 'Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz',
                 'state': 'ok',
                 'ht_enabled': False,
                 'turbo_enabled': True,
                 'vt_enabled': True,
                 'arch64': True}]
        virtual_disks = [
            {'id': 'Disk.Virtual.0:RAID.Integrated.1-1',
             'name': 'disk 0',
             'description': 'Virtual Disk 0 on Integrated RAID Controller 1',
             'controller': 'RAID.Integrated.1-1',
             'raid_level': '1',
             'size_mb': 1143552,
             'state': 'ok',
             'raid_state': 'online',
             'span_depth': 1,
             'span_length': 2,
             'pending_operations': None}]
        physical_disks = [
            {'id': 'Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1',
             'description': ('Disk 1 in Backplane 1 of '
                             'Integrated RAID Controller 1'),
             'controller': 'RAID.Integrated.1-1',
             'manufacturer': 'SEAGATE',
             'model': 'ST600MM0006',
             'media_type': 'hdd',
             'interface_type': 'sas',
             'size_mb': 571776,
             'free_size_mb': 571776,
             'serial_number': 'S0M3EY2Z',
             'firmware_version': 'LS0A',
             'state': 'ok',
             'raid_state': 'ready'},
            {'id': 'Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1',
             'description': ('Disk 1 in Backplane 1 of '
                             'Integrated RAID Controller 1'),
             'controller': 'RAID.Integrated.1-1',
             'manufacturer': 'SEAGATE',
             'model': 'ST600MM0006',
             'media_type': 'hdd',
             'interface_type': 'sas',
             'size_mb': 285888,
             'free_size_mb': 285888,
             'serial_number': 'S0M3EY2Z',
             'firmware_version': 'LS0A',
             'state': 'ok',
             'raid_state': 'ready'}]
        nics = [
            {'id': 'NIC.Embedded.1-1-1',
             'mac': 'B0:83:FE:C6:6F:A1',
             'model': 'Broadcom Gigabit Ethernet BCM5720 - B0:83:FE:C6:6F:A1',
             'speed': '1000 Mbps',
             'duplex': 'full duplex',
             'media_type': 'Base T'},
            {'id': 'NIC.Embedded.2-1-1',
             'mac': 'B0:83:FE:C6:6F:A2',
             'model': 'Broadcom Gigabit Ethernet BCM5720 - B0:83:FE:C6:6F:A2',
             'speed': '1000 Mbps',
             'duplex': 'full duplex',
             'media_type': 'Base T'}]
        bios_boot_settings = {'BootMode': {'current_value': 'Bios'}}
        uefi_boot_settings = {'BootMode': {'current_value': 'Uefi'},
                              'PxeDev1EnDis': {'current_value': 'Enabled'},
                              'PxeDev2EnDis': {'current_value': 'Disabled'},
                              'PxeDev3EnDis': {'current_value': 'Disabled'},
                              'PxeDev4EnDis': {'current_value': 'Disabled'},
                              'PxeDev1Interface': {
                                  'current_value': 'NIC.Embedded.1-1-1'},
                              'PxeDev2Interface': None,
                              'PxeDev3Interface': None,
                              'PxeDev4Interface': None}
        nic_settings = {'LegacyBootProto': {'current_value': 'PXE'},
                        'FQDD': 'NIC.Embedded.1-1-1'}

        self.memory = [test_utils.dict_to_namedtuple(values=m) for m in memory]
        self.cpus = [test_utils.dict_to_namedtuple(values=c) for c in cpus]
        self.virtual_disks = [test_utils.dict_to_namedtuple(values=vd)
                              for vd in virtual_disks]
        self.physical_disks = [test_utils.dict_to_namedtuple(values=pd)
                               for pd in physical_disks]
        self.nics = [test_utils.dict_to_namedtuple(values=n) for n in nics]
        self.bios_boot_settings = test_utils.dict_of_object(bios_boot_settings)
        self.uefi_boot_settings = test_utils.dict_of_object(uefi_boot_settings)
        self.nic_settings = test_utils.dict_of_object(nic_settings)