Verify LDAP Login Works When Eth1 IP Is Not Configured

changes:
     - Moved LDAP keys to lib.
     - Added new LDAP test case for multiple interfaces.

Change-Id: I843a62034268eeb890c0c15d33a3838b78654215
Signed-off-by: Anves Kumar rayankula <anvesr77@in.ibm.com>
diff --git a/redfish/managers/test_multiple_interfaces.robot b/redfish/managers/test_multiple_interfaces.robot
index 4a0a4b2..15b1ccf 100644
--- a/redfish/managers/test_multiple_interfaces.robot
+++ b/redfish/managers/test_multiple_interfaces.robot
@@ -11,14 +11,15 @@
 Resource        ../../lib/connection_client.robot
 Resource        ../../lib/bmc_network_utils.robot
 Resource        ../../lib/openbmc_ffdc.robot
+Resource        ../../lib/bmc_ldap_utils.robot
 
 Suite Setup     Suite Setup Execution
 Test Teardown   FFDC On Test Case Fail
-
+Suite Teardown  Run Keywords  Redfish1.Logout  AND  Redfish.Logout
 
 *** Test Cases ***
 
-Verify Both Interfaces BMC IP Addreeses Accessible Via SSH
+Verify Both Interfaces BMC IP Addresses Accessible Via SSH
     [Documentation]  Verify both interfaces (eth0, eth1) BMC IP addresses accessible via SSH.
     [Tags]  Verify_Both_Interfaces_BMC_IP_Addresses_Accessible_Via_SSH
 
@@ -47,6 +48,20 @@
     ${resp2}=  Redfish1.Get  ${REDFISH_NW_ETH_IFACE}eth1
     Should Be Equal  ${resp1.dict['HostName']}  ${resp2.dict['HostName']}
 
+
+Verify LDAP Login Works When Eth1 IP Is Not Configured
+    [Documentation]  Verify LDAP login works when eth1 IP is erased.
+    [Tags]  Verify_LDAP_Login_Works_When_Eth1_IP_Is_Not_Configured
+    [Setup]  Run Keywords  Set Test Variable  ${CHANNEL_NUMBER}  ${2}
+    ...  AND  Delete IP Address  ${OPENBMC_HOST_1}
+    [Teardown]  Run Keywords  Redfish.Login  AND
+    ...  Add IP Address  ${OPENBMC_HOST_1}  ${eth1_subnet_mask}  ${eth1_gateway}
+
+    Create LDAP Configuration
+    Redfish.Login  ${LDAP_USER}  ${LDAP_USER_PASSWORD}
+    Redfish.Logout
+
+
 *** Keywords ***
 
 Get Network Configuration Using Channel Number
@@ -72,3 +87,14 @@
     # Check both interfaces are configured and reachable.
     Ping Host  ${OPENBMC_HOST}
     Ping Host  ${OPENBMC_HOST_1}
+
+    ${network_configurations}=  Get Network Configuration Using Channel Number  ${2}
+    FOR  ${network_configuration}  IN  @{network_configurations}
+
+      Run Keyword If  '${network_configuration['Address']}' == '${OPENBMC_HOST_1}'
+      ...  Run Keywords  Set Suite Variable  ${eth1_subnet_mask}  ${network_configuration['SubnetMask']}
+      ...  AND  Set Suite Variable  ${eth1_gateway}  ${network_configuration['Gateway']}
+      ...  AND  Exit For Loop
+
+    END
+