blob: da4bfc64e9fbe6acf49d3a6fc19a7b146e075859 [file] [log] [blame]
Sweta Potthuriab871742023-02-20 11:08:42 -06001*** Settings ***
2Documentation Test BMC DHCP multiple network interface functionalities.
3
4Resource ../../lib/resource.robot
5Resource ../../lib/common_utils.robot
6Resource ../../lib/connection_client.robot
7Resource ../../lib/bmc_network_utils.robot
8Resource ../../lib/openbmc_ffdc.robot
9
10Suite Setup Suite Setup Execution
11Test Teardown FFDC On Test Case Fail
12Suite 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
24Disable DHCP On Eth1 And Verify System Is Accessible By Eth0
George Keishing618aff72023-03-09 09:55:19 +053025 [Documentation] Disable DHCP on eth1 using Redfish and verify
26 ... if system is accessible by eth0.
Sweta Potthuriab871742023-02-20 11:08:42 -060027 [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
33Enable DHCP On Eth1 And Verify System Is Accessible By Eth0
George Keishing618aff72023-03-09 09:55:19 +053034 [Documentation] Enable DHCP on eth1 using Redfish and verify if system
35 ... is accessible by eth0.
Sweta Potthuriab871742023-02-20 11:08:42 -060036 [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
44Set DHCPEnabled To Enable Or Disable
45 [Documentation] Enable or Disable DHCP on the interface.
George Keishing618aff72023-03-09 09:55:19 +053046 [Arguments] ${dhcp_enabled}=${False} ${interface}=${ethernet_interface}
47 ... ${valid_status_code}=[${HTTP_OK},${HTTP_ACCEPTED}]
Sweta Potthuriab871742023-02-20 11:08:42 -060048
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 Keishing618aff72023-03-09 09:55:19 +053052 # valid_status_code Expected valid status code from Patch request.
53 # Default is HTTP_OK.
Sweta Potthuriab871742023-02-20 11:08:42 -060054
55 ${data}= Set Variable If ${dhcp_enabled} == ${False} ${DISABLE_DHCP} ${ENABLE_DHCP}
56 ${resp}= Redfish.Patch
ganesanb4d430282023-04-27 14:33:23 +000057 ... /redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/${interface}
Sweta Potthuriab871742023-02-20 11:08:42 -060058 ... body=${data} valid_status_codes=${valid_status_code}
59
60Suite Setup Execution
61 [Documentation] Do suite setup task.
62
63 Ping Host ${OPENBMC_HOST}
64 Redfish.Login