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/Chassis/1/Drives/1/index.json b/mock-redfish-server/mockup/redfish/v1/Chassis/1/Drives/1/index.json
new file mode 100644
index 0000000..f9a3d96
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Chassis/1/Drives/1/index.json
@@ -0,0 +1,58 @@
+{
+ "SerialNumber": "TS32ZBTMM1600_D486350097",
+ "Name": "Drive",
+ "IndicatorLED": null,
+ "Manufacturer": null,
+ "Actions": {
+ "#Drive.SecureErase": {
+ "target": "/redfish/v1/Chassis/1/Drives/1/Actions/Drive.SecureErase"
+ }
+ },
+ "EncryptionStatus": null,
+ "BlockSizeBytes": null,
+ "RotationSpeedRPM": null,
+ "@odata.id": "/redfish/v1/Chassis/1/Drives/1",
+ "MediaType": "SSD",
+ "StatusIndicator": null,
+ "Oem": {
+ "Intel_RackScale": {
+ "DriveErased": null,
+ "@odata.type": "#Intel.Oem.Drive",
+ "EraseOnDetach": null,
+ "Storage": {
+ "@odata.id": "/redfish/v1/Systems/1/Storage/1"
+ },
+ "FirmwareVersion": null,
+ "PCIeFunction": null
+ }
+ },
+ "AssetTag": null,
+ "EncryptionAbility": null,
+ "CapacityBytes": 32017047552,
+ "Links": {
+ "@odata.type": "#Drive.v1_1_0.Links",
+ "Endpoints": [],
+ "Volumes": []
+ },
+ "Id": "1",
+ "FailurePredicted": null,
+ "Description": "Drive description",
+ "HotspareType": null,
+ "Model": "",
+ "PredictedMediaLifeLeftPercent": null,
+ "Identifiers": [],
+ "Revision": "O0918B",
+ "NegotiatedSpeedGbs": null,
+ "Protocol": "SATA",
+ "@odata.type": "#Drive.v1_1_1.Drive",
+ "SKU": null,
+ "@odata.context": "/redfish/v1/$metadata#Chassis.Chassis",
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": "OK",
+ "Health": "OK"
+ },
+ "CapableSpeedGbs": null,
+ "Location": [],
+ "PartNumber": null
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Chassis/1/Power/index.json b/mock-redfish-server/mockup/redfish/v1/Chassis/1/Power/index.json
new file mode 100644
index 0000000..80f43fe
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Chassis/1/Power/index.json
@@ -0,0 +1,163 @@
+{
+ "@odata.type": "#Power.v1_1_0.Power",
+ "Name": "Power Collection",
+ "@odata.context": "/redfish/v1/$metadata#Power.Power",
+ "PowerSupplies": [
+ {
+ "SerialNumber": "TA020V581717000002",
+ "Name": "Power Supplies Unit",
+ "MemberId": "1",
+ "Status": {
+ "State": "Enabled",
+ "Health": "OK"
+ },
+ "FirmwareVersion": null,
+ "Manufacturer": null,
+ "Model": "YM-2651Y",
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "PowerCapacityWatts": null,
+ "@odata.id": "/redfish/v1/Chassis/1/Power",
+ "LineInputVoltage": null,
+ "SparePartNumber": null,
+ "LineInputVoltageType": null,
+ "LastPowerOutputWatts": 175,
+ "Oem": {},
+ "PartNumber": null,
+ "PowerSupplyType": "AC"
+ },
+ {
+ "SerialNumber": "NULL",
+ "Name": "Power Supplies Unit",
+ "MemberId": "2",
+ "Status": {
+ "State": "UnavailableOffline",
+ "Health": "OK"
+ },
+ "FirmwareVersion": null,
+ "Manufacturer": null,
+ "Model": "NULL",
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "PowerCapacityWatts": null,
+ "@odata.id": "/redfish/v1/Chassis/1/Power",
+ "LineInputVoltage": null,
+ "SparePartNumber": null,
+ "LineInputVoltageType": null,
+ "LastPowerOutputWatts": 0,
+ "Oem": {},
+ "PartNumber": null,
+ "PowerSupplyType": "Unknown"
+ }
+ ],
+ "Id": "Power",
+ "PowerControl": [
+ {
+ "Name": "System Power Control",
+ "MemberId": "1",
+ "PowerCapacityWatts": 0,
+ "PowerAvailableWatts": null,
+ "PowerLimit": {
+ "LimitException": null,
+ "CorrectionInMs": null,
+ "LimitInWatts": null
+ },
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "PowerConsumedWatts": 175,
+ "@odata.id": "/redfish/v1/Chassis/1/Power",
+ "Status": {
+ "State": "Enabled",
+ "Health": "OK"
+ },
+ "PowerRequestedWatts": null,
+ "PowerAllocatedWatts": null,
+ "Oem": {}
+ },
+ {
+ "Name": "System Power Control",
+ "MemberId": "2",
+ "PowerCapacityWatts": 0,
+ "PowerAvailableWatts": null,
+ "PowerLimit": {
+ "LimitException": null,
+ "CorrectionInMs": null,
+ "LimitInWatts": null
+ },
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "PowerConsumedWatts": 0,
+ "@odata.id": "/redfish/v1/Chassis/1/Power",
+ "Status": {
+ "State": "UnavailableOffline",
+ "Health": "OK"
+ },
+ "PowerRequestedWatts": null,
+ "PowerAllocatedWatts": null,
+ "Oem": {}
+ }
+ ],
+ "Description": "Collection of Power",
+ "@odata.id": "/redfish/v1/Chassis/1/Power",
+ "Oem": {},
+ "Voltages": [
+ {
+ "LowerThresholdFatal": null,
+ "Name": "Voltage",
+ "MemberId": "1",
+ "LowerThresholdCritical": null,
+ "PhysicalContext": "VoltageRegulator",
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "@odata.id": "/redfish/v1/Chassis/1/Power",
+ "LowerThresholdNonCritical": null,
+ "SensorNumber": 1,
+ "Status": {
+ "State": "Enabled",
+ "Health": "OK"
+ },
+ "UpperThresholdNonCritical": null,
+ "UpperThresholdFatal": null,
+ "UpperThresholdCritical": null,
+ "ReadingVolts": 11.89
+ },
+ {
+ "LowerThresholdFatal": null,
+ "Name": "Voltage",
+ "MemberId": "2",
+ "LowerThresholdCritical": null,
+ "PhysicalContext": "VoltageRegulator",
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "@odata.id": "/redfish/v1/Chassis/1/Power",
+ "LowerThresholdNonCritical": null,
+ "SensorNumber": 2,
+ "Status": {
+ "State": "Enabled",
+ "Health": "OK"
+ },
+ "UpperThresholdNonCritical": null,
+ "UpperThresholdFatal": null,
+ "UpperThresholdCritical": null,
+ "ReadingVolts": 0
+ }
+ ]
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Chassis/1/Thermal/index.json b/mock-redfish-server/mockup/redfish/v1/Chassis/1/Thermal/index.json
new file mode 100644
index 0000000..91435c8
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Chassis/1/Thermal/index.json
@@ -0,0 +1,373 @@
+{
+ "Temperatures": [
+ {
+ "LowerThresholdFatal": null,
+ "PhysicalContext": "CPU",
+ "MemberId": "1",
+ "ReadingCelsius": 52,
+ "LowerThresholdCritical": null,
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "Name": "System CPU Thermal Sensor Temperature",
+ "@odata.id": "/redfish/v1/Chassis/1/Thermal",
+ "LowerThresholdNonCritical": null,
+ "SensorNumber": 1,
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": null,
+ "Health": "OK"
+ },
+ "UpperThresholdNonCritical": 82,
+ "UpperThresholdFatal": 104,
+ "UpperThresholdCritical": 92
+ },
+ {
+ "LowerThresholdFatal": null,
+ "PhysicalContext": "SystemBoard",
+ "MemberId": "2",
+ "ReadingCelsius": 38.5,
+ "LowerThresholdCritical": null,
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "Name": "Chassis Thermal Sensor Temperature",
+ "@odata.id": "/redfish/v1/Chassis/1/Thermal",
+ "LowerThresholdNonCritical": null,
+ "SensorNumber": 2,
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": null,
+ "Health": "OK"
+ },
+ "UpperThresholdNonCritical": 45,
+ "UpperThresholdFatal": 60,
+ "UpperThresholdCritical": 55
+ },
+ {
+ "LowerThresholdFatal": null,
+ "PhysicalContext": "SystemBoard",
+ "MemberId": "3",
+ "ReadingCelsius": 32.5,
+ "LowerThresholdCritical": null,
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "Name": "Chassis Thermal Sensor Temperature",
+ "@odata.id": "/redfish/v1/Chassis/1/Thermal",
+ "LowerThresholdNonCritical": null,
+ "SensorNumber": 3,
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": null,
+ "Health": "OK"
+ },
+ "UpperThresholdNonCritical": 45,
+ "UpperThresholdFatal": 60,
+ "UpperThresholdCritical": 55
+ },
+ {
+ "LowerThresholdFatal": null,
+ "PhysicalContext": "SystemBoard",
+ "MemberId": "4",
+ "ReadingCelsius": 33,
+ "LowerThresholdCritical": null,
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "Name": "Chassis Thermal Sensor Temperature",
+ "@odata.id": "/redfish/v1/Chassis/1/Thermal",
+ "LowerThresholdNonCritical": null,
+ "SensorNumber": 4,
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": null,
+ "Health": "OK"
+ },
+ "UpperThresholdNonCritical": 45,
+ "UpperThresholdFatal": 60,
+ "UpperThresholdCritical": 55
+ },
+ {
+ "LowerThresholdFatal": null,
+ "PhysicalContext": "SystemBoard",
+ "MemberId": "5",
+ "ReadingCelsius": 37,
+ "LowerThresholdCritical": null,
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "Name": "Chassis Thermal Sensor Temperature",
+ "@odata.id": "/redfish/v1/Chassis/1/Thermal",
+ "LowerThresholdNonCritical": null,
+ "SensorNumber": 5,
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": null,
+ "Health": "OK"
+ },
+ "UpperThresholdNonCritical": 45,
+ "UpperThresholdFatal": 60,
+ "UpperThresholdCritical": 55
+ },
+ {
+ "LowerThresholdFatal": null,
+ "PhysicalContext": "PowerSupply",
+ "MemberId": "6",
+ "ReadingCelsius": 31,
+ "LowerThresholdCritical": null,
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "Name": "PSU Thermal Sensor Temperature",
+ "@odata.id": "/redfish/v1/Chassis/1/Thermal",
+ "LowerThresholdNonCritical": null,
+ "SensorNumber": 6,
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": null,
+ "Health": "OK"
+ },
+ "UpperThresholdNonCritical": 45,
+ "UpperThresholdFatal": 60,
+ "UpperThresholdCritical": 55
+ },
+ {
+ "LowerThresholdFatal": null,
+ "PhysicalContext": "PowerSupply",
+ "MemberId": "7",
+ "ReadingCelsius": 0,
+ "LowerThresholdCritical": null,
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "Name": "PSU Thermal Sensor Temperature",
+ "@odata.id": "/redfish/v1/Chassis/1/Thermal",
+ "LowerThresholdNonCritical": null,
+ "SensorNumber": 7,
+ "Status": {
+ "State": "Absent",
+ "HealthRollup": null,
+ "Health": "Warning"
+ },
+ "UpperThresholdNonCritical": 0,
+ "UpperThresholdFatal": 0,
+ "UpperThresholdCritical": 0
+ }
+ ],
+ "Redundancy": [],
+ "@odata.type": "#Thermal.v1_1_0.Thermal",
+ "Name": "Thermal",
+ "@odata.context": "/redfish/v1/$metadata#Thermal.Thermal",
+ "Id": "Thermal",
+ "Fans": [
+ {
+ "LowerThresholdFatal": null,
+ "PhysicalContext": "Back",
+ "MemberId": "1",
+ "LowerThresholdCritical": null,
+ "ReadingUnits": "RPM",
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "Name": "System Fan",
+ "@odata.id": "/redfish/v1/Chassis/1/Thermal",
+ "LowerThresholdNonCritical": null,
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": null,
+ "Health": "OK"
+ },
+ "Reading": 12700,
+ "UpperThresholdNonCritical": null,
+ "UpperThresholdFatal": null,
+ "UpperThresholdCritical": null
+ },
+ {
+ "LowerThresholdFatal": null,
+ "PhysicalContext": "Back",
+ "MemberId": "2",
+ "LowerThresholdCritical": null,
+ "ReadingUnits": "RPM",
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "Name": "System Fan",
+ "@odata.id": "/redfish/v1/Chassis/1/Thermal",
+ "LowerThresholdNonCritical": null,
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": null,
+ "Health": "OK"
+ },
+ "Reading": 12400,
+ "UpperThresholdNonCritical": null,
+ "UpperThresholdFatal": null,
+ "UpperThresholdCritical": null
+ },
+ {
+ "LowerThresholdFatal": null,
+ "PhysicalContext": "Back",
+ "MemberId": "3",
+ "LowerThresholdCritical": null,
+ "ReadingUnits": "RPM",
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "Name": "System Fan",
+ "@odata.id": "/redfish/v1/Chassis/1/Thermal",
+ "LowerThresholdNonCritical": null,
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": null,
+ "Health": "OK"
+ },
+ "Reading": 12700,
+ "UpperThresholdNonCritical": null,
+ "UpperThresholdFatal": null,
+ "UpperThresholdCritical": null
+ },
+ {
+ "LowerThresholdFatal": null,
+ "PhysicalContext": "Back",
+ "MemberId": "4",
+ "LowerThresholdCritical": null,
+ "ReadingUnits": "RPM",
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "Name": "System Fan",
+ "@odata.id": "/redfish/v1/Chassis/1/Thermal",
+ "LowerThresholdNonCritical": null,
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": null,
+ "Health": "OK"
+ },
+ "Reading": 12700,
+ "UpperThresholdNonCritical": null,
+ "UpperThresholdFatal": null,
+ "UpperThresholdCritical": null
+ },
+ {
+ "LowerThresholdFatal": null,
+ "PhysicalContext": "Back",
+ "MemberId": "5",
+ "LowerThresholdCritical": null,
+ "ReadingUnits": "RPM",
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "Name": "System Fan",
+ "@odata.id": "/redfish/v1/Chassis/1/Thermal",
+ "LowerThresholdNonCritical": null,
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": null,
+ "Health": "OK"
+ },
+ "Reading": 12600,
+ "UpperThresholdNonCritical": null,
+ "UpperThresholdFatal": null,
+ "UpperThresholdCritical": null
+ },
+ {
+ "LowerThresholdFatal": null,
+ "PhysicalContext": "Back",
+ "MemberId": "6",
+ "LowerThresholdCritical": null,
+ "ReadingUnits": "RPM",
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "Name": "System Fan",
+ "@odata.id": "/redfish/v1/Chassis/1/Thermal",
+ "LowerThresholdNonCritical": null,
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": null,
+ "Health": "OK"
+ },
+ "Reading": 12700,
+ "UpperThresholdNonCritical": null,
+ "UpperThresholdFatal": null,
+ "UpperThresholdCritical": null
+ },
+ {
+ "LowerThresholdFatal": null,
+ "PhysicalContext": "PowerSupply",
+ "MemberId": "7",
+ "LowerThresholdCritical": null,
+ "ReadingUnits": "RPM",
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "Name": "PSU Fan",
+ "@odata.id": "/redfish/v1/Chassis/1/Thermal",
+ "LowerThresholdNonCritical": null,
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": null,
+ "Health": "OK"
+ },
+ "Reading": 24480,
+ "UpperThresholdNonCritical": null,
+ "UpperThresholdFatal": null,
+ "UpperThresholdCritical": null
+ },
+ {
+ "LowerThresholdFatal": null,
+ "PhysicalContext": "PowerSupply",
+ "MemberId": "8",
+ "LowerThresholdCritical": null,
+ "ReadingUnits": "RPM",
+ "RelatedItem": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "Name": "PSU Fan",
+ "@odata.id": "/redfish/v1/Chassis/1/Thermal",
+ "LowerThresholdNonCritical": null,
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": null,
+ "Health": "Warning"
+ },
+ "Reading": 0,
+ "UpperThresholdNonCritical": null,
+ "UpperThresholdFatal": null,
+ "UpperThresholdCritical": null
+ }
+ ],
+ "Description": "Collection of Thermal sensors",
+ "@odata.id": "/redfish/v1/Chassis/1/Thermal"
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Chassis/1/index.json b/mock-redfish-server/mockup/redfish/v1/Chassis/1/index.json
new file mode 100644
index 0000000..2311f64
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Chassis/1/index.json
@@ -0,0 +1,85 @@
+{
+ "SerialNumber": "EC1721000216",
+ "Power": {
+ "@odata.id": "/redfish/v1/Chassis/1/Power"
+ },
+ "Name": "Chassis",
+ "Links": {
+ "@odata.type": "#Chassis.v1_2_0.Links",
+ "Storage": [
+ {
+ "@odata.id": "/redfish/v1/Systems/1/Storage/1"
+ }
+ ],
+ "ComputerSystems": [
+ {
+ "@odata.id": "/redfish/v1/Systems/1"
+ }
+ ],
+ "ManagedBy": [
+ {
+ "@odata.id": "/redfish/v1/Managers/1"
+ }
+ ],
+ "Oem": {
+ "Intel_RackScale": {
+ "Switches": [
+ {
+ "@odata.id": "/redfish/v1/EthernetSwitches/1"
+ }
+ ],
+ "@odata.type": "#Intel.Oem.ChassisLinks"
+ }
+ },
+ "Contains": [],
+ "Drives": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1/Drives/1"
+ }
+ ]
+ },
+ "Id": "1",
+ "IndicatorLED": "Lit",
+ "@odata.type": "#Chassis.v1_3_0.Chassis",
+ "Model": "x86_64-accton_asfx816bbx_0716-ec",
+ "PowerState": "On",
+ "Actions": {
+ "#Chassis.Reset": {
+ "target": "/redfish/v1/Chassis/1/Actions/Chassis.Reset",
+ "ResetType@Redfish.AllowableValues": [
+ "ForceOff",
+ "GracefulShutdown",
+ "GracefulRestart",
+ "ForceRestart"
+ ]
+ }
+ },
+ "Thermal": {
+ "@odata.id": "/redfish/v1/Chassis/1/Thermal"
+ },
+ "Description": "",
+ "@odata.id": "/redfish/v1/Chassis/1",
+ "SKU": null,
+ "@odata.context": "/redfish/v1/$metadata#Chassis.Chassis",
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": "OK",
+ "Health": "OK"
+ },
+ "Manufacturer": "Accton",
+ "ChassisType": "Drawer",
+ "Oem": {
+ "Intel_RackScale": {
+ "Location": {
+ "ParentId": null,
+ "Id": null
+ },
+ "@odata.type": "#Intel.Oem.Chassis",
+ "Accton_Oem": {
+ "ServiceTag": ""
+ }
+ }
+ },
+ "AssetTag": "N/A",
+ "PartNumber": ""
+}
\ No newline at end of file