Ensure logout before testing logged out cases
When a case fails the test framework automatically collect the logs, and
it will login to BMC via REST/Redfish. In such case, test cases
depending on logged out state will fail.
For example, in case "GET Redfish Hypermedia Without Login" fails, the
next case "GET Redfish SessionService Without Login" will fail as well.
Fix this by running Redfish.Logout before the "logged out" cases.
Tested: When "GET Redfish Hypermedia Without Login" fails, verify the
next case "GET Redfish SessionService Without Login" succeeds.
Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: Iacb2d2b6379bd5d616cd5358498a8bd14fc014ae
diff --git a/redfish/service_root/test_service_root.robot b/redfish/service_root/test_service_root.robot
index 837c3e9..1f38c48 100644
--- a/redfish/service_root/test_service_root.robot
+++ b/redfish/service_root/test_service_root.robot
@@ -22,6 +22,7 @@
GET Redfish Hypermedia Without Login
[Documentation] GET hypermedia URL without login.
[Tags] GET_Redfish_Hypermedia_Without_Login
+ [Setup] Redfish.Logout
[Template] GET And Verify Redfish Response
# Expect status Resource URL Path
@@ -33,6 +34,7 @@
GET Redfish SessionService Without Login
[Documentation] Get /redfish/v1/SessionService without login
[Tags] GET_Redfish_SessionService_Without_Login
+ [Setup] Redfish.Logout
${resp}= Redfish.Get /redfish/v1/SessionService
... valid_status_codes=[${HTTP_UNAUTHORIZED}]