Sweta Potthuri | ab87174 | 2023-02-20 11:08:42 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test BMC DHCP multiple network interface functionalities. |
| 3 | |
| 4 | Resource ../../lib/resource.robot |
| 5 | Resource ../../lib/common_utils.robot |
| 6 | Resource ../../lib/connection_client.robot |
| 7 | Resource ../../lib/bmc_network_utils.robot |
| 8 | Resource ../../lib/openbmc_ffdc.robot |
| 9 | |
| 10 | Suite Setup Suite Setup Execution |
| 11 | Test Teardown FFDC On Test Case Fail |
| 12 | Suite Teardown Redfish.Logout |
| 13 | |
| 14 | *** Variables *** |
| 15 | |
| 16 | &{DHCP_ENABLED} DHCPEnabled=${True} |
| 17 | &{DHCP_DISABLED} DHCPEnabled=${False} |
| 18 | &{ENABLE_DHCP} DHCPv4=${DHCP_ENABLED} |
| 19 | &{DISABLE_DHCP} DHCPv4=${DHCP_DISABLED} |
| 20 | ${ethernet_interface} eth1 |
| 21 | |
| 22 | *** Test Cases *** |
| 23 | |
| 24 | Disable DHCP On Eth1 And Verify System Is Accessible By Eth0 |
| 25 | [Documentation] Disable DHCP on eth1 using Redfish and verify if system is accessible by eth0. |
| 26 | [Tags] Disable_DHCP_On_Eth1_And_Verify_System_Is_Accessible_By_Eth0 |
| 27 | [Teardown] Set DHCPEnabled To Enable Or Disable True eth1 |
| 28 | |
| 29 | Set DHCPEnabled To Enable Or Disable False eth1 |
| 30 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 31 | |
| 32 | Enable DHCP On Eth1 And Verify System Is Accessible By Eth0 |
| 33 | [Documentation] Enable DHCP on eth1 using Redfish and verify if system is accessible by eth0. |
| 34 | [Tags] Enable_DHCP_On_Eth1_And_Verify_System_Is_Accessible_By_Eth0 |
| 35 | [Setup] Set DHCPEnabled To Enable Or Disable False eth1 |
| 36 | |
| 37 | Set DHCPEnabled To Enable Or Disable True eth1 |
| 38 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 39 | |
| 40 | *** Keywords *** |
| 41 | |
| 42 | Set DHCPEnabled To Enable Or Disable |
| 43 | [Documentation] Enable or Disable DHCP on the interface. |
| 44 | [Arguments] ${dhcp_enabled}=${False} ${interface}=${ethernet_interface} ${valid_status_code}=[${HTTP_OK},${HTTP_ACCEPTED}] |
| 45 | |
| 46 | # Description of argument(s): |
| 47 | # dhcp_enabled False for disabling DHCP and True for Enabling DHCP. |
| 48 | # interface eth0 or eth1. Default is eth1. |
| 49 | # valid_status_code Expected valid status code from Patch request. Default is HTTP_OK. |
| 50 | |
| 51 | ${data}= Set Variable If ${dhcp_enabled} == ${False} ${DISABLE_DHCP} ${ENABLE_DHCP} |
| 52 | ${resp}= Redfish.Patch |
| 53 | ... /redfish/v1/Managers/bmc/EthernetInterfaces/${interface} |
| 54 | ... body=${data} valid_status_codes=${valid_status_code} |
| 55 | |
| 56 | Suite Setup Execution |
| 57 | [Documentation] Do suite setup task. |
| 58 | |
| 59 | Ping Host ${OPENBMC_HOST} |
| 60 | Redfish.Login |