Create multiple session and verify

Changes:
    - Added set session key function in lib.
    - Added get session info function in lib utils.
    - Added test case to create 50 session and verify.

Tested: On Master

Change-Id: Iaf740c83d77fb1da7be65903872219e21b53c79e
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/redfish/service_root/test_service_root_security.robot b/redfish/service_root/test_service_root_security.robot
index c001fb7..cab493d 100644
--- a/redfish/service_root/test_service_root_security.robot
+++ b/redfish/service_root/test_service_root_security.robot
@@ -5,6 +5,10 @@
 
 Test Teardown    FFDC On Test Case Fail
 
+*** Variables ***
+
+${LOGIN_SESSION_COUNT}   ${50}
+
 *** Test Cases ***
 
 Redfish Login With Invalid Credentials
@@ -50,6 +54,33 @@
     ...  data=${data}  headers=${headers}
 
 
+Create Multiple Login Sessions And Verify
+    [Documentation]  Create 50 login instances and verify.
+    [Tags]  Create_Multiple_Login_Sessions_And_Verify
+    [Teardown]  Multiple Session Cleanup
+
+    redfish.Login
+    # Example:
+    #    {
+    #      'key': 'L0XEsZAXpNdF147jJaOD',
+    #      'location': '/redfish/v1/SessionService/Sessions/qWn2JOJSOs'
+    #    }
+    ${saved_session_info}=   Get Redfish Session Info
+
+    # Sessions book keeping for cleanup once done.
+    ${session_list}=  Create List
+    Set Test Variable  ${session_list}
+
+    Repeat Keyword  ${LOGIN_SESSION_COUNT} times  Create New Login Session
+
+    # Update the redfish session object with the first login key and location
+    # and verify if it is still working.
+    redfish.Set Session Key  ${saved_session_info["key"]}
+    redfish.Set Session Location  ${saved_session_info["location"]}
+    ${resp}=  redfish.Get  ${saved_session_info["location"]}
+    Should Be Equal As Strings  ${resp.status}  ${HTTP_OK}
+
+
 *** Keywords ***
 
 Login And Verify Redfish Response
@@ -63,3 +94,25 @@
 
     ${data}=  Create Dictionary  username=${username}  password=${password}
     Run Keyword And Expect Error  ${expected_response}  redfish.Login  ${data}
+
+
+Create New Login Session
+    [Documentation]  Multiple login session keys.
+
+    redfish.Login
+    ${session_info}=  Get Redfish Session Info
+
+    # Append the session location to the list.
+    # ['/redfish/v1/SessionService/Sessions/uDzihgDecs',
+    #  '/redfish/v1/SessionService/Sessions/PaHF5brPPd']
+    Append To List  ${session_list}  ${session_info["location"]}
+
+
+Multiple Session Cleanup
+    [Documentation]  Do the teardown for multiple sessions.
+
+    FFDC On Test Case Fail
+
+    :FOR  ${item}  IN  @{session_list}
+    \  redfish.Delete  ${item}
+