New BMC redfish library integration
Changes:
- Use redfish_plus.py when importing Redfish instances.
- Update bmc_redfish.py.
- Update bmc_redfish_utility.py.
- Update object name 'redfish' to 'Redfish'.
- Update test setup and teardown in suites.
- Update response error checking using valid_status_codes.
- Fix test cases required for migration.
Change-Id: Ida154aede649d9a2bbef66d16ccf725f5ea37ed0
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/redfish/managers/test_bmc_network_conf.robot b/redfish/managers/test_bmc_network_conf.robot
index 5e4b70c..6891e6e 100644
--- a/redfish/managers/test_bmc_network_conf.robot
+++ b/redfish/managers/test_bmc_network_conf.robot
@@ -37,7 +37,7 @@
[Documentation] Get MAC address and verify it's existence on the BMC.
[Tags] Get_MAC_Address_And_Verify
- ${resp}= redfish.Get ${REDFISH_NW_ETH0_URI}
+ ${resp}= Redfish.Get ${REDFISH_NW_ETH0_URI}
${macaddr}= Get From Dictionary ${resp.dict} MACAddress
Validate MAC On BMC ${macaddr}
@@ -54,7 +54,7 @@
Test Setup Execution
[Documentation] Test setup execution.
- redfish.Login
+ Redfish.Login
@{network_configurations}= Get Network Configuration
Set Test Variable @{network_configurations}
@@ -96,7 +96,7 @@
# "VLANId": 0
# }
- ${resp}= redfish.Get ${REDFISH_NW_ETH0_URI}
+ ${resp}= Redfish.Get ${REDFISH_NW_ETH0_URI}
@{network_configurations}= Get From Dictionary ${resp.dict} IPv4Addresses
[Return] @{network_configurations}
@@ -162,4 +162,4 @@
[Documentation] Test teardown execution.
FFDC On Test Case Fail
- redfish.Logout
+ Redfish.Logout
diff --git a/redfish/managers/test_managers_bmc.robot b/redfish/managers/test_managers_bmc.robot
index 3c65884..9f2f29b 100644
--- a/redfish/managers/test_managers_bmc.robot
+++ b/redfish/managers/test_managers_bmc.robot
@@ -4,8 +4,8 @@
Resource ../../lib/common_utils.robot
Resource ../../lib/openbmc_ffdc.robot
-Test Teardown FFDC On Test Case Fail
-Suite Teardown redfish.Logout
+Test Setup Test Setup Execution
+Test Teardown Redfish.Logout
*** Test Cases ***
@@ -13,21 +13,20 @@
[Documentation] Get firmware version from BMC manager.
[Tags] Verify_Redfish_BMC_Firmware_Version
- redfish.Login
- ${resp}= redfish.Get /redfish/v1/Managers/bmc
+ Redfish.Login
+ ${resp}= Redfish.Get /redfish/v1/Managers/bmc
Should Be Equal As Strings ${resp.status} ${HTTP_OK}
${bmc_version}= Get BMC Version
Should Be Equal As Strings
... ${resp.dict["FirmwareVersion"]} ${bmc_version.strip('"')}
- redfish.Logout
Verify Redfish BMC Manager Properties
[Documentation] Verify BMC managers resource properties.
[Tags] Verify_Redfish_BMC_Manager_Properties
- redfish.Login
- ${resp}= redfish.Get /redfish/v1/Managers/bmc
+ Redfish.Login
+ ${resp}= Redfish.Get /redfish/v1/Managers/bmc
Should Be Equal As Strings ${resp.status} ${HTTP_OK}
# Example:
# "Description": "Baseboard Management Controller"
@@ -44,7 +43,6 @@
Should Be Equal As Strings ${resp.dict["Name"]} OpenBmc Manager
Should Not Be Empty ${resp.dict["UUID"]}
Should Be Equal As Strings ${resp.dict["PowerState"]} On
- redfish.Logout
Test Redfish BMC Manager GracefulRestart
@@ -60,12 +58,24 @@
# "target": "/redfish/v1/Managers/bmc/Actions/Manager.Reset"
# }
- redfish.Login
+ Redfish.Login
${payload}= Create Dictionary ResetType=GracefulRestart
- ${resp}= redfish.Post Managers/bmc/Actions/Manager.Reset body=&{payload}
+ ${resp}= Redfish.Post Managers/bmc/Actions/Manager.Reset body=&{payload}
Should Be Equal As Strings ${resp.status} ${HTTP_OK}
# TODO: Add logic to ping and check BMC online state
+*** Keywords ***
+Test Setup Execution
+ [Documentation] Do test case setup tasks.
+
+ redfish.Login
+
+
+Test Teardown Execution
+ [Documentation] Do the post test teardown.
+
+ FFDC On Test Case Fail
+ redfish.Logout