Add missing fields in 2.3&2.4 root service

Change-Id: If14aa7d384b8f0e66eef45c153c2ac18a44c645f
This commit is contained in:
Lin Yang 2019-02-08 11:19:25 -08:00
parent ec67bbbd59
commit cfc0aa8d05
7 changed files with 40 additions and 15 deletions

View File

@ -26,10 +26,6 @@ from rsd_lib.resources.v2_3.system import system
class RSDLibV2_3(v2_2.RSDLibV2_2): class RSDLibV2_3(v2_2.RSDLibV2_2):
# Override telemetry variable inherited from v2.2. The corresponding
# service don't exist in RSD v2.3
_telemetry_service_path = None
_ethernet_switches_path = base.Field( _ethernet_switches_path = base.Field(
['Oem', 'Intel_RackScale', 'EthernetSwitches', '@odata.id']) ['Oem', 'Intel_RackScale', 'EthernetSwitches', '@odata.id'])
"""EthernetSwitchCollecton path""" """EthernetSwitchCollecton path"""

View File

@ -13,12 +13,18 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from sushy.resources import base
from rsd_lib.resources import v2_3 from rsd_lib.resources import v2_3
from rsd_lib.resources.v2_4.storage_service import storage_service from rsd_lib.resources.v2_4.storage_service import storage_service
class RSDLibV2_4(v2_3.RSDLibV2_3): class RSDLibV2_4(v2_3.RSDLibV2_3):
_telemetry_service_path = base.Field(
['Oem', 'Intel_RackScale', 'TelemetryService', '@odata.id'])
"""EthernetSwitchCollecton path"""
def get_storage_service_collection(self): def get_storage_service_collection(self):
"""Get the StorageServiceCollection object """Get the StorageServiceCollection object

View File

