blob: a9d75bac17644a099e710ba11fd190555ffe4290 [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
13Test Setup Printn
14Test Teardown FFDC On Test Case Fail
15
16Force Tags IPMI_Network_Config
17
18
19*** Variables ***
20${vlan_id} ${10}
21@{vlan_ids} ${20} ${30}
22${interface} eth0
23${ip} 10.0.0.1
24${initial_lan_config} &{EMPTY}
25${vlan_resource} ${NETWORK_MANAGER}action/VLAN
26
27*** Test Cases ***
28
29Verify IPMI Inband Network Configuration
30 [Documentation] Verify BMC network configuration via inband IPMI.
31 [Tags] Verify_IPMI_Inband_Network_Configuration
32 [Teardown] Run Keywords Restore Configuration AND FFDC On Test Case Fail
33
34 Redfish Power On
35
36 Set IPMI Inband Network Configuration 10.10.10.10 255.255.255.0 10.10.10.10
37 Sleep 10
38
39 ${lan_print_output}= Get LAN Print Dict ${CHANNEL_NUMBER} ipmi_cmd_type=inband
40 Valid Value lan_print_output['IP Address'] ["10.10.10.10"]
41 Valid Value lan_print_output['Subnet Mask'] ["255.255.255.0"]
42 Valid Value lan_print_output['Default Gateway IP'] ["10.10.10.10"]
43
44
45Disable VLAN Via IPMI When Multiple VLAN Exist On BMC
46 [Documentation] Disable VLAN Via IPMI When Multiple VLAN Exist On BMC.
47 [Tags] Disable_VLAN_Via_IPMI_When_LAN_And_VLAN_Exist_On_BMC
48 [Teardown] Run Keywords FFDC On Test Case Fail AND
49 ... Create VLAN Via IPMI off AND Restore Configuration
50
51 FOR ${id} IN @{vlan_ids}
52 @{data_vlan_id}= Create List ${interface} ${id}
53 ${data}= Create Dictionary data=@{data_vlan_id}
54 ${resp}= OpenBMC Post Request ${vlan_resource} data=${data}
55 END
56
57 Create VLAN Via IPMI off
58
59 ${lan_config}= Get LAN Print Dict ${CHANNEL_NUMBER} ipmi_cmd_type=inband
60 Valid Value lan_config['802.1q VLAN ID'] ['Disabled']
61
62
63Configure IP On VLAN Via IPMI
64 [Documentation] Configure IP On VLAN Via IPMI.
65 [Tags] Configure_IP_On_VLAN_Via_IPMI
66 [Teardown] Run Keywords FFDC On Test Case Fail AND
67 ... Create VLAN Via IPMI off AND Restore Configuration
68
69 Create VLAN Via IPMI ${vlan_id}
70
71 Run Inband IPMI Standard Command
72 ... lan set ${CHANNEL_NUMBER} ipaddr ${ip} login_host=${0}
73
74 ${lan_config}= Get LAN Print Dict ${CHANNEL_NUMBER} ipmi_cmd_type=inband
75 Valid Value lan_config['802.1q VLAN ID'] ['${vlan_id}']
76 Valid Value lan_config['IP Address'] ["${ip}"]
77
78
79Create VLAN Via IPMI When LAN And VLAN Exist On BMC
80 [Documentation] Create VLAN Via IPMI When LAN And VLAN Exist On BMC.
81 [Tags] Create_VLAN_Via_IPMI_When_LAN_And_VLAN_Exist_On_BMC
82 [Teardown] Run Keywords FFDC On Test Case Fail AND
83 ... Create VLAN Via IPMI off AND Restore Configuration
84
85 @{data_vlan_id}= Create List ${interface} ${vlan_id}
86 ${data}= Create Dictionary data=@{data_vlan_id}
87 ${resp}= OpenBMC Post Request ${vlan_resource} data=${data}
88
89 Create VLAN Via IPMI ${vlan_id}
90
91 ${lan_config}= Get LAN Print Dict ${CHANNEL_NUMBER} ipmi_cmd_type=inband
92 Valid Value lan_config['802.1q VLAN ID'] ['${vlan_id}']
93
94
Anvesh Kumar Rayankula74ed7392020-02-10 01:00:11 -060095Create VLAN Via IPMI
96 [Documentation] Create and verify VLAN via IPMI.
97 [Tags] Create_VLAN_Via_IPMI_And_Verify
98 [Teardown] Run Keywords FFDC On Test Case Fail AND
99 ... Create VLAN Via IPMI off AND Restore Configuration
100
101 Create VLAN Via IPMI ${vlan_id}
102
103 ${lan_config}= Get LAN Print Dict ${CHANNEL_NUMBER} ipmi_cmd_type=inband
104 Valid Value lan_config['802.1q VLAN ID'] ['${vlan_id}']
105 Valid Value lan_config['IP Address'] ['${network_configurations[0]['Address']}']
106 Valid Value lan_config['Subnet Mask'] ['${network_configurations[0]['SubnetMask']}']
107
108
109Create VLAN Via IPMI And Disable VLAN
110 [Documentation] Disable VLAN and verify via IPMI.
111 [Tags] Test_Disable_VLAN_Via_IPMI
112 [Teardown] Run Keywords FFDC On Test Case Fail AND
113 ... Create VLAN Via IPMI off AND Restore Configuration
114
115 Create VLAN Via IPMI ${vlan_id}
116 Create VLAN Via IPMI off
117
118 ${lan_config}= Get LAN Print Dict
119 Valid Value lan_config['802.1q VLAN ID'] ['Disabled']
120
121
George Keishing364e93d2020-03-05 04:31:49 -0600122*** Keywords ***
123
124Create VLAN Via IPMI
125 [Documentation] Create VLAN via inband IPMI command.
126 [Arguments] ${vlan_id} ${channel_number}=${CHANNEL_NUMBER}
127
128 # Description of argument(s):
129 # vlan_id The VLAN ID (e.g. '10').
130
131 Run Inband IPMI Standard Command
132 ... lan set ${channel_number} vlan id ${vlan_id} login_host=${0}
133
134
135Set IPMI Inband Network Configuration
136 [Documentation] Run sequence of standard IPMI command in-band and set
137 ... the IP configuration.
138 [Arguments] ${ip} ${netmask} ${gateway} ${login}=${1}
139
140 # Description of argument(s):
141 # ip The IP address to be set using ipmitool-inband.
142 # netmask The Netmask to be set using ipmitool-inband.
143 # gateway The Gateway address to be set using ipmitool-inband.
144
145 Run Inband IPMI Standard Command
146 ... lan set ${CHANNEL_NUMBER} ipsrc static login_host=${login}
147 Run Inband IPMI Standard Command
148 ... lan set ${CHANNEL_NUMBER} ipaddr ${ip} login_host=${0}
149 Run Inband IPMI Standard Command
150 ... lan set ${CHANNEL_NUMBER} netmask ${netmask} login_host=${0}
151 Run Inband IPMI Standard Command
152 ... lan set ${CHANNEL_NUMBER} defgw ipaddr ${gateway} login_host=${0}
153
154
155Restore Configuration
156 [Documentation] Restore the configuration to its pre-test state
157 ${length}= Get Length ${initial_lan_config}
158 Return From Keyword If ${length} == ${0}
159
160 Set IPMI Inband Network Configuration ${network_configurations[0]['Address']}
161 ... ${network_configurations[0]['SubnetMask']}
162 ... ${initial_lan_config['Default Gateway IP']} login=${0}
163
164
165Suite Setup Execution
166 [Documentation] Suite Setup Execution.
167
168 Redfish.Login
169
170 Run Inband IPMI Standard Command
171 ... lan set ${CHANNEL_NUMBER} ipsrc static login_host=${1}
172
173 @{network_configurations}= Get Network Configuration
174 Set Suite Variable @{network_configurations}
175
176 ${initial_lan_config}= Get LAN Print Dict ${CHANNEL_NUMBER} ipmi_cmd_type=inband
177 Set Suite Variable ${initial_lan_config}