SEBA-902 mock testing of redfish importer;
Remove hardcoded addresses and replace with config file / cmdline;
Support hostnames in importer as alternative to ip addresses;
Treat response 204 as success
Change-Id: I17e8e585e388c501c02867ce952bbe1fa9b09668
diff --git a/mock-redfish-server/mockup/redfish/v1/Systems/1/Memory/1/index.json b/mock-redfish-server/mockup/redfish/v1/Systems/1/Memory/1/index.json
new file mode 100644
index 0000000..5cd34b2
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Systems/1/Memory/1/index.json
@@ -0,0 +1,52 @@
+{
+ "SerialNumber": null,
+ "Name": "Memory",
+ "FirmwareApiVersion": null,
+ "MemoryMedia": [],
+ "Manufacturer": null,
+ "DeviceLocator": "DIMM_A1",
+ "BaseModuleType": null,
+ "CapacityMiB": 7812,
+ "FunctionClasses": [],
+ "Regions": [
+ {
+ "MemoryClassification": null,
+ "SizeMiB": 7812,
+ "OffsetMiB": 0,
+ "RegionId": "1"
+ }
+ ],
+ "@odata.id": "/redfish/v1/Systems/1/Memory/1",
+ "OperatingSpeedMhz": 2133,
+ "ErrorCorrection": null,
+ "OperatingMemoryModes": [],
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": "OK",
+ "Health": "OK"
+ },
+ "BusWidthBits": null,
+ "RankCount": null,
+ "Oem": {
+ "Intel_RackScale": {
+ "VoltageVolt": null,
+ "@odata.type": "#Intel.Oem.Memory"
+ }
+ },
+ "Id": "1",
+ "Description": "Memory description",
+ "MemoryDeviceType": "DDR3_SDRAM",
+ "@odata.type": "#Memory.v1_1_0.Memory",
+ "DataWidthBits": 64,
+ "@odata.context": "/redfish/v1/$metadata#Memory.Memory",
+ "MemoryType": null,
+ "FirmwareRevision": null,
+ "AllowedSpeedsMHz": [],
+ "MemoryLocation": {
+ "Socket": null,
+ "MemoryController": null,
+ "Slot": null,
+ "Channel": null
+ },
+ "PartNumber": null
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Systems/1/Memory/2/index.json b/mock-redfish-server/mockup/redfish/v1/Systems/1/Memory/2/index.json
new file mode 100644
index 0000000..61ad245
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Systems/1/Memory/2/index.json
@@ -0,0 +1,52 @@
+{
+ "SerialNumber": null,
+ "Name": "Memory",
+ "FirmwareApiVersion": null,
+ "MemoryMedia": [],
+ "Manufacturer": null,
+ "DeviceLocator": "DIMM_B1",
+ "BaseModuleType": null,
+ "CapacityMiB": 7812,
+ "FunctionClasses": [],
+ "Regions": [
+ {
+ "MemoryClassification": null,
+ "SizeMiB": 7812,
+ "OffsetMiB": 0,
+ "RegionId": "2"
+ }
+ ],
+ "@odata.id": "/redfish/v1/Systems/1/Memory/2",
+ "OperatingSpeedMhz": 2133,
+ "ErrorCorrection": null,
+ "OperatingMemoryModes": [],
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": "OK",
+ "Health": "OK"
+ },
+ "BusWidthBits": null,
+ "RankCount": null,
+ "Oem": {
+ "Intel_RackScale": {
+ "VoltageVolt": null,
+ "@odata.type": "#Intel.Oem.Memory"
+ }
+ },
+ "Id": "2",
+ "Description": "Memory description",
+ "MemoryDeviceType": "DDR3_SDRAM",
+ "@odata.type": "#Memory.v1_1_0.Memory",
+ "DataWidthBits": 64,
+ "@odata.context": "/redfish/v1/$metadata#Memory.Memory",
+ "MemoryType": null,
+ "FirmwareRevision": null,
+ "AllowedSpeedsMHz": [],
+ "MemoryLocation": {
+ "Socket": null,
+ "MemoryController": null,
+ "Slot": null,
+ "Channel": null
+ },
+ "PartNumber": null
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Systems/1/Memory/index.json b/mock-redfish-server/mockup/redfish/v1/Systems/1/Memory/index.json
new file mode 100644
index 0000000..e2631a0
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Systems/1/Memory/index.json
@@ -0,0 +1,16 @@
+{
+ "@odata.type": "#MemoryCollection.MemoryCollection",
+ "Name": "Memory Collection",
+ "@odata.context": "/redfish/v1/$metadata#MemoryCollection.MemoryCollection",
+ "Members": [
+ {
+ "@odata.id": "/redfish/v1/Systems/1/Memory/1"
+ },
+ {
+ "@odata.id": "/redfish/v1/Systems/1/Memory/2"
+ }
+ ],
+ "Description": "Memory Collection",
+ "@odata.id": "/redfish/v1/Systems/1/Memory",
+ "Members@odata.count": 2
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Systems/1/Processors/1/index.json b/mock-redfish-server/mockup/redfish/v1/Systems/1/Processors/1/index.json
new file mode 100644
index 0000000..947d557
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Systems/1/Processors/1/index.json
@@ -0,0 +1,50 @@
+{
+ "ProcessorId": {
+ "IdentificationRegisters": null,
+ "VendorId": "GenuineIntel",
+ "EffectiveModel": null,
+ "EffectiveFamily": null,
+ "MicrocodeInfo": null,
+ "Step": null
+ },
+ "Model": "Intel(R) Xeon(R) CPU D-1518 @ 2.20GHz",
+ "Name": "Processor",
+ "TotalThreads": 2,
+ "TotalCores": 4,
+ "ProcessorArchitecture": "x86",
+ "Description": "Processor Description",
+ "Id": "1",
+ "MaxSpeedMHz": 800,
+ "Socket": "CPU0",
+ "ProcessorType": "CPU",
+ "@odata.type": "#Processor.v1_0_0.Processor",
+ "@odata.context": "/redfish/v1/$metadata#Processor.Processor",
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": "OK",
+ "Health": "OK"
+ },
+ "Manufacturer": "Intel Corporation",
+ "@odata.id": "/redfish/v1/Systems/1/Processors/1",
+ "Oem": {
+ "Intel_RackScale": {
+ "Capabilities": [],
+ "@odata.type": "#Intel.Oem.Processor",
+ "Brand": "Unknown"
+ }
+ },
+ "InstructionSet": "x86-64",
+ "CpuStatus": {
+ "io wait": 0,
+ "guest": 0,
+ "LoadingPercentage": 0.6329113841056824,
+ "guest nice": 0,
+ "system": 0.6320000290870667,
+ "user nice": 0,
+ "soft irq": 0,
+ "user": 0,
+ "steal": 0,
+ "idle": 99.36699676513672,
+ "hard irq": 0
+ }
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Systems/1/Processors/index.json b/mock-redfish-server/mockup/redfish/v1/Systems/1/Processors/index.json
new file mode 100644
index 0000000..99a68ea
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Systems/1/Processors/index.json
@@ -0,0 +1,13 @@
+{
+ "@odata.type": "#ProcessorCollection.ProcessorCollection",
+ "Name": "Processor Collection",
+ "@odata.context": "/redfish/v1/$metadata#ProcessorCollection.ProcessorCollection",
+ "Members": [
+ {
+ "@odata.id": "/redfish/v1/Systems/1/Processors/1"
+ }
+ ],
+ "Description": "Collection of Processors",
+ "@odata.id": "/redfish/v1/Systems/1/Processors",
+ "Members@odata.count": 1
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Systems/1/Storage/1/Volumes/index.json b/mock-redfish-server/mockup/redfish/v1/Systems/1/Storage/1/Volumes/index.json
new file mode 100644
index 0000000..541c298
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Systems/1/Storage/1/Volumes/index.json
@@ -0,0 +1,9 @@
+{
+ "@odata.type": "#VolumeCollection.VolumeCollection",
+ "Name": "Computer Volume Collection",
+ "@odata.context": "/redfish/v1/$metadata#VolumeCollection.VolumeCollection",
+ "Members": [],
+ "Description": "Computer Volume Collection",
+ "@odata.id": "/redfish/v1/Systems/1/Storage/1/Volumes",
+ "Members@odata.count": 0
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Systems/1/Storage/1/index.json b/mock-redfish-server/mockup/redfish/v1/Systems/1/Storage/1/index.json
new file mode 100644
index 0000000..b0d96f6
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Systems/1/Storage/1/index.json
@@ -0,0 +1,24 @@
+{
+ "Name": "Storage Subsystem",
+ "Links": {},
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": "OK",
+ "Health": "OK"
+ },
+ "Volumes": {
+ "@odata.id": "/redfish/v1/Systems/1/Storage/1/Volumes"
+ },
+ "Id": "1",
+ "Description": "Storage Subsystem description",
+ "Actions": {},
+ "@odata.type": "#Storage.v1_1_0.Storage",
+ "@odata.context": "/redfish/v1/$metadata#Storage.Storage",
+ "StorageControllers": [],
+ "@odata.id": "/redfish/v1/Systems/1/Storage/1",
+ "Drives": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1/Drives/1"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Systems/1/Storage/index.json b/mock-redfish-server/mockup/redfish/v1/Systems/1/Storage/index.json
new file mode 100644
index 0000000..9a6f9bf
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Systems/1/Storage/index.json
@@ -0,0 +1,12 @@
+{
+ "@odata.type": "#StorageCollection.StorageCollection",
+ "Name": "Storage Collection",
+ "@odata.context": "/redfish/v1/$metadata#StorageCollection.StorageCollection",
+ "Members": [
+ {
+ "@odata.id": "/redfish/v1/Systems/1/Storage/1"
+ }
+ ],
+ "@odata.id": "/redfish/v1/Systems/1/Storage",
+ "Members@odata.count": 1
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Systems/1/index.json b/mock-redfish-server/mockup/redfish/v1/Systems/1/index.json
new file mode 100644
index 0000000..903a409
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Systems/1/index.json
@@ -0,0 +1,100 @@
+{
+ "SerialNumber": "EC1721000216",
+ "BiosVersion": "5.11",
+ "Name": "Computer System",
+ "IndicatorLED": "Lit",
+ "Manufacturer": "Accton",
+ "Memory": {
+ "@odata.id": "/redfish/v1/Systems/1/Memory"
+ },
+ "HostName": "localhost",
+ "Storage": {
+ "@odata.id": "/redfish/v1/Systems/1/Storage"
+ },
+ "PCIeFunctions": [],
+ "UUID": "d6fee3aa-785f-11ea-8e4b-af25952f929b",
+ "@odata.id": "/redfish/v1/Systems/1",
+ "AssetTag": "N/A",
+ "SystemType": "Physical",
+ "Oem": {
+ "Intel_RackScale": {
+ "ProcessorSockets": 1,
+ "DiscoveryState": "Basic",
+ "@odata.type": "#Intel.Oem.ComputerSystem",
+ "PCIeConnectionId": [],
+ "MemorySockets": 2,
+ "PciDevices": []
+ }
+ },
+ "Boot": {
+ "BootSourceOverrideMode": "Legacy",
+ "BootSourceOverrideTarget": "None",
+ "BootSourceOverrideEnabled": "Disabled"
+ },
+ "MemoryState": {
+ "FreeSwapMemoryByte": 0,
+ "TotalSwapMemoryByte": 0,
+ "FreeMemoryByte": 16169037824,
+ "TotalMemoryByte": 16687493120
+ },
+ "ProcessorSummary": {
+ "Model": "Intel(R) Xeon(R) CPU D-1518 @ 2.20GHz",
+ "Count": 1,
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": "OK",
+ "Health": "OK"
+ }
+ },
+ "PCIeDevices": [],
+ "Links": {
+ "Oem": {},
+ "ManagedBy": [
+ {
+ "@odata.id": "/redfish/v1/Managers/1"
+ }
+ ],
+ "@odata.type": "#ComputerSystem.v1_2_0.Links",
+ "Endpoints": [],
+ "Chassis": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ]
+ },
+ "Id": "1",
+ "Description": "Computer System description",
+ "Model": "",
+ "PowerState": "On",
+ "Actions": {
+ "#ComputerSystem.Reset": {
+ "target": "/redfish/v1/Systems/1/Actions/ComputerSystem.Reset",
+ "ResetType@Redfish.AllowableValues": [
+ "ForceOff",
+ "GracefulShutdown",
+ "GracefulRestart",
+ "ForceRestart"
+ ]
+ }
+ },
+ "@odata.type": "#ComputerSystem.v1_3_0.ComputerSystem",
+ "SKU": null,
+ "@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem",
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": "OK",
+ "Health": "OK"
+ },
+ "Processors": {
+ "@odata.id": "/redfish/v1/Systems/1/Processors"
+ },
+ "MemorySummary": {
+ "TotalSystemMemoryGiB": 15.26,
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": "OK",
+ "Health": "OK"
+ }
+ },
+ "PartNumber": ""
+}
\ No newline at end of file