Set system, chassis, and bmc as global variables
Changes:
- Add SYSTEM_ID as a global variable and set to default value system
- Replace redfish/v1/Systems/system to redfish/v1/Systems/SYSTEM_ID
- Replace redfish/v1/Chassis/chassis to redfish/v1/Chassis/CHASSIS_ID
- Replace redfish/v1/Managers/bmc to redfish/v1/Managers/MANAGER_ID
Tested:
- Tested on sandbox with the changes with sample test run with
sample test ID runs
1. without SYSTEM_ID provided
2. with -v SYSTEM_ID:system1
3. with export SYSTEM_ID=""
3. with export SYSTEM_ID="system2"
Change-Id: Ifc412b20038cef1eba632caaa6c300be328259bd
Signed-off-by: Wilson Suen <wilsons@supermicro.com>
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/bmc_redfish_utils.robot b/lib/bmc_redfish_utils.robot
index a9ca187..c8e9ac4 100644
--- a/lib/bmc_redfish_utils.robot
+++ b/lib/bmc_redfish_utils.robot
@@ -32,7 +32,7 @@
# }
# }
- ${target}= redfish_utils.Get Target Actions /redfish/v1/Systems/system/ ComputerSystem.Reset
+ ${target}= redfish_utils.Get Target Actions /redfish/v1/Systems/${SYSTEM_ID}/ ComputerSystem.Reset
${payload}= Create Dictionary ResetType=${reset_type}
${resp}= Redfish.Post ${target} body=&{payload}
... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
@@ -60,7 +60,7 @@
Reset BIOS Via Redfish
[Documentation] Do BIOS reset through Redfish.
- ${target}= redfish_utils.Get Target Actions /redfish/v1/Systems/system/Bios/ Bios.ResetBios
+ ${target}= redfish_utils.Get Target Actions /redfish/v1/Systems/${SYSTEM_ID}/Bios/ Bios.ResetBios
Redfish.Post ${target} valid_status_codes=[${HTTP_OK}]
@@ -173,7 +173,7 @@
# fru_type The type of fru (e.g. "Processors", "Memory", etc.).
${fru_records}= Redfish_Utils.Enumerate Request
- ... /redfish/v1/Systems/system/${fru_type} return_json=0
+ ... /redfish/v1/Systems/${SYSTEM_ID}/${fru_type} return_json=0
${fru_records}= Filter Struct ${fru_records} [('State', 'Enabled'), ('Health', 'OK')]
[Return] ${fru_records}