Merge "Add processor ProcessorId field and Status field"
This commit is contained in:
commit
44bde534cf
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
Adds the processor status and id fields to the ``Processor`` class.
|
|
@ -24,6 +24,39 @@ ProcessorSummary = collections.namedtuple('ProcessorSummary',
|
|||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ProcessorIdField(base.CompositeField):
|
||||
|
||||
effective_family = base.Field('EffectiveFamily')
|
||||
"""The processor effective family"""
|
||||
|
||||
effective_model = base.Field('EffectiveModel')
|
||||
"""The processor effective model"""
|
||||
|
||||
identification_registers = base.Field('IdentificationRegisters')
|
||||
"""The processor identification registers"""
|
||||
|
||||
microcode_info = base.Field('MicrocodeInfo')
|
||||
"""The processor microcode info"""
|
||||
|
||||
step = base.Field('Step')
|
||||
"""The processor stepping"""
|
||||
|
||||
vendor_id = base.Field('VendorID')
|
||||
"""The processor vendor id"""
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
|
||||
health = base.Field('Health')
|
||||
"""The processor health"""
|
||||
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
"""The processor health rollup"""
|
||||
|
||||
state = base.Field('State')
|
||||
"""The processor state"""
|
||||
|
||||
|
||||
class Processor(base.ResourceBase):
|
||||
|
||||
identity = base.Field('Id', required=True)
|
||||
|
@ -53,6 +86,12 @@ class Processor(base.ResourceBase):
|
|||
max_speed_mhz = base.Field('MaxSpeedMHz', adapter=int)
|
||||
"""The maximum clock speed of the processor in MHz."""
|
||||
|
||||
processor_id = ProcessorIdField('ProcessorId')
|
||||
"""The processor id"""
|
||||
|
||||
status = StatusField('Status')
|
||||
"""The processor status"""
|
||||
|
||||
total_cores = base.Field('TotalCores', adapter=int)
|
||||
"""The total number of cores contained in this processor"""
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"InstructionSet": "x86-64",
|
||||
"Manufacturer": "Intel(R) Corporation",
|
||||
"Model": "Multi-Core Intel(R) Xeon(R) processor 7xxx Series",
|
||||
"ProcessorID": {
|
||||
"ProcessorId": {
|
||||
"VendorID": "GenuineIntel",
|
||||
"IdentificationRegisters": "0x34AC34DC8901274A",
|
||||
"EffectiveFamily": "0x42",
|
||||
|
@ -20,7 +20,8 @@
|
|||
"TotalThreads": 16,
|
||||
"Status": {
|
||||
"State": "Enabled",
|
||||
"Health": "OK"
|
||||
"Health": "OK",
|
||||
"HealthRollup": "OK"
|
||||
},
|
||||
"@odata.context": "/redfish/v1/$metadata#Systems/Members/437XR1138R2/Processors/Members/$entity",
|
||||
"@odata.id": "/redfish/v1/Systems/437XR1138R2/Processors/CPU1",
|
||||
|
|
|
@ -46,9 +46,26 @@ class ProcessorTestCase(base.TestCase):
|
|||
self.sys_processor.manufacturer)
|
||||
self.assertEqual('Multi-Core Intel(R) Xeon(R) processor 7xxx Series',
|
||||
self.sys_processor.model)
|
||||
self.assertEqual('0x42',
|
||||
self.sys_processor.processor_id.effective_family)
|
||||
self.assertEqual('0x61',
|
||||
self.sys_processor.processor_id.effective_model)
|
||||
self.assertEqual('0x34AC34DC8901274A',
|
||||
self.sys_processor.processor_id.
|
||||
identification_registers)
|
||||
self.assertEqual('0x429943',
|
||||
self.sys_processor.processor_id.microcode_info)
|
||||
self.assertEqual('0x1',
|
||||
self.sys_processor.processor_id.step)
|
||||
self.assertEqual('GenuineIntel',
|
||||
self.sys_processor.processor_id.vendor_id)
|
||||
|
||||
self.assertEqual(3700, self.sys_processor.max_speed_mhz)
|
||||
self.assertEqual(8, self.sys_processor.total_cores)
|
||||
self.assertEqual(16, self.sys_processor.total_threads)
|
||||
self.assertEqual('Enabled', self.sys_processor.status.state)
|
||||
self.assertEqual('OK', self.sys_processor.status.health)
|
||||
self.assertEqual('OK', self.sys_processor.status.health_rollup)
|
||||
|
||||
|
||||
class ProcessorCollectionTestCase(base.TestCase):
|
||||
|
|
Loading…
Reference in New Issue