blob: 43134801b26df9bed4218232b0ad955db3273361 [file] [log] [blame]
George Keishing364e93d2020-03-05 04:31:49 -06001*** Settings ***
2
3Documentation Module to test IPMI network functionality.
4Resource ../lib/ipmi_client.robot
5Resource ../lib/openbmc_ffdc.robot
6Resource ../lib/bmc_network_utils.robot
7Library ../lib/ipmi_utils.py
8Library ../lib/gen_robot_valid.py
9Library ../lib/var_funcs.py
10Library ../lib/bmc_network_utils.py
11
12Suite Setup Suite Setup Execution
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -050013Suite Teardown Redfish.Logout
George Keishing364e93d2020-03-05 04:31:49 -060014Test Setup Printn
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -050015Test Teardown Test Teardown Execution
George Keishing364e93d2020-03-05 04:31:49 -060016
17Force Tags IPMI_Network_Config
18
19
20*** Variables ***
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -050021${vlan_id_for_ipmi} ${10}
George Keishing364e93d2020-03-05 04:31:49 -060022@{vlan_ids} ${20} ${30}
23${interface} eth0
24${ip} 10.0.0.1
25${initial_lan_config} &{EMPTY}
26${vlan_resource} ${NETWORK_MANAGER}action/VLAN
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -050027${netmask} ${24}
28${gateway} 0.0.0.0
29${vlan_id_for_rest} ${30}
30
George Keishing364e93d2020-03-05 04:31:49 -060031
32*** Test Cases ***
33
34Verify IPMI Inband Network Configuration
35 [Documentation] Verify BMC network configuration via inband IPMI.
36 [Tags] Verify_IPMI_Inband_Network_Configuration
37 [Teardown] Run Keywords Restore Configuration AND FFDC On Test Case Fail
38
39 Redfish Power On
40
41 Set IPMI Inband Network Configuration 10.10.10.10 255.255.255.0 10.10.10.10
42 Sleep 10
43
44 ${lan_print_output}= Get LAN Print Dict ${CHANNEL_NUMBER} ipmi_cmd_type=inband
45 Valid Value lan_print_output['IP Address'] ["10.10.10.10"]
46 Valid Value lan_print_output['Subnet Mask'] ["255.255.255.0"]
47 Valid Value lan_print_output['Default Gateway IP'] ["10.10.10.10"]
48
49
50Disable VLAN Via IPMI When Multiple VLAN Exist On BMC
51 [Documentation] Disable VLAN Via IPMI When Multiple VLAN Exist On BMC.
52 [Tags] Disable_VLAN_Via_IPMI_When_LAN_And_VLAN_Exist_On_BMC
George Keishing364e93d2020-03-05 04:31:49 -060053
54 FOR ${id} IN @{vlan_ids}
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -050055 Create VLAN ${vlan_id_for_rest}
George Keishing364e93d2020-03-05 04:31:49 -060056 END
57
58 Create VLAN Via IPMI off
59
60 ${lan_config}= Get LAN Print Dict ${CHANNEL_NUMBER} ipmi_cmd_type=inband
61 Valid Value lan_config['802.1q VLAN ID'] ['Disabled']
62
63
64Configure IP On VLAN Via IPMI
65 [Documentation] Configure IP On VLAN Via IPMI.
66 [Tags] Configure_IP_On_VLAN_Via_IPMI
George Keishing364e93d2020-03-05 04:31:49 -060067
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -050068 Create VLAN Via IPMI ${vlan_id_for_ipmi}
George Keishing364e93d2020-03-05 04:31:49 -060069
70 Run Inband IPMI Standard Command
71 ... lan set ${CHANNEL_NUMBER} ipaddr ${ip} login_host=${0}
72
73 ${lan_config}= Get LAN Print Dict ${CHANNEL_NUMBER} ipmi_cmd_type=inband
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -050074 Valid Value lan_config['802.1q VLAN ID'] ['${vlan_id_for_ipmi}']
George Keishing364e93d2020-03-05 04:31:49 -060075 Valid Value lan_config['IP Address'] ["${ip}"]
76
77
78Create VLAN Via IPMI When LAN And VLAN Exist On BMC
79 [Documentation] Create VLAN Via IPMI When LAN And VLAN Exist On BMC.
80 [Tags] Create_VLAN_Via_IPMI_When_LAN_And_VLAN_Exist_On_BMC
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -050081 [Setup] Create VLAN ${vlan_id_for_rest}
George Keishing364e93d2020-03-05 04:31:49 -060082
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -050083 Create VLAN Via IPMI ${vlan_id_for_ipmi}
George Keishing364e93d2020-03-05 04:31:49 -060084
85 ${lan_config}= Get LAN Print Dict ${CHANNEL_NUMBER} ipmi_cmd_type=inband
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -050086 Valid Value lan_config['802.1q VLAN ID'] ['${vlan_id_for_ipmi}']
George Keishing364e93d2020-03-05 04:31:49 -060087
88
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -050089Create VLAN Via IPMI And Verify
Anvesh Kumar Rayankula74ed7392020-02-10 01:00:11 -060090 [Documentation] Create and verify VLAN via IPMI.
91 [Tags] Create_VLAN_Via_IPMI_And_Verify
Anvesh Kumar Rayankula74ed7392020-02-10 01:00:11 -060092
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -050093 Create VLAN Via IPMI ${vlan_id_for_ipmi}
Anvesh Kumar Rayankula74ed7392020-02-10 01:00:11 -060094
95 ${lan_config}= Get LAN Print Dict ${CHANNEL_NUMBER} ipmi_cmd_type=inband
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -050096 Valid Value lan_config['802.1q VLAN ID'] ['${vlan_id_for_ipmi}']
Anvesh Kumar Rayankula74ed7392020-02-10 01:00:11 -060097 Valid Value lan_config['IP Address'] ['${network_configurations[0]['Address']}']
98 Valid Value lan_config['Subnet Mask'] ['${network_configurations[0]['SubnetMask']}']
99
100
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -0500101Test Disabling Of VLAN Via IPMI
Anvesh Kumar Rayankula74ed7392020-02-10 01:00:11 -0600102 [Documentation] Disable VLAN and verify via IPMI.
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -0500103 [Tags] Test_Disabling_Of_VLAN_Via_IPMI
Anvesh Kumar Rayankula74ed7392020-02-10 01:00:11 -0600104
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -0500105 Create VLAN Via IPMI ${vlan_id_for_ipmi}
Anvesh Kumar Rayankula74ed7392020-02-10 01:00:11 -0600106 Create VLAN Via IPMI off
107
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -0500108 ${lan_config}= Get LAN Print Dict ${CHANNEL_NUMBER} ipmi_cmd_type=inband
Anvesh Kumar Rayankula74ed7392020-02-10 01:00:11 -0600109 Valid Value lan_config['802.1q VLAN ID'] ['Disabled']
110
111
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -0500112Create VLAN When LAN And VLAN Exist With IP Address Configured
113 [Documentation] Create VLAN when LAN and VLAN exist with IP address configured.
114 [Tags] Create_VLAN_When_LAN_And_VLAN_Exist_With_IP_Address_Configured
115 [Setup] Run Keywords Create VLAN ${vlan_id_for_rest} AND Configure Network Settings On VLAN
116 ... ${vlan_id_for_rest} ${ip} ${netmask} ${gateway}
117
118 Create VLAN Via IPMI ${vlan_id_for_ipmi}
119
120 ${lan_config}= Get LAN Print Dict ${CHANNEL_NUMBER} ipmi_cmd_type=inband
121 Valid Value lan_config['802.1q VLAN ID'] ['${vlan_id_for_ipmi}']
122 Valid Value lan_config['IP Address'] ['${ip}']
123
George Keishing364e93d2020-03-05 04:31:49 -0600124*** Keywords ***
125
126Create VLAN Via IPMI
127 [Documentation] Create VLAN via inband IPMI command.
128 [Arguments] ${vlan_id} ${channel_number}=${CHANNEL_NUMBER}
129
130 # Description of argument(s):
131 # vlan_id The VLAN ID (e.g. '10').
132
133 Run Inband IPMI Standard Command
134 ... lan set ${channel_number} vlan id ${vlan_id} login_host=${0}
135
136
137Set IPMI Inband Network Configuration
138 [Documentation] Run sequence of standard IPMI command in-band and set
139 ... the IP configuration.
140 [Arguments] ${ip} ${netmask} ${gateway} ${login}=${1}
141
142 # Description of argument(s):
143 # ip The IP address to be set using ipmitool-inband.
144 # netmask The Netmask to be set using ipmitool-inband.
145 # gateway The Gateway address to be set using ipmitool-inband.
146
147 Run Inband IPMI Standard Command
148 ... lan set ${CHANNEL_NUMBER} ipsrc static login_host=${login}
149 Run Inband IPMI Standard Command
150 ... lan set ${CHANNEL_NUMBER} ipaddr ${ip} login_host=${0}
151 Run Inband IPMI Standard Command
152 ... lan set ${CHANNEL_NUMBER} netmask ${netmask} login_host=${0}
153 Run Inband IPMI Standard Command
154 ... lan set ${CHANNEL_NUMBER} defgw ipaddr ${gateway} login_host=${0}
155
156
157Restore Configuration
158 [Documentation] Restore the configuration to its pre-test state
159 ${length}= Get Length ${initial_lan_config}
160 Return From Keyword If ${length} == ${0}
161
162 Set IPMI Inband Network Configuration ${network_configurations[0]['Address']}
163 ... ${network_configurations[0]['SubnetMask']}
164 ... ${initial_lan_config['Default Gateway IP']} login=${0}
165
166
167Suite Setup Execution
168 [Documentation] Suite Setup Execution.
169
170 Redfish.Login
171
172 Run Inband IPMI Standard Command
173 ... lan set ${CHANNEL_NUMBER} ipsrc static login_host=${1}
174
175 @{network_configurations}= Get Network Configuration
176 Set Suite Variable @{network_configurations}
177
178 ${initial_lan_config}= Get LAN Print Dict ${CHANNEL_NUMBER} ipmi_cmd_type=inband
179 Set Suite Variable ${initial_lan_config}
Anvesh Kumar Rayankulae354c1c2020-03-09 06:01:13 -0500180
181
182Test Teardown Execution
183 [Documentation] Test Teardown Execution.
184
185 FFDC On Test Case Fail
186 Create VLAN Via IPMI off
187 Restore Configuration
188