Verify that LDAP user login fails when wrong LDAP port is configured

Changes:
 - Added test case to configure LDAP with wrong port and verify login fails

Tested:
 Ran this test case along with all other test cases from the LDAP suite.

Change-Id: I1643a4c096feb2246c7d6d210a0bf246d6bab123
Signed-off-by: Priya Sinha <Priya.Sinha2@ibm.com>
diff --git a/gui/gui_test/security_and_access_menu/test_ldap_sub_menu.robot b/gui/gui_test/security_and_access_menu/test_ldap_sub_menu.robot
index 42def6d..e77f303 100644
--- a/gui/gui_test/security_and_access_menu/test_ldap_sub_menu.robot
+++ b/gui/gui_test/security_and_access_menu/test_ldap_sub_menu.robot
@@ -30,6 +30,7 @@
 
 
 ${incorrect_ip}     1.2.3.4
+${wrong_ldap_port}  135
 
 *** Test Cases ***
 
@@ -165,6 +166,23 @@
     ${GROUP_NAME}    NoAccess       ${HTTP_FORBIDDEN}
 
 
+Verify LDAP Login Fails On Wrong LDAP Port
+    [Documentation]  Verify that LDAP login fails when wrong port is entered in LDAP URL.
+    [Tags]  Verify_LDAP_Login_Fails_On_Wrong_LDAP_Port
+    [Teardown]  Run Keywords  Redfish.Logout  AND  Redfish.Login
+
+    ${ldap_uri_wrong_port}=  Catenate  SEPARATOR=:  ${LDAP_SERVER_URI}  ${wrong_ldap_port}
+    Create LDAP Configuration  ${ldap_uri_wrong_port}  ${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 wrong port in LDAP URL
+
 *** Keywords ***
 
 Suite Setup Execution
@@ -354,3 +372,4 @@
 
     ${mac_address}=  Redfish.Get Attribute  ${REDFISH_NW_ETH0_URI}  MACAddress
     Textfield Value Should Be  ${xpath_mac_address_input}  ${mac_address}
+