Enable and disable eth0 interface
Changes:
1.Added ldap resource file path in ldap testsuite
2.Added new testcase to enable and disable eth0 interface
Change-Id: I24521b1bbfb158a7cb7e9eaeb2c80a7f95e22d21
Signed-off-by: Anves Kumar rayankula <anvesr77@in.ibm.com>
diff --git a/redfish/account_service/test_ldap_configuration.robot b/redfish/account_service/test_ldap_configuration.robot
index 6edd53b..a83ecc5 100644
--- a/redfish/account_service/test_ldap_configuration.robot
+++ b/redfish/account_service/test_ldap_configuration.robot
@@ -7,6 +7,7 @@
Resource ../../lib/openbmc_ffdc.robot
Library ../../lib/gen_robot_valid.py
Resource ../../lib/bmc_network_utils.robot
+Resource ../../lib/bmc_ldap_utils.robot
Suite Setup Suite Setup Execution
Suite Teardown Run Keywords Restore LDAP Privilege AND Redfish.Logout
diff --git a/redfish/managers/test_multiple_interfaces.robot b/redfish/managers/test_multiple_interfaces.robot
index 8a8abb3..adcf24b 100644
--- a/redfish/managers/test_multiple_interfaces.robot
+++ b/redfish/managers/test_multiple_interfaces.robot
@@ -75,6 +75,16 @@
Create Error On BMC And Verify Trap
+Disable And Enable Eth0 Interface
+ [Documentation] Disable and Enable eth0 ethernet interface via redfish.
+ [Tags] Disable_And_Enable_Eth0_Interface
+ [Template] Set BMC Ethernet Interfaces State
+
+ # interface_ip interface enabled
+ ${OPENBMC_HOST} eth0 ${False}
+ ${OPENBMC_HOST} eth0 ${True}
+
+
*** Keywords ***
Get Network Configuration Using Channel Number
@@ -110,3 +120,30 @@
... AND Exit For Loop
END
+
+
+Set BMC Ethernet Interfaces State
+ [Documentation] Set BMC ethernet interface state.
+ [Arguments] ${interface_ip} ${interface} ${enabled}
+ [Teardown] Redfish1.Logout
+
+ # Description of argument(s):
+ # interface_ip IP address of ethernet interface.
+ # interface The ethernet interface name (eg. eth0 or eth1).
+ # enabled Indicates interface should be enabled (eg. True or False).
+
+ Redfish1.Login
+
+ ${data}= Create Dictionary InterfaceEnabled=${enabled}
+
+ Redfish1.patch ${REDFISH_NW_ETH_IFACE}${interface} body=&{data}
+ ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
+
+ Sleep ${NETWORK_TIMEOUT}s
+ ${interface_status}= Redfish1.Get Attribute ${REDFISH_NW_ETH_IFACE}${interface} InterfaceEnabled
+ Should Be Equal ${interface_status} ${enabled}
+
+ ${status}= Run Keyword And Return Status Ping Host ${interface_ip}
+
+ Run Keyword If ${enabled} == ${True} Should Be Equal ${status} ${True}
+ ... ELSE Should Be Equal ${status} ${False}