Add cpu virtualisation capability
This commit adds 'cpu virtualisation' capability for redfish. Change-Id: If6e7ee98be878f3a2fac0b0a5caa78eb559ed82e
This commit is contained in:
parent
ac0595ecf9
commit
526ed7953c
|
@ -625,6 +625,9 @@ class RedfishOperations(operations.IloOperations):
|
|||
'sriov_enabled',
|
||||
sushy_system.bios_settings.sriov == sys_cons.SRIOV_ENABLED
|
||||
),
|
||||
('cpu_vt',
|
||||
sushy_system.bios_settings.cpu_vt == (
|
||||
sys_cons.CPUVT_ENABLED)),
|
||||
('trusted_boot',
|
||||
(tpm_state == sys_cons.TPM_PRESENT_ENABLED
|
||||
or tpm_state == sys_cons.TPM_PRESENT_DISABLED)),
|
||||
|
|
|
@ -41,6 +41,9 @@ class BIOSSettings(base.ResourceBase):
|
|||
|
||||
tpm_state = base.MappedField(["Attributes", "TpmState"], mappings.TPM_MAP)
|
||||
|
||||
cpu_vt = base.MappedField(["Attributes", "ProcVirtualization"],
|
||||
mappings.CPUVT_MAP)
|
||||
|
||||
_pending_settings = None
|
||||
_boot_settings = None
|
||||
_base_configs = None
|
||||
|
|
|
@ -50,3 +50,8 @@ SECUREBOOT_RESET_KEYS_DELETE_PK = 'delete pk'
|
|||
TPM_PRESENT_ENABLED = 'Tpm present enabled'
|
||||
TPM_PRESENT_DISABLED = 'Tpm present disabled'
|
||||
TPM_NOT_PRESENT = 'Tpm not present'
|
||||
|
||||
# BIOS Cpu Virtualisation contants
|
||||
|
||||
CPUVT_ENABLED = 'cpu_vt enabled'
|
||||
CPUVT_DISABLED = 'cpu_vt disabled'
|
||||
|
|
|
@ -64,3 +64,8 @@ TPM_MAP = {
|
|||
'PresentDisabled': constants.TPM_PRESENT_DISABLED,
|
||||
'NotPresent': constants.TPM_NOT_PRESENT
|
||||
}
|
||||
|
||||
CPUVT_MAP = {
|
||||
'Enabled': constants.CPUVT_ENABLED,
|
||||
'Disabled': constants.CPUVT_DISABLED
|
||||
}
|
||||
|
|
|
@ -43,6 +43,8 @@ class BIOSSettingsTestCase(testtools.TestCase):
|
|||
self.bios_inst.boot_mode)
|
||||
self.assertEqual(sys_cons.SRIOV_ENABLED,
|
||||
self.bios_inst.sriov)
|
||||
self.assertEqual(sys_cons.CPUVT_ENABLED,
|
||||
self.bios_inst.cpu_vt)
|
||||
|
||||
def test_pending_settings(self):
|
||||
self.assertIsNone(self.bios_inst._pending_settings)
|
||||
|
|
|
@ -655,6 +655,8 @@ class RedfishOperationsTestCase(testtools.TestCase):
|
|||
[mock.MagicMock(spec=pci_device.PCIDevice)])
|
||||
type(get_system_mock.return_value.bios_settings).sriov = (
|
||||
sys_cons.SRIOV_ENABLED)
|
||||
type(get_system_mock.return_value.bios_settings).cpu_vt = (
|
||||
sys_cons.CPUVT_ENABLED)
|
||||
type(get_system_mock.return_value.secure_boot).current_boot = (
|
||||
sys_cons.SECUREBOOT_CURRENT_BOOT_ENABLED)
|
||||
type(get_system_mock.return_value).rom_version = (
|
||||
|
@ -669,7 +671,7 @@ class RedfishOperationsTestCase(testtools.TestCase):
|
|||
tpm_mock)
|
||||
actual = self.rf_client.get_server_capabilities()
|
||||
expected = {'pci_gpu_devices': 1, 'sriov_enabled': 'true',
|
||||
'secure_boot': 'true',
|
||||
'secure_boot': 'true', 'cpu_vt': 'true',
|
||||
'rom_firmware_version': 'U31 v1.00 (03/11/2017)',
|
||||
'ilo_firmware_version': 'iLO 5 v1.15',
|
||||
'nic_capacity': '1Gb',
|
||||
|
@ -690,6 +692,8 @@ class RedfishOperationsTestCase(testtools.TestCase):
|
|||
[mock.MagicMock(spec=pci_device.PCIDevice)])
|
||||
type(get_system_mock.return_value.bios_settings).sriov = (
|
||||
sys_cons.SRIOV_DISABLED)
|
||||
type(get_system_mock.return_value.bios_settings).cpu_vt = (
|
||||
sys_cons.CPUVT_DISABLED)
|
||||
type(get_system_mock.return_value.secure_boot).current_boot = (
|
||||
sys_cons.SECUREBOOT_CURRENT_BOOT_DISABLED)
|
||||
type(get_system_mock.return_value).rom_version = (
|
||||
|
|
Loading…
Reference in New Issue