Add mappings for `system_type`
Create mappings for the system_type of the System resource. This represents the type of the computer system. Story: #2005160 Task: #29880 Change-Id: Icf688752791c21c8652e7fc64478ef0307682f1e
This commit is contained in:
parent
798458d444
commit
e348ac8dd5
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
Adds mappings and constants for possible values of System Type in System
|
||||
resource. This represents the type of the computer system.
|
|
@ -146,3 +146,18 @@ PROCESSOR_INSTRUCTIONSET_MIPS64 = 'MIPS 64-bit'
|
|||
PROCESSOR_INSTRUCTIONSET_OEM = 'OEM-defined'
|
||||
PROCESSOR_INSTRUCTIONSET_x86 = 'x86 32-bit'
|
||||
PROCESSOR_INSTRUCTIONSET_x86_64 = 'x86 64-bit'
|
||||
|
||||
# System type constants
|
||||
|
||||
SYSTEM_TYPE_PHYSICAL = "Physical"
|
||||
"""A physical computer system"""
|
||||
SYSTEM_TYPE_VIRTUAL = "Virtual"
|
||||
"""A virtual machine instance"""
|
||||
SYSTEM_TYPE_OS = "OS"
|
||||
"""An operating system instance"""
|
||||
SYSTEM_TYPE_PHYSICALLY_PARTITIONED = "PhysicallyPartitioned"
|
||||
"""A hardware-based partition of a computer system"""
|
||||
SYSTEM_TYPE_VIRTUALLY_PARTITIONED = "VirtuallyPartitioned"
|
||||
"""A virtual or software-based partition of a computer system"""
|
||||
SYSTEM_TYPE_COMPOSED = "Composed"
|
||||
"""A computer system created by binding resource blocks together"""
|
||||
|
|
|
@ -101,3 +101,15 @@ PROCESSOR_INSTRUCTIONSET_VALUE_MAP = {
|
|||
|
||||
PROCESSOR_INSTRUCTIONSET_VALUE_MAP_REV = (
|
||||
utils.revert_dictionary(PROCESSOR_INSTRUCTIONSET_VALUE_MAP))
|
||||
|
||||
SYSTEM_TYPE_VALUE_MAP = {
|
||||
'Physical': sys_cons.SYSTEM_TYPE_PHYSICAL,
|
||||
'Virtual': sys_cons.SYSTEM_TYPE_VIRTUAL,
|
||||
'OS': sys_cons.SYSTEM_TYPE_OS,
|
||||
'PhysicallyPartitioned': sys_cons.SYSTEM_TYPE_PHYSICALLY_PARTITIONED,
|
||||
'VirtuallyPartitioned': sys_cons.SYSTEM_TYPE_VIRTUALLY_PARTITIONED,
|
||||
'Composed': sys_cons.SYSTEM_TYPE_COMPOSED
|
||||
}
|
||||
|
||||
SYSTEM_TYPE_VALUE_MAP_REV = (
|
||||
utils.revert_dictionary(SYSTEM_TYPE_VALUE_MAP))
|
||||
|
|
|
@ -117,8 +117,8 @@ class System(base.ResourceBase):
|
|||
status = common.StatusField('Status')
|
||||
"""The system status"""
|
||||
|
||||
# TODO(lucasagomes): Create mappings for the system_type
|
||||
system_type = base.Field('SystemType')
|
||||
system_type = base.MappedField('SystemType',
|
||||
sys_maps.SYSTEM_TYPE_VALUE_MAP)
|
||||
"""The system type"""
|
||||
|
||||
uuid = base.Field('UUID')
|
||||
|
|
|
@ -59,7 +59,8 @@ class SystemTestCase(base.TestCase):
|
|||
self.assertEqual('224071-J23', self.sys_inst.part_number)
|
||||
self.assertEqual('437XR1138R2', self.sys_inst.serial_number)
|
||||
self.assertEqual('8675309', self.sys_inst.sku)
|
||||
self.assertEqual('Physical', self.sys_inst.system_type)
|
||||
self.assertEqual(sushy.SYSTEM_TYPE_PHYSICAL,
|
||||
self.sys_inst.system_type)
|
||||
self.assertEqual('38947555-7742-3448-3784-823347823834',
|
||||
self.sys_inst.uuid)
|
||||
self.assertEqual(res_cons.STATE_ENABLED, self.sys_inst.status.state)
|
||||
|
|
Loading…
Reference in New Issue