Managers ID : Introduced variable to declare Managers ID in resource.robot and updated all the scripts in openbmc-test-automation
Changes:
- Introduced ${MANAGER_ID} variable in resource.robot
- Replaced all the Managers/bmc to Managers/${MANAGER_ID} across all the scripts
- Also in data/variables.py updated chassis id for the few redfish uri.
Tested:
- Ran All The Scripts Successfully
Change-Id: Iff3673aae27657e0799dec5cb94c1651a0cd5d18
Signed-off-by: ganesanb <ganesanb@ami.com>
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/redfish/managers/test_bmc_dumps.robot b/redfish/managers/test_bmc_dumps.robot
index 3fa4382..c570a8c 100644
--- a/redfish/managers/test_bmc_dumps.robot
+++ b/redfish/managers/test_bmc_dumps.robot
@@ -52,12 +52,12 @@
Redfish Power Off stack_mode=skip
${dump_id}= Create User Initiated BMC Dump Via Redfish
- ${resp}= Redfish.Get Properties /redfish/v1/Managers/bmc/LogServices/Dump/Entries/${dump_id}
+ ${resp}= Redfish.Get Properties /redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries/${dump_id}
# Example of response from above Redfish GET request.
# "@odata.type": "#LogEntry.v1_7_0.LogEntry",
# "AdditionalDataSizeBytes": 31644,
- # "AdditionalDataURI": "/redfish/v1/Managers/bmc/LogServices/Dump/attachment/9",
+ # "AdditionalDataURI": "/redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/attachment/9",
# "Created": "2020-10-23T06:32:53+00:00",
# "DiagnosticDataType": "Manager",
# "EntryType": "Event",
@@ -87,7 +87,7 @@
# Max size for dump is 20 MB = 20x1024x1024 Byte.
${resp}= Redfish.Get Properties
- ... /redfish/v1/Managers/bmc/LogServices/Dump/Entries/${dump_entries[0]}
+ ... /redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries/${dump_entries[0]}
Should Be True 0 < ${resp["AdditionalDataSizeBytes"]} < 20971520
@@ -153,13 +153,13 @@
Redfish Power Off stack_mode=skip
Create User Initiated BMC Dump Via Redfish
- ${dump_entries_before}= redfish_utils.get_member_list /redfish/v1/Managers/bmc/LogServices/Dump/Entries
+ ${dump_entries_before}= redfish_utils.get_member_list /redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries
# Restart dump service.
BMC Execute Command systemctl restart xyz.openbmc_project.Dump.Manager.service
Sleep 10s reason=Wait for BMC dump service to restart properly
- ${dump_entries_after}= redfish_utils.get_member_list /redfish/v1/Managers/bmc/LogServices/Dump/Entries
+ ${dump_entries_after}= redfish_utils.get_member_list /redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries
Lists Should Be Equal ${dump_entries_before} ${dump_entries_after}
@@ -171,12 +171,12 @@
Redfish Power Off stack_mode=skip
Create User Initiated BMC Dump Via Redfish
- ${dump_entries_before}= redfish_utils.get_member_list /redfish/v1/Managers/bmc/LogServices/Dump/Entries
+ ${dump_entries_before}= redfish_utils.get_member_list /redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries
# Reset BMC.
OBMC Reboot (off) stack_mode=skip
- ${dump_entries_after}= redfish_utils.get_member_list /redfish/v1/Managers/bmc/LogServices/Dump/Entries
+ ${dump_entries_after}= redfish_utils.get_member_list /redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries
Lists Should Be Equal ${dump_entries_before} ${dump_entries_after}
@@ -265,7 +265,7 @@
# Check error while creating dump when dump size is full.
${payload}= Create Dictionary DiagnosticDataType=Manager
- Redfish.Post /redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.CollectDiagnosticData
+ Redfish.Post /redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Actions/LogService.CollectDiagnosticData
... body=${payload} valid_status_codes=[${HTTP_INTERNAL_SERVER_ERROR}]
@@ -297,7 +297,7 @@
Wait Until Keyword Succeeds 2 min 10 sec Is BMC Dump Available
${dump_entries}= Get BMC Dump Entries
${resp}= Redfish.Get Properties
- ... /redfish/v1/Managers/bmc/LogServices/Dump/Entries/${dump_entries[0]}
+ ... /redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries/${dump_entries[0]}
# Max size for dump is 20 MB = 20x1024x1024 Byte.
Should Be True 0 < ${resp["AdditionalDataSizeBytes"]} < 20971520
@@ -313,7 +313,7 @@
# Check error while initiating BMC dump while dump in progress.
${payload}= Create Dictionary DiagnosticDataType=Manager
Redfish.Post
- ... /redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.CollectDiagnosticData
+ ... /redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Actions/LogService.CollectDiagnosticData
... body=${payload} valid_status_codes=[${HTTP_SERVICE_UNAVAILABLE}]
# Wait for above initiated dump to complete. Otherwise, on going dump would impact next test.
@@ -336,7 +336,7 @@
${task_dict}= Redfish.Get Properties /redfish/v1/TaskService/Tasks/${task_id}
IF '${task_dict['TaskState']}' == 'Completed' BREAK
${resp}= Redfish.Post
- ... /redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.CollectDiagnosticData
+ ... /redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Actions/LogService.CollectDiagnosticData
... body=${payload} valid_status_codes=[${HTTP_SERVICE_UNAVAILABLE}, ${HTTP_ACCEPTED}]
# Sample response of above POST request:
@@ -385,7 +385,7 @@
# Wait for few seconds before initiating the dump.
Sleep 2s
${resp}= Redfish.Post
- ... /redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.CollectDiagnosticData
+ ... /redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Actions/LogService.CollectDiagnosticData
... body=${payload} valid_status_codes=[${HTTP_ACCEPTED}]
# Wait for above initiated dump to complete. Otherwise, on going dump would impact next test.
@@ -461,7 +461,7 @@
Get BMC Dump Entries
[Documentation] Return BMC dump ids list.
- ${dump_uris}= redfish_utils.get_member_list /redfish/v1/Managers/bmc/LogServices/Dump/Entries
+ ${dump_uris}= redfish_utils.get_member_list /redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries
${dump_ids}= Create List
FOR ${dump_uri} IN @{dump_uris}
diff --git a/redfish/managers/test_bmc_ipv6.robot b/redfish/managers/test_bmc_ipv6.robot
index edabf98..8ab1f92 100644
--- a/redfish/managers/test_bmc_ipv6.robot
+++ b/redfish/managers/test_bmc_ipv6.robot
@@ -105,7 +105,7 @@
[Documentation] Get Ipv6 network configuration.
# Sample output:
# {
- # "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0",
+ # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0",
# "@odata.type": "#EthernetInterface.v1_4_1.EthernetInterface",
# "DHCPv4": {
# "DHCPEnabled": false,
@@ -176,7 +176,7 @@
# "State": "Enabled"
# },
# "VLANs": {
- # "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0/VLANs"
+ # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0/VLANs"
${active_channel_config}= Get Active Channel Config
diff --git a/redfish/managers/test_certificate.robot b/redfish/managers/test_certificate.robot
index dd2c6d4..4f62eb4 100644
--- a/redfish/managers/test_certificate.robot
+++ b/redfish/managers/test_certificate.robot
@@ -84,7 +84,7 @@
[Teardown] Run Keywords FFDC On Test Case Fail AND Delete All CA Certificate Via Redfish
# Get CA certificate count from BMC.
- ${cert_list}= Redfish_Utils.Get Member List /redfish/v1/Managers/bmc/Truststore/Certificates
+ ${cert_list}= Redfish_Utils.Get Member List /redfish/v1/Managers/${MANAGER_ID}/Truststore/Certificates
${cert_count}= Get Length ${cert_list}
# Install CA certificate to reach maximum count of 10.
@@ -125,7 +125,7 @@
${file_data}= Decode Bytes To String ${bytes} UTF-8
${certificate_dict}= Create Dictionary
- ... @odata.id=/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates/1
+ ... @odata.id=/redfish/v1/Managers/${MANAGER_ID}/NetworkProtocol/HTTPS/Certificates/1
${payload}= Create Dictionary CertificateString=${file_data}
... CertificateType=PEM CertificateUri=${certificate_dict}
@@ -239,7 +239,7 @@
${Links}= Get From Dictionary ${resp.dict} Links
${match_cert}= Catenate
- ... /redfish/v1/Managers/bmc/Truststore/Certificates/${cert_id}
+ ... /redfish/v1/Managers/${MANAGER_ID}/Truststore/Certificates/${cert_id}
${match}= Set Variable ${False}
FOR ${Certificates_dict} IN @{Links['Certificates']}
@@ -263,7 +263,7 @@
Restore BMC Date
[Documentation] Restore BMC date to its prior value.
- Redfish.Patch ${REDFISH_BASE_URI}Managers/bmc body={'DateTime': '${cli_date_time}'}
+ Redfish.Patch ${REDFISH_BASE_URI}Managers/${MANAGER_ID} body={'DateTime': '${cli_date_time}'}
... valid_status_codes=[${HTTP_OK}]
diff --git a/redfish/managers/test_managers_bmc.robot b/redfish/managers/test_managers_bmc.robot
index a19a12b..9cd1bdd 100644
--- a/redfish/managers/test_managers_bmc.robot
+++ b/redfish/managers/test_managers_bmc.robot
@@ -27,7 +27,7 @@
[Tags] Verify_Redfish_BMC_Firmware_Version
Redfish.Login
- ${resp}= Redfish.Get /redfish/v1/Managers/bmc
+ ${resp}= Redfish.Get /redfish/v1/Managers/${MANAGER_ID}
Should Be Equal As Strings ${resp.status} ${HTTP_OK}
${bmc_version}= Get BMC Version
Should Be Equal As Strings
@@ -39,7 +39,7 @@
[Tags] Verify_Redfish_BMC_Manager_Properties
Redfish.Login
- ${resp}= Redfish.Get /redfish/v1/Managers/bmc
+ ${resp}= Redfish.Get /redfish/v1/Managers/${MANAGER_ID}
Should Be Equal As Strings ${resp.status} ${HTTP_OK}
# Example:
# "Description": "Baseboard Management Controller"
@@ -83,12 +83,12 @@
... ${active_channel_config["${channel_number}"]["is_valid"]}==${FALSE}
# Get ethernet valid paths in redfish.
- # Example: ['/redfish/v1/Managers/bmc/EthernetInterfaces']
+ # Example: ['/redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces']
${eth_interface}= redfish_utils.Get Endpoint Path List
... /redfish/v1/Managers/ EthernetInterfaces
# Get the MACAddress attrivute value with the 'name': 'eth0'.
- # Example: /redfish/v1/Managers/bmc/EthernetInterfaces/eth0
+ # Example: /redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0
${redfish_mac_addr}= Redfish.Get Attribute
... ${eth_interface[0]}/${active_channel_config["${channel_number}"]["name"]}
... MACAddress
@@ -113,7 +113,7 @@
# "GracefulRestart",
# "ForceRestart"
# ],
- # "target": "/redfish/v1/Managers/bmc/Actions/Manager.Reset"
+ # "target": "/redfish/v1/Managers/${MANAGER_ID}/Actions/Manager.Reset"
# }
${test_file_path}= Set Variable /tmp/before_bmcreboot
@@ -143,7 +143,7 @@
# "GracefulRestart",
# "ForceRestart"
# ],
- # "target": "/redfish/v1/Managers/bmc/Actions/Manager.Reset"
+ # "target": "/redfish/v1/Managers/${MANAGER_ID}/Actions/Manager.Reset"
# }
${test_file_path}= Set Variable /tmp/before_bmcreboot
diff --git a/redfish/managers/test_managers_bmc_time.robot b/redfish/managers/test_managers_bmc_time.robot
index eea7496..a9796f9 100644
--- a/redfish/managers/test_managers_bmc_time.robot
+++ b/redfish/managers/test_managers_bmc_time.robot
@@ -201,7 +201,7 @@
Redfish Get DateTime
[Documentation] Returns BMC Datetime value from Redfish.
- ${date_time}= Redfish.Get Attribute ${REDFISH_BASE_URI}Managers/bmc DateTime
+ ${date_time}= Redfish.Get Attribute ${REDFISH_BASE_URI}Managers/${MANAGER_ID} DateTime
[Return] ${date_time}
@@ -225,7 +225,7 @@
... ELSE
... Set Variable ${date_time}
Wait Until Keyword Succeeds 1min 5sec
- ... Redfish.Patch ${REDFISH_BASE_URI}Managers/bmc body={'DateTime': '${date_time}'} &{kwargs}
+ ... Redfish.Patch ${REDFISH_BASE_URI}Managers/${MANAGER_ID} body={'DateTime': '${date_time}'} &{kwargs}
Set Time To Manual Mode
@@ -312,7 +312,7 @@
Should Be True '${time_diff}'<='3'
Verify NTP Servers Are Populated
- [Documentation] Redfish GET request /redfish/v1/Managers/bmc/NetworkProtocol response
+ [Documentation] Redfish GET request /redfish/v1/Managers/${MANAGER_ID}/NetworkProtocol response
... and verify if NTP servers are populated.
${network_protocol}= Redfish.Get Properties ${REDFISH_NW_PROTOCOL_URI}
diff --git a/redfish/managers/test_multiple_interfaces_dhcp.robot b/redfish/managers/test_multiple_interfaces_dhcp.robot
index 35baaec..da4bfc6 100644
--- a/redfish/managers/test_multiple_interfaces_dhcp.robot
+++ b/redfish/managers/test_multiple_interfaces_dhcp.robot
@@ -54,7 +54,7 @@
${data}= Set Variable If ${dhcp_enabled} == ${False} ${DISABLE_DHCP} ${ENABLE_DHCP}
${resp}= Redfish.Patch
- ... /redfish/v1/Managers/bmc/EthernetInterfaces/${interface}
+ ... /redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/${interface}
... body=${data} valid_status_codes=${valid_status_code}
Suite Setup Execution