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