blob: eb1a08349130bb758eacaa8a7d8f98dbd915b0b3 [file] [log] [blame]
George Keishing4c394012019-02-01 06:03:02 -06001*** Settings ***
2Resource ../../lib/resource.txt
3Resource ../../lib/bmc_redfish_resource.robot
George Keishing3298d5c2019-02-12 06:59:25 -06004Resource ../../lib/openbmc_ffdc.robot
5
6Test Teardown FFDC On Test Case Fail
George Keishing4c394012019-02-01 06:03:02 -06007
8*** Test Cases ***
9
George Keishing5ee33d92019-02-02 12:33:25 -060010Redfish Login With Invalid Credentials
George Keishing4c394012019-02-01 06:03:02 -060011 [Documentation] Login to BMC web using invalid credential.
George Keishing5ee33d92019-02-02 12:33:25 -060012 [Tags] Redfish_Login_With_Invalid_Credentials
George Keishing4c394012019-02-01 06:03:02 -060013 [Template] Login And Verify Redfish Response
14
15 # Expect status Username Password
16 InvalidCredentialsError* ${OPENBMC_USERNAME} deadpassword
17 InvalidCredentialsError* groot ${OPENBMC_PASSWORD}
18 InvalidCredentialsError* ${EMPTY} ${OPENBMC_PASSWORD}
19 InvalidCredentialsError* ${OPENBMC_USERNAME} ${EMPTY}
20 InvalidCredentialsError* ${EMPTY} ${EMPTY}
21
22
George Keishing5ee33d92019-02-02 12:33:25 -060023Redfish Login Using Unsecured HTTP
George Keishinga8116932019-02-05 11:51:47 -060024 [Documentation] Login to BMC web through http unsecured.
George Keishing5ee33d92019-02-02 12:33:25 -060025 [Tags] Redfish_Login_Using_Unsecured_HTTP
George Keishinga8116932019-02-05 11:51:47 -060026
27 Create Session openbmc http://${OPENBMC_HOST}
28 ${data}= Create Dictionary
29 ... UserName=${OPENBMC_USERNAME} Password=${OPENBMC_PASSWORD}
30
31 ${headers}= Create Dictionary Content-Type=application/json
32
33 Run Keyword And Expect Error *Connection refused*
34 ... Post Request openbmc /redfish/v1/SessionService/Sessions
35 ... data=${data} headers=${headers}
36
37
George Keishingb2f07342019-02-09 05:21:45 -060038Redfish Login Using HTTPS Wrong Port 80 Protocol
39 [Documentation] Login to BMC web through wrong protocol port 80.
40 [Tags] Redfish_Login_Using_HTTPS_Wrong_Port_80_Protocol
41
42 Create Session openbmc https://${OPENBMC_HOST}:80
43 ${data}= Create Dictionary
44 ... UserName=${OPENBMC_USERNAME} Password=${OPENBMC_PASSWORD}
45
46 ${headers}= Create Dictionary Content-Type=application/json
47
48 Run Keyword And Expect Error *Connection refused*
49 ... Post Request openbmc /redfish/v1/SessionService/Sessions
50 ... data=${data} headers=${headers}
51
52
George Keishing4c394012019-02-01 06:03:02 -060053*** Keywords ***
54
55Login And Verify Redfish Response
56 [Documentation] Login and verify redfish response.
57 [Arguments] ${expected_response} ${username} ${password}
58
59 # Description of arguments:
60 # expected_response Expected REST status.
61 # username The username to be used to connect to the server.
62 # password The password to be used to connect to the server.
63
64 ${data}= Create Dictionary username=${username} password=${password}
65 Run Keyword And Expect Error ${expected_response} redfish.Login ${data}