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/Managers/1/EthernetInterfaces/1/index.json b/mock-redfish-server/mockup/redfish/v1/Managers/1/EthernetInterfaces/1/index.json
new file mode 100644
index 0000000..e355abc
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Managers/1/EthernetInterfaces/1/index.json
@@ -0,0 +1,81 @@
+{
+ "FQDN": "localhost",
+ "IPv6StaticDefaultGateways": [],
+ "Name": "Manager NIC",
+ "MACAddress": "a8:2b:b5:36:78:6c",
+ "StatelessAddressAutoConfig": {
+ "IPv6AutoConfigEnabled": false
+ },
+ "MaxIPv6StaticAddresses": null,
+ "NameServers": [
+ "8.8.8.8"
+ ],
+ "IPv6DefaultGateway": "",
+ "HostName": "localhost",
+ "IPv4StaticAddresses": [
+ {
+ "Address": "10.90.0.114"
+ }
+ ],
+ "IPv6StaticAddresses": [],
+ "@odata.id": "/redfish/v1/Managers/1/EthernetInterfaces/1",
+ "SpeedMbps": 1000,
+ "Links": {
+ "Oem": {
+ "Intel_RackScale": {
+ "@odata.type": "#Intel.Oem.EthernetInterface"
+ }
+ },
+ "Endpoints": []
+ },
+ "Oem": {},
+ "InterfaceEnabled": true,
+ "IPv6Addresses": [
+ {
+ "PrefixLength": 64,
+ "AddressOrigin": "LinkLocal",
+ "Address": "fe80::aa2b:b5ff:fe36:786c",
+ "AddressState": null
+ }
+ ],
+ "MTUSize": 1500,
+ "StaticNameServers": [
+ "8.8.8.8"
+ ],
+ "LinkStatus": "LinkUp",
+ "Id": "1",
+ "PermanentMACAddress": "a8:2b:b5:36:78:6c",
+ "Description": "Manager NIC description",
+ "AutoNeg": true,
+ "IPv6AddressPolicyTable": [],
+ "IPv4Addresses": [
+ {
+ "AddressOrigin": "Static",
+ "Gateway": "10.90.0.1",
+ "Address": "10.90.0.114",
+ "SubnetMask": "255.255.0.0"
+ }
+ ],
+ "DHCPv6": {
+ "OperatingMode": "Disabled",
+ "UseDNSServers": false,
+ "UseRapidCommit": false,
+ "UseNTPServers": false
+ },
+ "@odata.type": "#EthernetInterface.v1_4_0.EthernetInterface",
+ "@odata.context": "/redfish/v1/$metadata#EthernetInterface.EthernetInterface",
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": "OK",
+ "Health": "OK"
+ },
+ "FullDuplex": true,
+ "DHCPv4": {
+ "UseDNSServers": true,
+ "DHCPEnabled": false,
+ "UseNTPServers": false,
+ "UseDomainName": false,
+ "UseGateway": true,
+ "UseStaticRoutes": false
+ }
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Managers/1/EthernetInterfaces/index.json b/mock-redfish-server/mockup/redfish/v1/Managers/1/EthernetInterfaces/index.json
new file mode 100644
index 0000000..47106fd
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Managers/1/EthernetInterfaces/index.json
@@ -0,0 +1,13 @@
+{
+ "@odata.type": "#EthernetInterfaceCollection.EthernetInterfaceCollection",
+ "Name": "Ethernet Network Interface Collection",
+ "@odata.context": "/redfish/v1/$metadata#EthernetInterfaceCollection.EthernetInterfaceCollection",
+ "Members": [
+ {
+ "@odata.id": "/redfish/v1/Managers/1/EthernetInterfaces/1"
+ }
+ ],
+ "Description": "a Collection of Manager Ethernet Interfaces",
+ "@odata.id": "/redfish/v1/Managers/1/EthernetInterfaces",
+ "Members@odata.count": 1
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Managers/1/LogServices/1/Entries/index.json b/mock-redfish-server/mockup/redfish/v1/Managers/1/LogServices/1/Entries/index.json
new file mode 100644
index 0000000..9f99983
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Managers/1/LogServices/1/Entries/index.json
@@ -0,0 +1,9 @@
+{
+ "@odata.type": "#LogEntryCollection.LogEntryCollection",
+ "Name": "Log Service Collection",
+ "@odata.context": "/redfish/v1/$metadata#LogEntryCollection.LogEntryCollection",
+ "Members": [],
+ "Description": "Collection of Logs for this System",
+ "@odata.id": "/redfish/v1/Managers/1/LogServices/1/Entries",
+ "Members@odata.count": 0
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Managers/1/LogServices/1/index.json b/mock-redfish-server/mockup/redfish/v1/Managers/1/LogServices/1/index.json
new file mode 100644
index 0000000..17be88a
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Managers/1/LogServices/1/index.json
@@ -0,0 +1,25 @@
+{
+ "DateTime": "2020-04-07T00:42:53+00:00",
+ "ServiceEnabled": false,
+ "Name": "System Log Service",
+ "DateTimeLocalOffset": "+00:00",
+ "Id": "1",
+ "Description": "ONL Peripheral Log",
+ "Actions": {
+ "#LogService.ClearLog": {
+ "target": "/redfish/v1/Managers/1/LogServices/1/Actions/LogService.Reset"
+ }
+ },
+ "MaxNumberOfRecords": 1000,
+ "Entries": {
+ "@odata.id": "/redfish/v1/Managers/1/LogServices/1/Entries"
+ },
+ "@odata.type": "#LogService.v1_0_0.LogService",
+ "@odata.context": "/redfish/v1/$metadata#LogService.LogService",
+ "Status": {
+ "State": "Enabled",
+ "Health": "OK"
+ },
+ "OverWritePolicy": "WrapsWhenFull",
+ "@odata.id": "/redfish/v1/Managers/1/LogServices/1"
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Managers/1/LogServices/index.json b/mock-redfish-server/mockup/redfish/v1/Managers/1/LogServices/index.json
new file mode 100644
index 0000000..6d4cc47
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Managers/1/LogServices/index.json
@@ -0,0 +1,13 @@
+{
+ "@odata.type": "#LogServiceCollection.LogServiceCollection",
+ "Name": "Log Service Collection",
+ "@odata.context": "/redfish/v1/$metadata##LogServiceCollection.LogServiceCollection",
+ "Members": [
+ {
+ "@odata.id": "/redfish/v1/Managers/1/LogServices/1"
+ }
+ ],
+ "Description": "Collection of Log Services for this Manager",
+ "@odata.id": "/redfish/v1/Managers/1/LogServices",
+ "Members@odata.count": 1
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Managers/1/NetworkProtocol/index.json b/mock-redfish-server/mockup/redfish/v1/Managers/1/NetworkProtocol/index.json
new file mode 100644
index 0000000..817e576
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Managers/1/NetworkProtocol/index.json
@@ -0,0 +1,55 @@
+{
+ "VirtualMedia": {
+ "ProtocolEnabled": null,
+ "Port": null
+ },
+ "FQDN": "localhost",
+ "SSDP": {
+ "NotifyTTL": 2,
+ "NotifyIPv6Scope": null,
+ "NotifyMulticastIntervalSeconds": 0,
+ "ProtocolEnabled": true,
+ "Port": 1900
+ },
+ "Name": "Manager Network Protocol",
+ "SNMP": {
+ "ProtocolEnabled": true,
+ "Port": 161
+ },
+ "IPMI": {
+ "ProtocolEnabled": null,
+ "Port": null
+ },
+ "Id": "NetworkProtocol",
+ "Description": "Manager Network Protocol description",
+ "KVMIP": {
+ "ProtocolEnabled": null,
+ "Port": null
+ },
+ "HTTP": {
+ "ProtocolEnabled": null,
+ "Port": null
+ },
+ "SSH": {
+ "ProtocolEnabled": true,
+ "Port": 22
+ },
+ "HostName": "localhost",
+ "HTTPS": {
+ "ProtocolEnabled": true,
+ "Port": 8888
+ },
+ "@odata.type": "#ManagerNetworkProtocol.v1_0_2.ManagerNetworkProtocol",
+ "Telnet": {
+ "ProtocolEnabled": null,
+ "Port": null
+ },
+ "@odata.context": "/redfish/v1/$metadata#ManagerNetworkProtocol.ManagerNetworkProtocol",
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": "OK",
+ "Health": "OK"
+ },
+ "@odata.id": "/redfish/v1/Managers/1/NetworkProtocol",
+ "Oem": {}
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Managers/1/SerialInterfaces/1/index.json b/mock-redfish-server/mockup/redfish/v1/Managers/1/SerialInterfaces/1/index.json
new file mode 100644
index 0000000..83a1e9a
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Managers/1/SerialInterfaces/1/index.json
@@ -0,0 +1,17 @@
+{
+ "FlowControl": "None",
+ "Name": "Manager Serial Interface",
+ "Parity": "None",
+ "Id": "1",
+ "DataBits": "8",
+ "Description": "Management for Serial Interface",
+ "PinOut": "Cyclades",
+ "BitRate": "115200",
+ "@odata.type": "#SerialInterface.v1_0_2.SerialInterface",
+ "@odata.context": "/redfish/v1/$metadata#SerialInterface.SerialInterface",
+ "StopBits": "1",
+ "@odata.id": "/redfish/v1/Managers/1/SerialInterfaces/1",
+ "SignalType": "Rs232",
+ "ConnectorType": "RJ45",
+ "InterfaceEnabled": true
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Managers/1/SerialInterfaces/index.json b/mock-redfish-server/mockup/redfish/v1/Managers/1/SerialInterfaces/index.json
new file mode 100644
index 0000000..de489c4
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Managers/1/SerialInterfaces/index.json
@@ -0,0 +1,13 @@
+{
+ "@odata.type": "#SerialInterfaceCollection.SerialInterfaceCollection",
+ "Name": "Serial Interface Collection",
+ "@odata.context": "/redfish/v1/$metadata#SerialInterfaceCollection.SerialInterfaceCollection",
+ "Members": [
+ {
+ "@odata.id": "/redfish/v1/Managers/1/SerialInterfaces/1"
+ }
+ ],
+ "Description": "a Collection of Serial Interfaces",
+ "@odata.id": "/redfish/v1/Managers/1/SerialInterfaces",
+ "Members@odata.count": 1
+}
\ No newline at end of file
diff --git a/mock-redfish-server/mockup/redfish/v1/Managers/1/index.json b/mock-redfish-server/mockup/redfish/v1/Managers/1/index.json
new file mode 100644
index 0000000..8f18664
--- /dev/null
+++ b/mock-redfish-server/mockup/redfish/v1/Managers/1/index.json
@@ -0,0 +1,62 @@
+{
+ "DateTime": "2020-04-07T00:42:37+00:00",
+ "Name": "Manager",
+ "Links": {
+ "Oem": {
+ "Intel_RackScale": {
+ "ManagerForServices": [],
+ "@odata.type": "#Intel.Oem.ManagerLinks",
+ "ManagerForSwitches": [
+ {
+ "@odata.id": "/redfish/v1/EthernetSwitches/1"
+ }
+ ]
+ }
+ },
+ "ManagerForServers": [
+ {
+ "@odata.id": "/redfish/v1/Systems/1"
+ }
+ ],
+ "ManagerForChassis": [
+ {
+ "@odata.id": "/redfish/v1/Chassis/1"
+ }
+ ],
+ "@odata.type": "#Manager.v1_0_0.Links"
+ },
+ "DateTimeLocalOffset": "+00:00",
+ "Id": "1",
+ "FirmwareVersion": "2.1.3.59.25",
+ "Description": "Manager description",
+ "Model": null,
+ "NetworkProtocol": {
+ "@odata.id": "/redfish/v1/Managers/1/NetworkProtocol"
+ },
+ "SerialConsole": {
+ "ConnectTypesSupported": [],
+ "ServiceEnabled": true,
+ "MaxConcurrentSessions": 0
+ },
+ "UUID": "d6fee3aa-785f-11ea-8e4b-af25952f929b",
+ "@odata.type": "#Manager.v1_0_0.Manager",
+ "@odata.context": "/redfish/v1/$metadata#Manager.Manager",
+ "Status": {
+ "State": "Enabled",
+ "HealthRollup": "OK",
+ "Health": "OK"
+ },
+ "EthernetInterfaces": {
+ "@odata.id": "/redfish/v1/Managers/1/EthernetInterfaces"
+ },
+ "ServiceEntryPointUUID": "d6fee3aa-785f-11ea-8e4b-af25952f929b",
+ "@odata.id": "/redfish/v1/Managers/1",
+ "Oem": {},
+ "SerialInterfaces": {
+ "@odata.id": "/redfish/v1/Managers/1/SerialInterfaces"
+ },
+ "LogServices": {
+ "@odata.id": "/redfish/v1/Managers/1/LogServices"
+ },
+ "ManagerType": "EnclosureManager"
+}
\ No newline at end of file