@ -20,16 +20,19 @@
"@odata.id": "/redfish/v1/EventService" "@odata.id": "/redfish/v1/EventService"
}, },
"Fabrics": { "Fabrics": {
"@odata.id": "/redfish/v1/Fabrics" "@odata.id": "/redfish/v1/Fabrics"
}, },
"Tasks": { "Tasks": {
"@odata.id": "/redfish/v1/TaskService" "@odata.id": "/redfish/v1/TaskService"
}, },
"StorageServices": { "StorageServices": {
"@odata.id": "/redfish/v1/StorageServices" "@odata.id": "/redfish/v1/StorageServices"
}, },
"Registries": { "Registries": {
"@odata.id": "/redfish/v1/Registries" "@odata.id": "/redfish/v1/Registries"
},
"TelemetryService": {
"@odata.id": "/redfish/v1/TelemetryService"
}, },
"Oem": { "Oem": {
"Intel_RackScale": { "Intel_RackScale": {
@ -38,6 +41,9 @@
"Nodes": { "Nodes": {
"@odata.id": "/redfish/v1/Nodes" "@odata.id": "/redfish/v1/Nodes"
}, },
"Services": {
"@odata.id": "/redfish/v1/Services"
},
"EthernetSwitches": { "EthernetSwitches": {
"@odata.id": "/redfish/v1/EthernetSwitches" "@odata.id": "/redfish/v1/EthernetSwitches"
} }

View File

@ -1,11 +1,11 @@
{ {
"@odata.context": "/redfish/v1/$metadata#ServiceRoot.ServiceRoot", "@odata.context": "/redfish/v1/$metadata#ServiceRoot.ServiceRoot",
"@odata.id": "/redfish/v1/", "@odata.id": "/redfish/v1/",
"@odata.type": "#ServiceRoot.v1_1_1.ServiceRoot", "@odata.type": "#ServiceRoot.v1_3_1.ServiceRoot",
"Id": "RootService", "Id": "RootService",
"Name": "Root Service", "Name": "Root Service",
"Description": "description-as-string", "Description": "description-as-string",
"RedfishVersion": "1.1.0", "RedfishVersion": "1.5.0",
"UUID": "92384634-2938-2342-8820-489239905423", "UUID": "92384634-2938-2342-8820-489239905423",
"Systems": { "Systems": {
"@odata.id": "/redfish/v1/Systems" "@odata.id": "/redfish/v1/Systems"
@ -20,16 +20,16 @@
"@odata.id": "/redfish/v1/EventService" "@odata.id": "/redfish/v1/EventService"
}, },
"Fabrics": { "Fabrics": {
"@odata.id": "/redfish/v1/Fabrics" "@odata.id": "/redfish/v1/Fabrics"
}, },
"Tasks": { "Tasks": {
"@odata.id": "/redfish/v1/TaskService" "@odata.id": "/redfish/v1/TaskService"
}, },
"StorageServices": { "StorageServices": {
"@odata.id": "/redfish/v1/StorageServices" "@odata.id": "/redfish/v1/StorageServices"
}, },
"Registries": { "Registries": {
"@odata.id": "/redfish/v1/Registries" "@odata.id": "/redfish/v1/Registries"
}, },
"Oem": { "Oem": {
"Intel_RackScale": { "Intel_RackScale": {
@ -38,8 +38,14 @@
"Nodes": { "Nodes": {
"@odata.id": "/redfish/v1/Nodes" "@odata.id": "/redfish/v1/Nodes"
}, },
"Services": {
"@odata.id": "/redfish/v1/Services"
},
"EthernetSwitches": { "EthernetSwitches": {
"@odata.id": "/redfish/v1/EthernetSwitches" "@odata.id": "/redfish/v1/EthernetSwitches"
},
"TelemetryService": {
"@odata.id": "/redfish/v1/TelemetryService"
} }
} }
}, },

View File

@ -56,8 +56,11 @@ class RSDLibV2_2TestCase(testtools.TestCase):
self.assertEqual("/redfish/v1/Services", self.assertEqual("/redfish/v1/Services",
self.rsd._storage_service_path) self.rsd._storage_service_path)
self.assertEqual("/redfish/v1/Fabrics", self.rsd._fabrics_path) self.assertEqual("/redfish/v1/Fabrics", self.rsd._fabrics_path)
self.assertEqual("/redfish/v1/Managers", self.rsd._managers_path)
self.assertEqual("/redfish/v1/TelemetryService", self.assertEqual("/redfish/v1/TelemetryService",
self.rsd._telemetry_service_path) self.rsd._telemetry_service_path)
self.assertEqual("/redfish/v1/EthernetSwitches",
self.rsd._ethernet_switches_path)
self.assertEqual("/redfish/v1/TaskService", self.assertEqual("/redfish/v1/TaskService",
self.rsd._task_service_path) self.rsd._task_service_path)
self.assertEqual("/redfish/v1/Registries", self.assertEqual("/redfish/v1/Registries",

View File

@ -54,7 +54,11 @@ class RSDLibV2_3TestCase(testtools.TestCase):
self.assertEqual("/redfish/v1/Fabrics", self.rsd._fabrics_path) self.assertEqual("/redfish/v1/Fabrics", self.rsd._fabrics_path)
self.assertEqual("/redfish/v1/StorageServices", self.assertEqual("/redfish/v1/StorageServices",
self.rsd._storage_service_path) self.rsd._storage_service_path)
self.assertEqual(None, self.rsd._telemetry_service_path) self.assertEqual("/redfish/v1/Managers", self.rsd._managers_path)
self.assertEqual("/redfish/v1/EthernetSwitches",
self.rsd._ethernet_switches_path)
self.assertEqual("/redfish/v1/TelemetryService",
self.rsd._telemetry_service_path)
self.assertEqual("/redfish/v1/TaskService", self.assertEqual("/redfish/v1/TaskService",
self.rsd._task_service_path) self.rsd._task_service_path)
self.assertEqual("/redfish/v1/Registries", self.assertEqual("/redfish/v1/Registries",

View File

@ -47,14 +47,18 @@ class RSDLibV2_3TestCase(testtools.TestCase):
def test__parse_attributes(self): def test__parse_attributes(self):
self.rsd._parse_attributes() self.rsd._parse_attributes()
self.assertEqual("2.4.0", self.rsd._rsd_api_version) self.assertEqual("2.4.0", self.rsd._rsd_api_version)
self.assertEqual("1.1.0", self.rsd._redfish_version) self.assertEqual("1.5.0", self.rsd._redfish_version)
self.assertEqual("/redfish/v1/Systems", self.rsd._systems_path) self.assertEqual("/redfish/v1/Systems", self.rsd._systems_path)
self.assertEqual("/redfish/v1/Nodes", self.rsd._nodes_path) self.assertEqual("/redfish/v1/Nodes", self.rsd._nodes_path)
self.assertEqual("/redfish/v1/Chassis", self.rsd._chassis_path) self.assertEqual("/redfish/v1/Chassis", self.rsd._chassis_path)
self.assertEqual("/redfish/v1/Fabrics", self.rsd._fabrics_path) self.assertEqual("/redfish/v1/Fabrics", self.rsd._fabrics_path)
self.assertEqual("/redfish/v1/StorageServices", self.assertEqual("/redfish/v1/StorageServices",
self.rsd._storage_service_path) self.rsd._storage_service_path)
self.assertEqual(None, self.rsd._telemetry_service_path) self.assertEqual("/redfish/v1/Managers", self.rsd._managers_path)
self.assertEqual("/redfish/v1/EthernetSwitches",
self.rsd._ethernet_switches_path)
self.assertEqual("/redfish/v1/TelemetryService",
self.rsd._telemetry_service_path)
self.assertEqual("/redfish/v1/TaskService", self.assertEqual("/redfish/v1/TaskService",
self.rsd._task_service_path) self.rsd._task_service_path)
self.assertEqual("/redfish/v1/Registries", self.assertEqual("/redfish/v1/Registries",