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 |
George Keishing | 618aff7 | 2023-03-09 09:55:19 +0530 | [diff] [blame] | 25 | [Documentation] Disable DHCP on eth1 using Redfish and verify |
| 26 | ... if system is accessible by eth0. |
Sweta Potthuri | ab87174 | 2023-02-20 11:08:42 -0600 | [diff] [blame] | 27 | [Tags] Disable_DHCP_On_Eth1_And_Verify_System_Is_Accessible_By_Eth0 |
| 28 | [Teardown] Set DHCPEnabled To Enable Or Disable True eth1 |
| 29 | |
| 30 | Set DHCPEnabled To Enable Or Disable False eth1 |
| 31 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 32 | |
| 33 | Enable DHCP On Eth1 And Verify System Is Accessible By Eth0 |
George Keishing | 618aff7 | 2023-03-09 09:55:19 +0530 | [diff] [blame] | 34 | [Documentation] Enable DHCP on eth1 using Redfish and verify if system |
| 35 | ... is accessible by eth0. |
Sweta Potthuri | ab87174 | 2023-02-20 11:08:42 -0600 | [diff] [blame] | 36 | [Tags] Enable_DHCP_On_Eth1_And_Verify_System_Is_Accessible_By_Eth0 |
| 37 | [Setup] Set DHCPEnabled To Enable Or Disable False eth1 |
| 38 | |
| 39 | Set DHCPEnabled To Enable Or Disable True eth1 |
| 40 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 41 | |
| 42 | *** Keywords *** |
| 43 | |
| 44 | Set DHCPEnabled To Enable Or Disable |
| 45 | [Documentation] Enable or Disable DHCP on the interface. |
George Keishing | 618aff7 | 2023-03-09 09:55:19 +0530 | [diff] [blame] | 46 | [Arguments] ${dhcp_enabled}=${False} ${interface}=${ethernet_interface} |
| 47 | ... ${valid_status_code}=[${HTTP_OK},${HTTP_ACCEPTED}] |
Sweta Potthuri | ab87174 | 2023-02-20 11:08:42 -0600 | [diff] [blame] | 48 | |
| 49 | # Description of argument(s): |
| 50 | # dhcp_enabled False for disabling DHCP and True for Enabling DHCP. |
| 51 | # interface eth0 or eth1. Default is eth1. |
George Keishing | 618aff7 | 2023-03-09 09:55:19 +0530 | [diff] [blame] | 52 | # valid_status_code Expected valid status code from Patch request. |
| 53 | # Default is HTTP_OK. |
Sweta Potthuri | ab87174 | 2023-02-20 11:08:42 -0600 | [diff] [blame] | 54 | |
| 55 | ${data}= Set Variable If ${dhcp_enabled} == ${False} ${DISABLE_DHCP} ${ENABLE_DHCP} |
| 56 | ${resp}= Redfish.Patch |
ganesanb | 4d43028 | 2023-04-27 14:33:23 +0000 | [diff] [blame] | 57 | ... /redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/${interface} |
Sweta Potthuri | ab87174 | 2023-02-20 11:08:42 -0600 | [diff] [blame] | 58 | ... body=${data} valid_status_codes=${valid_status_code} |
| 59 | |
| 60 | Suite Setup Execution |
| 61 | [Documentation] Do suite setup task. |
| 62 | |
| 63 | Ping Host ${OPENBMC_HOST} |
| 64 | Redfish.Login |