Redfish: Adds secure_boot to server capabilities

This commit adds logic to include 'secure_boot' capabilitiy
to server capabilities.

Change-Id: Ia25d02f8d22f25ba6a3e864f72c9b0a17b80c214
This commit is contained in:
vmud213 2017-07-20 18:33:19 +05:30 committed by Nisha Agarwal
parent d7e6e73435
commit 6416cf6597
2 changed files with 9 additions and 2 deletions

View File

@ -627,8 +627,10 @@ class RedfishOperations(operations.IloOperations):
),
('trusted_boot',
(tpm_state == sys_cons.TPM_PRESENT_ENABLED
or tpm_state == sys_cons.TPM_PRESENT_DISABLED)),)
if value})
or tpm_state == sys_cons.TPM_PRESENT_DISABLED)),
('secure_boot',
GET_SECUREBOOT_CURRENT_BOOT_MAP.get(
sushy_system.secure_boot.current_boot)),) if value})
except sushy.exceptions.SushyError as e:
msg = (self._("The Redfish controller is unable to get "
"resource or its members. Error "

View File

@ -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.secure_boot).current_boot = (
sys_cons.SECUREBOOT_CURRENT_BOOT_ENABLED)
type(get_system_mock.return_value).rom_version = (
'U31 v1.00 (03/11/2017)')
type(get_manager_mock.return_value).firmware_version = 'iLO 5 v1.15'
@ -667,6 +669,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',
'rom_firmware_version': 'U31 v1.00 (03/11/2017)',
'ilo_firmware_version': 'iLO 5 v1.15',
'nic_capacity': '1Gb',
@ -687,6 +690,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.secure_boot).current_boot = (
sys_cons.SECUREBOOT_CURRENT_BOOT_DISABLED)
type(get_system_mock.return_value).rom_version = (
'U31 v1.00 (03/11/2017)')
type(get_manager_mock.return_value).firmware_version = 'iLO 5 v1.15'