Redfish DELETE and get session ID
Changes:
- Added "DELETE" keyword in client code.
- Add test to "GET" session Id.
- Added Teardown methods for clean up test suites.
- Fixes to accept "None" and user passed session and token.
Resolves openbmc/openbmc-test-automation#1429
Change-Id: Ibc3a8a58da11068bd1dc77d40bf1648ef1c96c37
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/redfish_test/test_redfish_interfaces.robot b/redfish_test/test_redfish_interfaces.robot
index 17324c7..b8ea79f 100644
--- a/redfish_test/test_redfish_interfaces.robot
+++ b/redfish_test/test_redfish_interfaces.robot
@@ -1,13 +1,28 @@
*** Settings ***
Documentation Test Redfish interfaces supported.
-Resource ../lib/redfish_client.robot
+Resource ../lib/redfish_client.robot
+
+Test Setup Test Setup Execution
+Test Teardown Test Teardown Execution
+
** Test Cases **
-Get Redfish Response Codes
+Test Get Redfish Session Id
+ [Documentation] Establish session to BMC and get session identifier.
+ [Tags] Test_Get_Redfish_Session_Id
+
+ ${session_url} =
+ ... Catenate SEPARATOR= ${REDFISH_SESSION_URI} ${test_session_id}
+ ${resp} = Redfish Get Request
+ ... ${session_url} xauth_token=${test_auth_token} response_format=${0}
+ Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
+
+
+Test Get Redfish Response Codes
[Documentation] Get Redfish response codes and validate them.
- [Tags] Get_Redfish_Response_Codes
+ [Tags] Test_Get_Redfish_Response_Codes
[Template] Execute Get And Check Response
# Expected status URL Path
@@ -17,6 +32,7 @@
${HTTP_OK} Managers/openbmc/EthernetInterfaces/eth0
${HTTP_NOT_FOUND} /i/dont/exist/
+
*** Keywords ***
Execute Get And Check Response
@@ -26,5 +42,20 @@
# expected_response_code Expected REST status codes.
# url_path URL path.
- ${resp} = Redfish Get Request ${url_path} response_format=${0}
+ ${resp} = Redfish Get Request
+ ... ${url_path} xauth_token=${test_auth_token} response_format=${0}
Should Be Equal As Strings ${resp.status_code} ${expected_response_code}
+
+
+Test Setup Execution
+ [Documentation] Do the test setup.
+
+ ${session_id} ${auth_token} = Redfish Login Request
+ Set Test Variable ${test_session_id} ${session_id}
+ Set Test Variable ${test_auth_token} ${auth_token}
+
+
+Test Teardown Execution
+ [Documentation] Do the test teardown.
+
+ Redfish Delete Request ${test_session_id} ${test_auth_token}