Sivas SRR | 7d7bae3 | 2019-05-29 00:31:14 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test Redfish LDAP user configuration. |
| 3 | |
| 4 | Resource ../../lib/resource.robot |
| 5 | Resource ../../lib/bmc_redfish_resource.robot |
| 6 | Resource ../../lib/openbmc_ffdc.robot |
| 7 | |
| 8 | Suite Setup Suite Setup Execution |
| 9 | Test Setup Test Setup Execution |
| 10 | Test Teardown Test Teardown Execution |
| 11 | |
Sivas SRR | 9358b5c | 2019-06-06 04:57:03 -0500 | [diff] [blame] | 12 | Force Tags LDAP_Test |
| 13 | |
Sivas SRR | 7d7bae3 | 2019-05-29 00:31:14 -0500 | [diff] [blame] | 14 | ** Test Cases ** |
| 15 | |
| 16 | Verify LDAP Configuration Exist |
| 17 | [Documentation] Verify LDAP configuration is available. |
| 18 | [Tags] Verify_LDAP_Configuration_Exist |
| 19 | |
| 20 | ${resp}= Redfish.Get Attribute ${REDFISH_BASE_URI}AccountService |
| 21 | ... ${LDAP_TYPE} default=${EMPTY} |
| 22 | Should Not Be Empty ${resp} msg=LDAP configuration is not defined. |
| 23 | |
| 24 | |
| 25 | Verify LDAP User Login |
| 26 | [Documentation] Verify LDAP user able to login into BMC. |
| 27 | [Tags] Verify_LDAP_User_Login |
| 28 | |
| 29 | ${resp}= Run Keyword And Return Status Redfish.Login ${LDAP_USER} |
| 30 | ... ${LDAP_USER_PASSWORD} |
| 31 | Should Be Equal ${resp} ${True} msg=LDAP user is not able to login. |
| 32 | redfish.Logout |
| 33 | |
| 34 | |
| 35 | Verify LDAP Service Available |
| 36 | [Documentation] Verify LDAP service is available. |
| 37 | [Tags] Verify_LDAP_Service_Available |
| 38 | |
| 39 | @{ldap_configuration}= Get LDAP Configuration ${LDAP_TYPE} |
| 40 | Should Contain ${ldap_configuration} LDAPService |
| 41 | ... msg=LDAPService is not available. |
| 42 | |
| 43 | |
| 44 | *** Keywords *** |
| 45 | Suite Setup Execution |
| 46 | [Documentation] Do suite setup tasks. |
| 47 | |
| 48 | Should Not Be Empty ${LDAP_TYPE} |
| 49 | redfish.Login |
| 50 | Get LDAP Configuration ${LDAP_TYPE} |
| 51 | redfish.Logout |
| 52 | |
| 53 | |
| 54 | Test Setup Execution |
| 55 | [Documentation] Do test case setup tasks. |
| 56 | |
| 57 | redfish.Login |
| 58 | |
| 59 | |
| 60 | Test Teardown Execution |
| 61 | [Documentation] Do the post test teardown. |
| 62 | FFDC On Test Case Fail |
| 63 | redfish.Logout |
| 64 | |
| 65 | |
| 66 | Get LDAP Configuration |
| 67 | [Documentation] Retrieve LDAP Configuration. |
| 68 | [Arguments] ${ldap_type} |
| 69 | |
| 70 | # Description of argument(s): |
| 71 | # ldap_type The LDAP type ("ActiveDirectory" or "LDAP"). |
| 72 | |
| 73 | ${ldap_config}= Redfish.Get Properties ${REDFISH_BASE_URI}AccountService |
| 74 | [Return] ${ldap_config["${ldap_type}"]} |