Renamed some files of GUI test suite to have consistency

Change-Id: Ia9f775602b0845af69b2ea961196ca2332193caa
Signed-off-by: Rahul Maheshwari <rahulmaheshwari@in.ibm.com>
diff --git a/gui/gui_test/access_control/test_certificate_sub_menu.robot b/gui/gui_test/access_control/test_certificate_sub_menu.robot
new file mode 100644
index 0000000..2ba9186
--- /dev/null
+++ b/gui/gui_test/access_control/test_certificate_sub_menu.robot
@@ -0,0 +1,152 @@
+*** Settings ***
+
+Documentation  Test OpenBMC GUI "SSL Certificates" sub-menu of "Access control".
+
+Resource        ../../lib/gui_resource.robot
+Resource        ../../../lib/certificate_utils.robot
+
+Suite Setup     Suite Setup Execution
+Suite Teardown  Close Browser
+Test Setup      Test Setup Execution
+
+
+*** Variables ***
+
+${xpath_certificate_heading}       //h1[text()="SSL certificates"]
+${xpath_add_certificate_button}    //button[contains(text(),"Add new certificate")]
+${xpath_generate_csr_button}       //*[@data-test-id='sslCertificates-button-generateCsr']
+${xpath_generate_csr_heading}      //h5[contains(text(), "Generate a Certificate Signing Request")]
+${xpath_select_certificate_type}   //*[@data-test-id='modalGenerateCsr-select-certificateType']
+${xpath_select_country}            //*[@data-test-id='modalGenerateCsr-select-country']
+${xpath_input_state}               //*[@data-test-id='modalGenerateCsr-input-state']
+${xpath_input_city}                //*[@data-test-id='modalGenerateCsr-input-city']
+${xpath_input_company_name}        //*[@data-test-id='modalGenerateCsr-input-companyName']
+${xpath_input_company_unit}        //*[@data-test-id='modalGenerateCsr-input-companyUnit']
+${xpath_input_common_name}         //*[@data-test-id='modalGenerateCsr-input-commonName']
+${xpath_input_challenge_password}  //*[@data-test-id='modalGenerateCsr-input-challengePassword']
+${xpath_input_contact_person}      //*[@data-test-id='modalGenerateCsr-input-contactPerson']
+${xpath_input_email_address}       //*[@data-test-id='modalGenerateCsr-input-emailAddress']
+${xpath_generate_csr_submit}       //*[@data-test-id='modalGenerateCsr-button-ok']
+${xpath_csr_cancel_button}         //button[contains(text(),"Cancel")]
+${xpath_input_alternate_name}      //input[@id='alternate-name']
+${xpath_select_algorithm_button}   //*[@data-test-id='modalGenerateCsr-select-keyPairAlgorithm']
+
+*** Test Cases ***
+
+Verify Navigation To SSL Certificate Page
+    [Documentation]  Verify navigation to SSL certificate page.
+    [Tags]  Verify_Navigation_To_SSL_Certificate_Page
+
+    Page Should Contain Element  ${xpath_certificate_heading}
+
+
+Verify Existence Of All Sections In Certificate Page
+    [Documentation]  Verify existence of all sections in certificate page.
+    [Tags]  Verify_Existence_Of_All_Sections_In_Certificate_Page
+
+    Page should contain  Certificate
+    Page should contain  Valid from
+    Page should contain  Valid until
+
+
+Verify Existence Of Add Certificate Button
+    [Documentation]  Verify existence of add certificate button.
+    [Tags]  Verify_Existence_Of_Add_Certificate_Button
+
+    Page Should Contain Element  ${xpath_add_certificate_button}
+
+Verify Generate CSR Certificate Button
+    [Documentation]  Verify existence of all the fields of CSR generation.
+    [Tags]  Verify_Generate_CSR_Certificate_Button
+    [Teardown]  Click Element  ${xpath_csr_cancel_button}
+
+    Page Should Contain Element  ${xpath_generate_csr_button}
+    Click Element  ${xpath_generate_csr_button}
+    Wait Until Page Contains Element  ${xpath_generate_csr_heading}
+    Page Should Contain Element  ${xpath_select_certificate_type}
+    Page Should Contain Element  ${xpath_select_country}
+    Page Should Contain Element  ${xpath_input_state}
+    Page Should Contain Element  ${xpath_input_city}
+    Page Should Contain Element  ${xpath_input_company_name}
+    Page Should Contain Element  ${xpath_input_common_name}
+    Page Should Contain Element  ${xpath_input_challenge_password}
+    Page Should Contain Element  ${xpath_input_contact_person}
+    Page Should Contain Element  ${xpath_input_email_address}
+    Page Should Contain Element  ${xpath_input_alternate_name}
+    Page Should Contain Element  ${xpath_select_algorithm_button}
+    Page Should Contain Element  ${xpath_generate_csr_submit}
+
+
+Verify Installed CA Certificate
+    [Documentation]  Install CA certificate and verify the same via GUI.
+    [Tags]  Verify_Installed_CA_Certificate
+
+    Delete All CA Certificate Via Redfish
+
+    # Install CA certificate via Redfish.
+    ${file_data}=  Generate Certificate File Data  CA
+    Install Certificate File On BMC  ${REDFISH_CA_CERTIFICATE_URI}  ok  data=${file_data}
+
+    # Verify CA certificate availability in GUI.
+    Wait Until Page Contains  CA Certificate  timeout=10
+
+
+Verify Installed HTTPS Certificate
+    [Documentation]  Install HTTPS certificate via Redfish and verify it in GUI.
+    [Tags]  Verify_Installed_HTTPS_Certificate
+
+    # Install HTTPS certificate.
+    ${file_data}=  Generate Certificate File Data  Server
+    Install Certificate File On BMC  ${REDFISH_HTTPS_CERTIFICATE_URI}  ok  data=${file_data}
+
+    # Verify certificate is available in GUI.
+    Wait Until Page Contains  HTTPS Certificate  timeout=10
+
+
+Verify Installed LDAP Certificate
+    [Documentation]  Install LDAP certificate via Redfish and verify it in GUI.
+    [Tags]  Verify_Installed_LDAP_Certificate
+
+    Delete Certificate Via BMC CLI  Client
+
+    # Install LDAP certificate.
+    ${file_data}=  Generate Certificate File Data  Client
+    Install Certificate File On BMC  ${REDFISH_LDAP_CERTIFICATE_URI}  ok  data=${file_data}
+
+    # Verify certificate is available in GUI.
+    Wait Until Page Contains  LDAP Certificate  timeout=10
+
+
+*** Keywords ***
+
+Generate Certificate File Data
+    [Documentation]  Generate data of certificate file.
+
+    [Arguments]  ${cert_type}
+
+    # Description of Arguments(s):
+    # cert_type      Certificate type (e.g. "Client" or  "CA").
+
+    ${cert_file_path}=  Run Keyword If  '${cert_type}' == 'Client' or 'Server'
+    ...    Generate Certificate File Via Openssl  Valid Certificate Valid Privatekey
+    ...  ELSE IF  '${cert_type}' == 'CA'
+    ...    Generate Certificate File Via Openssl  Valid Certificate
+    ${bytes}=  OperatingSystem.Get Binary File  ${cert_file_path}
+    ${file_data}=  Decode Bytes To String  ${bytes}  UTF-8
+
+    [return]  ${file_data}
+
+
+Test Setup Execution
+    [Documentation]  Do test case setup tasks.
+
+    Click Element  ${xpath_access_control_menu}
+    Click Element  ${xpath_ssl_certificates_sub_menu}
+    Wait Until Keyword Succeeds  30 sec  10 sec  Location Should Contain  ssl-certificates
+
+
+Suite Setup Execution
+    [Documentation]  Do test case suite setup tasks.
+
+    Launch Browser And Login GUI
+    Create Directory  certificate_dir
diff --git a/gui/gui_test/access_control/test_client_sessions_sub_menu.robot b/gui/gui_test/access_control/test_client_sessions_sub_menu.robot
new file mode 100644
index 0000000..db9b7fb
--- /dev/null
+++ b/gui/gui_test/access_control/test_client_sessions_sub_menu.robot
@@ -0,0 +1,33 @@
+*** Settings ***
+
+Documentation   Test OpenBMC GUI "Client sessions" sub-menu of "Access Control" menu.
+
+Resource        ../../lib/gui_resource.robot
+
+Suite Setup     Launch Browser And Login GUI
+Suite Teardown  Close Browser
+Test Setup      Test Setup Execution
+
+
+*** Variables ***
+
+${xpath_client_sessions_heading}  //h1[text()="Client sessions"]
+
+
+*** Test Cases ***
+
+Verify Navigation To Client Sessions Page
+    [Documentation]  Verify navigation to client sessions page.
+    [Tags]  Verify_Navigation_To_Client_Sessions_Page
+
+    Page Should Contain Element  ${xpath_client_sessions_heading}
+
+
+*** Keywords ***
+
+Test Setup Execution
+    [Documentation]  Do test case setup tasks.
+
+    Click Element  ${xpath_access_control_menu}
+    Click Element  ${xpath_client_sessions_sub_menu}
+    Wait Until Keyword Succeeds  30 sec  5 sec  Location Should Contain  client-sessions
diff --git a/gui/gui_test/access_control/test_ldap_sub_menu.robot b/gui/gui_test/access_control/test_ldap_sub_menu.robot
new file mode 100644
index 0000000..e298b16
--- /dev/null
+++ b/gui/gui_test/access_control/test_ldap_sub_menu.robot
@@ -0,0 +1,351 @@
+*** Settings ***
+
+Documentation  Test OpenBMC GUI "LDAP" sub-menu of "Access control".
+
+Resource        ../../lib/gui_resource.robot
+Resource        ../../../lib/bmc_ldap_utils.robot
+
+Suite Setup     Suite Setup Execution
+Suite Teardown  Close Browser
+
+
+*** Variables ***
+
+${xpath_ldap_heading}                   //h1[text()="LDAP"]
+${xpath_enable_ldap_checkbox}           //*[@data-test-id='ldap-checkbox-ldapAuthenticationEnabled']
+${xpath_secure_ldap_checkbox}           //*[@data-test-id='ldap-checkbox-secureLdapEnabled']
+${xpath_service_radio_button}           //*[@data-test-id="ldap-radio-activeDirectoryEnabled"]
+${xpath_add_role_group_button}          //button[contains(text(),'Add role group')]
+${xpath_ldap_url}                       //*[@data-test-id='ldap-input-serverUri']
+${xpath_ldap_bind_dn}                   //*[@data-test-id='ldap-input-bindDn']
+${xpath_ldap_password}                  //*[@id='bind-password']
+${xpath_ldap_base_dn}                   //*[@data-test-id='ldap-input-baseDn']
+${xpath_ldap_save_settings}             //*[@data-test-id='ldap-button-saveSettings']
+${xpath_select_refresh_button}          //*[text()[contains(.,"Refresh")]]
+${xpath_add_group_name}                 //*[@id="role-group-name"]
+${xpath_add_group_Privilege}            //*[@id="privilege"]
+${xpath_add_privilege_button}           //button[text()=" Add "]
+${xpath_delete_group_button}            //*[@title="Delete"]
+${xpath_delete_button}                  //button[text()="Delete"]
+
+
+${incorrect_ip}     1.2.3.4
+
+*** Test Cases ***
+
+Verify Navigation To LDAP Page
+    [Documentation]  Verify navigation to LDAP page.
+    [Tags]  Verify_Navigation_To_LDAP_Page
+
+    Page Should Contain Element  ${xpath_ldap_heading}
+
+
+Verify Existence Of All Sections In LDAP Page
+    [Documentation]  Verify existence of all sections in LDAP page.
+    [Tags]  Verify_Existence_Of_All_Sections_In_LDAP_Page
+
+    Page Should Contain  Settings
+    Page Should Contain  Role groups
+
+
+Verify Existence Of All Buttons In LDAP Page
+    [Documentation]  Verify existence of all buttons in LDAP page.
+    [Tags]  Verify_Existence_Of_All_Buttons_In_LDAP_Page
+
+    # Buttons under settings section.
+    Page Should Contain Element  ${xpath_service_radio_button}
+    Page Should Contain Element  ${xpath_save_settings_button}
+
+    # Buttons under role groups section.
+    Page Should Contain Element  ${xpath_add_role_group_button}
+
+
+Verify Existence Of All Checkboxes In LDAP Page
+    [Documentation]  Verify existence of all checkboxes in LDAP page.
+    [Tags]  Verify_Existence_Of_All_Checkboxes_In_LDAP_Page
+
+    # Checkboxes under settings section.
+    Page Should Contain Element  ${xpath_enable_ldap_checkbox}
+    Page Should Contain Element  ${xpath_secure_ldap_checkbox}
+
+
+Verify LDAP Configurations Editable
+    [Documentation]  Verify LDAP configurations are editable.
+    [Tags]  Verify_LDAP_Configurations_Editable
+
+    Create LDAP Configuration  ${LDAP_SERVER_URI}  ${LDAP_TYPE}  ${LDAP_BIND_DN}
+    ...  ${LDAP_BIND_DN_PASSWORD}  ${LDAP_BASE_DN}
+    Wait Until Page Contains Element  ${xpath_ldap_url}
+    Textfield Value Should Be  ${xpath_ldap_url}  ${LDAP_SERVER_URI}
+    Textfield Value Should Be  ${xpath_ldap_bind_dn}  ${LDAP_BIND_DN}
+    Textfield Value Should Be  ${xpath_ldap_password}  ${empty}
+    Textfield Value Should Be  ${xpath_ldap_base_dn}  ${LDAP_BASE_DN}
+
+
+Verify Create LDAP Configuration
+    [Documentation]  Verify created LDAP configuration.
+    [Tags]  Verify_Created_LDAP_Configuration
+    [Teardown]  Run Keywords  Redfish.Logout  AND  Redfish.Login
+
+    Create LDAP Configuration
+    Get LDAP Configuration  ${LDAP_TYPE}
+    Redfish.Logout
+    Redfish.Login  ${LDAP_USER}  ${LDAP_USER_PASSWORD}
+
+
+Verify LDAP Config Update With Incorrect LDAP IP Address
+    [Documentation]  Verify that LDAP login fails with incorrect LDAP IP Address.
+    [Tags]  Verify_LDAP_Config_Update_With_Incorrect_LDAP_IP_Address
+    [Teardown]  Run Keywords  Redfish.Logout  AND  Redfish.Login
+
+    Create LDAP Configuration  ${incorrect_ip}   ${LDAP_TYPE}  ${LDAP_BIND_DN}
+    ...  ${LDAP_BIND_DN_PASSWORD}  ${LDAP_BASE_DN}  ${LDAP_MODE}
+
+    Get LDAP Configuration  ${LDAP_TYPE}
+    Redfish.Logout
+
+    ${resp}=  Run Keyword And Return Status
+    ...  Redfish.Login  ${LDAP_USER}  ${LDAP_USER_PASSWORD}
+    Should Be Equal  ${resp}  ${False}
+    ...  msg=LDAP user was able to login though the incorrect LDAP IP Address.
+
+
+Verify LDAP Service Disable
+    [Documentation]  Verify that LDAP user cannot login when LDAP service is disabled.
+    [Tags]  Verify_LDAP_Service_Disable
+    [Teardown]  Run Keywords  Redfish.Logout  AND  Redfish.Login
+
+    ${status}=  Run Keyword And Return Status
+    ...  Checkbox Should Be Selected  ${xpath_enable_ldap_checkbox}
+
+    Run Keyword If  ${status} == ${True}
+    ...  Click Element At Coordinates  ${xpath_enable_ldap_checkbox}  0  0
+
+    Checkbox Should Not Be Selected  ${xpath_enable_ldap_checkbox}
+    Click Element  ${xpath_ldap_save_settings}
+    Wait Until Page Contains  Successfully saved Open LDAP settings
+    Click Element  ${xpath_refresh_button}
+    Wait Until Page Contains Element  ${xpath_ldap_heading}
+    Redfish.Logout
+
+    ${resp}=  Run Keyword And Return Status
+    ...  Redfish.Login  ${LDAP_USER}  ${LDAP_USER_PASSWORD}
+    Should Be Equal  ${resp}  ${False}
+    ...  msg=LDAP user was able to login even though the LDAP service was disabled.
+
+
+Verify LDAP User With Admin Privilege
+    [Documentation]  Verify that LDAP user with administrator privilege is able to do BMC reboot.
+    [Tags]  Verify_LDAP_User_With_Admin_Privilege
+    [Teardown]  Run Keywords  Redfish.Login  AND  Delete LDAP Role Group  ${GROUP_NAME}
+
+    Update LDAP Configuration with LDAP User Role And Group  ${GROUP_NAME}  ${GROUP_PRIVILEGE}
+    Redfish.Login  ${LDAP_USER}  ${LDAP_USER_PASSWORD}
+    Redfish OBMC Reboot (off)
+    Redfish.Logout
+
+
+Verify Enabling LDAP
+     [Documentation]  Verify that LDAP can be enabled from disabled state.
+     [Tags]  Verify_Enabling_LDAP
+
+     Disable LDAP Configuration
+     Create LDAP Configuration
+
+
+Read Network Configuration Via Different User Roles And Verify Using GUI
+    [Documentation]  Read network configuration via different user roles and verify.
+    [Tags]  Read_Network_Configuration_Via_Different_User_Roles_And_Verify_Using_GUI
+    [Template]  Update LDAP User Role And Read Network Configuration Via GUI
+
+    # group_name     user_role      valid_status_code
+    ${GROUP_NAME}    Administrator  ${HTTP_OK}
+    ${GROUP_NAME}    Operator       ${HTTP_OK}
+    ${GROUP_NAME}    ReadOnly       ${HTTP_OK}
+    ${GROUP_NAME}    NoAccess       ${HTTP_FORBIDDEN}
+
+
+*** Keywords ***
+
+Suite Setup Execution
+    [Documentation]  Do test case setup tasks.
+
+    Launch Browser And Login GUI
+
+    # Navigate to https://xx.xx.xx.xx/#/access-control/ldap  LDAP page.
+    Click Element  ${xpath_access_control_menu}
+    Click Element  ${xpath_ldap_sub_menu}
+    Wait Until Keyword Succeeds  30 sec  10 sec  Location Should Contain  ldap
+    Element Should Be Enabled   ${xpath_enable_ldap_checkbox}
+
+    Valid Value  LDAP_TYPE  valid_values=["ActiveDirectory", "LDAP"]
+    Valid Value  LDAP_USER
+    Valid Value  LDAP_USER_PASSWORD
+    Valid Value  GROUP_PRIVILEGE
+    Valid Value  GROUP_NAME
+    Valid Value  LDAP_SERVER_URI
+    Valid Value  LDAP_BIND_DN_PASSWORD
+    Valid Value  LDAP_BIND_DN
+    Valid Value  LDAP_BASE_DN
+    Valid Value  LDAP_MODE  valid_values=["secure", "nonsecure"]
+
+
+Create LDAP Configuration
+    [Documentation]  Create LDAP configuration.
+    [Arguments]  ${ldap_server_uri}=${LDAP_SERVER_URI}  ${ldap_servicetype}=${LDAP_TYPE}
+    ...  ${ldap_bind_dn}=${LDAP_BIND_DN}  ${ldap_bind_dn_password}=${LDAP_BIND_DN_PASSWORD}
+    ...  ${ldap_base_dn}=${LDAP_BASE_DN}  ${ldap_mode}=${LDAP_MODE}
+
+    # Description of argument(s):
+    # ldap_server_uri        LDAP server uri (e.g. ldap://XX.XX.XX.XX).
+    # ldap_type              The LDAP type ("ActiveDirectory" or "LDAP").
+    # ldap_bind_dn           The LDAP bind distinguished name.
+    # ldap_bind_dn_password  The LDAP bind distinguished name password.
+    # ldap_base_dn           The LDAP base distinguished name.
+
+    Select Checkbox  ${xpath_enable_ldap_checkbox}
+    Checkbox Should Be Selected  ${xpath_enable_ldap_checkbox}
+    ${radio_buttons}=    Get WebElements    ${xpath_service_radio_button}
+
+    Run Keyword If  '${ldap_service_type}' == 'LDAP'
+    ...  Click Element At Coordinates  ${radio_buttons}[${0}]  0  0
+    ...  ELSE  Click Element At Coordinates  ${radio_buttons}[${1}]  0  0
+
+    Wait Until Page Contains Element  ${xpath_ldap_url}
+    Run Keyword If  '${ldap_mode}' == 'secure'
+    ...   Click Element At Coordinates  ${xpath_secure_ldap_checkbox}  0  0
+    ...  ELSE  Unselect Checkbox  ${xpath_secure_ldap_checkbox}
+
+    Input Text  ${xpath_ldap_url}  ${ldap_server_uri}
+    Input Text  ${xpath_ldap_bind_dn}  ${ldap_bind_dn}
+    Input Text  ${xpath_ldap_password}  ${ldap_bind_dn_password}
+    Input Text  ${xpath_ldap_base_dn}  ${ldap_base_dn}
+    Click Element  ${xpath_ldap_save_settings}
+
+    Run Keyword If  '${ldap_service_type}'=='LDAP'
+    ...  Wait Until Page Contains  Successfully saved Open LDAP settings
+    ...  ELSE
+    ...  Wait Until Page Contains  Successfully saved Active Directory settings
+
+    Click Element  ${xpath_refresh_button}
+    Wait Until Page Contains Element  ${xpath_ldap_heading}
+
+
+Get LDAP Configuration
+    [Documentation]  Retrieve LDAP Configuration.
+    [Arguments]   ${ldap_type}
+
+    # Description of argument(s):
+    # ldap_type  The LDAP type ("ActiveDirectory" or "LDAP").
+
+    ${radio_buttons}=  Get WebElements  ${xpath_service_radio_button}
+
+    ${status}=  Run Keyword And Return Status
+    ...  Run Keyword If  '${ldap_type}'=='LDAP'
+    ...  Checkbox Should Be Selected  ${radio_buttons}[${0}]
+    ...  ELSE
+    ...  Checkbox Should Be Selected  ${radio_buttons}[${1}]
+    Should Be Equal  ${status}  ${True}
+
+
+Update LDAP Configuration With LDAP User Role And Group
+    [Documentation]  Update LDAP configuration update with LDAP user role and group.
+    [Arguments]  ${group_name}  ${group_privilege}
+
+    # Description of argument(s):
+    # group_name       The group name of LDAP user.
+    # group_privilege  The group privilege for LDAP user
+    #                  (e.g. "Administrator", "Operator", "ReadOnly" or "NoAcccess").
+
+    Create LDAP Configuration
+    Click Element  ${xpath_add_role_group_button}
+    Input Text  ${xpath_add_group_name}  ${group_name}
+    Select From List By Value  ${xpath_add_group_Privilege}  ${group_privilege}
+    Click Element  ${xpath_add_privilege_button}
+
+    # Verify group name after adding.
+    ${ldap_group_name}=  Get LDAP Privilege And Group Name Via Redfish
+    List Should Contain Value  ${ldap_group_name}  ${group_name}
+
+
+Delete LDAP Role Group
+    [Documentation]  Delete LDAP role group.
+    [Arguments]  ${group_name}
+
+    # Description of argument(s):
+    # group_name         The group name of LDAP user.
+
+    #  Verify given group name is exist before deleting.
+    ${ldap_group_name}=  Get LDAP Privilege And Group Name Via Redfish
+    List Should Contain Value  ${ldap_group_name}  ${group_name}  msg=${group_name} not available.
+
+    ${get_groupname_index}=  Get Index From List  ${ldap_group_name}  ${group_name}
+    ${delete_group_elements}=  Get WebElements  ${xpath_delete_group_button}
+    Click Element  ${delete_group_elements}[${get_groupname_index}]
+    Click Element  ${xpath_delete_button}
+
+    # Verify group name after deleting.
+    ${ldap_group_name}=  Get LDAP Privilege And Group Name Via Redfish
+    List Should Not Contain Value  ${ldap_group_name}  ${group_name}  msg=${group_name} not available.
+
+
+Disable LDAP Configuration
+    [Documentation]  Disable LDAP configuration on BMC.
+
+    ${status}=  Run Keyword And Return Status
+    ...  Checkbox Should Be Selected  ${xpath_enable_ldap_checkbox}
+
+    Run Keyword If  ${status} == ${True}
+    ...  Click Element At Coordinates  ${xpath_enable_ldap_checkbox}  0  0
+
+    Checkbox Should Not Be Selected  ${xpath_enable_ldap_checkbox}
+    Click Element  ${xpath_ldap_save_settings}
+    Wait Until Page Contains  Successfully saved Open LDAP settings
+    Click Element  ${xpath_refresh_button}
+    Wait Until Page Contains Element  ${xpath_ldap_heading}
+
+
+Login BMC And Navigate To LDAP Page
+    [Documentation]  Login BMC and navigate to ldap page.
+    [Arguments]  ${username}=${OPENBMC_USERNAME}  ${password}=${OPENBMC_PASSWORD}
+
+    # Description of argument(s):
+    # username  The username to be used for login.
+    # password  The password to be used for login.
+
+    Login GUI  ${username}  ${password}
+    # Navigate to https://xx.xx.xx.xx/#/access-control/ldap  LDAP page.
+    Click Element  ${xpath_access_control_menu}
+    Click Element  ${xpath_ldap_sub_menu}
+    Wait Until Keyword Succeeds  30 sec  10 sec  Location Should Contain  ldap
+
+
+Update LDAP User Role And Read Network Configuration Via GUI
+    [Documentation]  Update LDAP user role and read network configuration via GUI.
+    [Arguments]  ${group_name}  ${user_role}  ${valid_status_codes}
+    [Teardown]  Run Keywords  Logout GUI  AND  Login BMC And Navigate To LDAP Page
+    ...  AND  Delete LDAP Role Group  ${group_name}
+
+    # Description of argument(s):
+    # group_privilege    The group privilege ("Administrator", "Operator", "ReadOnly" or "NoAccess").
+    # group_name         The group name of user.
+    # valid_status_code  The expected valid status code.
+
+
+    Update LDAP Configuration with LDAP User Role And Group  ${group_name}  ${user_role}
+    Logout GUI
+    Login GUI  ${LDAP_USER}  ${LDAP_USER_PASSWORD}
+    Redfish.Login  ${LDAP_USER}  ${LDAP_USER_PASSWORD}
+
+    Click Element  ${xpath_server_configuration}
+    Click Element  ${xpath_select_network_settings}
+    Wait Until Keyword Succeeds  30 sec  10 sec  Location Should Contain  network-settings
+
+    ${resp}=  Redfish.Get  ${REDFISH_NW_ETH0_URI}  valid_status_codes=[${valid_status_codes}]
+    Return From Keyword If  ${valid_status_codes} == ${HTTP_FORBIDDEN}
+
+    ${host_name}=  Redfish.Get Attribute  ${REDFISH_NW_PROTOCOL_URI}  HostName
+    Textfield Value Should Be  ${xpath_hostname_input}  ${host_name}
+
+    ${mac_address}=  Redfish.Get Attribute  ${REDFISH_NW_ETH0_URI}  MACAddress
+    Textfield Value Should Be  ${xpath_mac_address_input}  ${mac_address}
diff --git a/gui/gui_test/access_control/test_local_user_sub_menu.robot b/gui/gui_test/access_control/test_local_user_sub_menu.robot
new file mode 100644
index 0000000..4e849f7
--- /dev/null
+++ b/gui/gui_test/access_control/test_local_user_sub_menu.robot
@@ -0,0 +1,168 @@
+*** Settings ***
+
+Documentation  Test OpenBMC GUI "Local user management" sub-menu of "Access control".
+
+Resource        ../../lib/gui_resource.robot
+
+Suite Setup     Launch Browser And Login GUI
+Suite Teardown  Close Browser
+Test Setup      Test Setup Execution
+
+
+*** Variables ***
+${xpath_local_user_management_heading }  //h1[text()="Local user management"]
+${xpath_select_user}                     //input[contains(@class,"custom-control-input")]
+${xpath_account_policy}                  //button[contains(text(),'Account policy settings')]
+${xpath_add_user}                        //button[contains(text(),'Add user')]
+${xpath_edit_user}                       //*[@data-test-id='localUserManagement-tableRowAction-edit-0']
+${xpath_delete_user}                     //*[@data-test-id='localUserManagement-tableRowAction-delete-1']
+${xpath_account_status_enabled_button}   //*[@data-test-id='localUserManagement-radioButton-statusEnabled']
+${xpath_account_status_disabled_button}  //*[@data-test-id='localUserManagement-radioButton-statusDisabled']
+${xpath_username_input_button}           //*[@data-test-id='localUserManagement-input-username']
+${xpath_privilege_list_button}           //*[@data-test-id='localUserManagement-select-privilege']
+${xpath_password_input_button}           //*[@data-test-id='localUserManagement-input-password']
+${xpath_password_confirm_button}         //*[@data-test-id='localUserManagement-input-passwordConfirmation']
+${xpath_cancel_button}                   //*[@data-test-id='localUserManagement-button-cancel']
+${xpath_submit_button}                   //*[@data-test-id='localUserManagement-button-submit']
+${xpath_add_user_heading}                //h5[contains(text(),'Add user')]
+${xpath_policy_settings_header}          //*[text()="Account policy settings"]
+${xpath_auto_unlock}                     //*[@data-test-id='localUserManagement-radio-automaticUnlock']
+${xpath_manual_unlock}                   //*[@data-test-id='localUserManagement-radio-manualUnlock']
+${xpath_max_failed_login}                //*[@data-test-id='localUserManagement-input-lockoutThreshold']
+${test_user_password}                    TestPwd1
+
+*** Test Cases ***
+
+Verify Navigation To Local User Management Page
+    [Documentation]  Verify navigation to local user management page.
+    [Tags]  Verify_Navigation_To_Local_User_Management_Page
+
+    Page Should Contain Element  ${xpath_local_user_management_heading}
+
+
+Verify Existence Of All Sections In Local User Management Page
+    [Documentation]  Verify existence of all sections in local user management page.
+    [Tags]  Verify_Existence_Of_All_Sections_In_Local_User_Management_Page
+
+    Page should contain  View privilege role descriptions
+
+
+Verify Existence Of All Input Boxes In Local User Management Page
+    [Documentation]  Verify existence of all sections in Manage Power Usage page.
+    [Tags]  Verify_Existence_Of_All_Input_Boxes_In_Local_User_Management_Page
+
+    Page Should Contain Checkbox  ${xpath_select_user}
+
+
+Verify Existence Of All Buttons In Local User Management Page
+    [Documentation]  Verify existence of all buttons in local user management page.
+    [Tags]  Verify_Existence_Of_All_Buttons_In_Local_User_Management_Page
+
+    Page should contain Button  ${xpath_account_policy}
+    Page should contain Button  ${xpath_add_user}
+    Page Should Contain Element  ${xpath_edit_user}
+    Page Should Contain Element  ${xpath_delete_user}
+
+
+Verify Existence Of All Button And Fields In Add User
+    [Documentation]  Verify existence of all buttons and fields in add user page.
+    [Tags]  Verify_Existence_Of_All_Button_And_Fields_In_Add_User
+    [Teardown]  Click Element  ${xpath_cancel_button}
+
+    Click Element  ${xpath_add_user}
+    Wait Until Page Contains Element  ${xpath_add_user_heading}
+    Page Should Contain Element  ${xpath_account_status_enabled_button}
+    Page Should Contain Element  ${xpath_account_status_disabled_button}
+    Page Should Contain Element  ${xpath_username_input_button}
+    Page Should Contain Element  ${xpath_privilege_list_button}
+    Page Should Contain Element  ${xpath_password_input_button}
+    Page Should Contain Element  ${xpath_password_confirm_button}
+    Page Should Contain Element  ${xpath_cancel_button}
+    Page Should Contain Element  ${xpath_submit_button}
+
+
+Verify Existence Of All Buttons And Fields In Account Policy Settings
+    [Documentation]  Verify existence of all buttons and fields in account policy settings page.
+    [Tags]  Verify_Existence_Of_All_Buttons_And_Fields_In_Account_Policy_Settings
+    [Teardown]  Click Element  ${xpath_cancel_button}
+
+    Click Element  ${xpath_account_policy}
+    Wait Until Page Contains Element  ${xpath_policy_settings_header}
+    Page Should Contain Element  ${xpath_auto_unlock}
+    Page Should Contain Element  ${xpath_manual_unlock}
+    Page Should Contain Element  ${xpath_max_failed_login}
+    Page Should Contain Element  ${xpath_submit_button}
+    Page Should Contain Element  ${xpath_cancel_button}
+
+
+Verify User Access Privilege
+    [Documentation]  Create a new user with a privilege and verify that user is created.
+    [Tags]  Verify_User_Access_Privilege
+    [Template]  Create User And Verify
+
+    # username      privilege_level  enabled
+    admin_user      Administrator    ${True}
+    operator_user   Operator         ${True}
+    readonly_user   ReadOnly         ${True}
+    noaccess_user   NoAccess         ${True}
+    disabled_user   Administrator    ${False}
+
+
+*** Keywords ***
+
+Create User And Verify
+    [Documentation]  Create a user with given user name and privilege and verify that the
+    ...  user is created successfully via GUI and Redfish.
+    [Teardown]  Run Keywords  Redfish.Logout  AND  Redfish.Login  AND
+    ...  Redfish.Delete  /redfish/v1/AccountService/Accounts/${user_name}
+    [Arguments]  ${user_name}  ${user_privilege}  ${enabled}
+
+    # Description of argument(s):
+    # user_name           The name of the user to be created (e.g. "test", "robert", etc.).
+    # user_privilege      Privilege of the user.
+    # enabled             If the user is enabled (e.g True if enabled, False if disabled).
+
+    Click Element  ${xpath_add_user}
+    Wait Until Page Contains Element  ${xpath_add_user_heading}
+
+    # Select disabled radio button if user needs to be disabled
+    Run Keyword If  ${enabled} == ${False}
+    ...  Click Element At Coordinates  ${xpath_account_status_disabled_button}  0  0
+
+    # Input username, password and privilege.
+    Input Text  ${xpath_username_input_button}  ${user_name}
+    Select From List by Value  ${xpath_privilege_list_button}  ${user_privilege}
+
+    Input Text  ${xpath_password_input_button}  ${test_user_password}
+
+    Input Text  ${xpath_password_confirm_button}  ${test_user_password}
+
+    # Submit.
+    Click Element  ${xpath_submit_button}
+
+    # Refresh page and check new user is available.
+    Wait Until Page Contains Element  ${xpath_add_user}
+    Click Element  ${xpath_refresh_button}
+    Wait Until Page Contains  ${user_name}  timeout=15
+
+    # Cross check the privilege of newly added user via Redfish.
+    ${user_priv_redfish}=  Redfish_Utils.Get Attribute
+    ...  /redfish/v1/AccountService/Accounts/${user_name}  RoleId
+    Should Be Equal  ${user_privilege}  ${user_priv_redfish}
+
+    # Check enable/disable status for user.
+    Redfish.Logout
+    ${status}=  Run Keyword And Return Status  Redfish.Login  ${user_name}  ${test_user_password}
+    Run Keyword If  ${enabled} == ${False}
+    ...  Should Be Equal  ${status}  ${False}
+    ...  ELSE  Should Be Equal  ${status}  ${True}
+
+
+Test Setup Execution
+    [Documentation]  Do test case setup tasks.
+
+    # Navigate to https://xx.xx.xx.xx/#/access-control/local-user-management  Local users page.
+
+    Click Element  ${xpath_access_control_menu}
+    Click Element  ${xpath_local_user_management_sub_menu}
+    Wait Until Keyword Succeeds  30 sec  10 sec  Location Should Contain  local-user-managemen