George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation Module to test IPMI network functionality. |
| 4 | Resource ../lib/ipmi_client.robot |
| 5 | Resource ../lib/openbmc_ffdc.robot |
| 6 | Resource ../lib/bmc_network_utils.robot |
| 7 | Library ../lib/ipmi_utils.py |
| 8 | Library ../lib/gen_robot_valid.py |
| 9 | Library ../lib/var_funcs.py |
| 10 | Library ../lib/bmc_network_utils.py |
| 11 | |
| 12 | Suite Setup Suite Setup Execution |
Anvesh Kumar Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 13 | Suite Teardown Redfish.Logout |
George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 14 | Test Setup Printn |
Anvesh Kumar Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 15 | Test Teardown Test Teardown Execution |
George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 16 | |
| 17 | Force Tags IPMI_Network_Config |
| 18 | |
| 19 | |
| 20 | *** Variables *** |
Anvesh Kumar Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 21 | ${vlan_id_for_ipmi} ${10} |
George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 22 | @{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 Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 27 | ${netmask} ${24} |
| 28 | ${gateway} 0.0.0.0 |
| 29 | ${vlan_id_for_rest} ${30} |
| 30 | |
George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 31 | |
| 32 | *** Test Cases *** |
| 33 | |
| 34 | Verify 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 | |
| 50 | Disable 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 Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 53 | |
| 54 | FOR ${id} IN @{vlan_ids} |
Anvesh Kumar Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 55 | Create VLAN ${vlan_id_for_rest} |
George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 56 | 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 | |
| 64 | Configure IP On VLAN Via IPMI |
| 65 | [Documentation] Configure IP On VLAN Via IPMI. |
| 66 | [Tags] Configure_IP_On_VLAN_Via_IPMI |
George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 67 | |
Anvesh Kumar Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 68 | Create VLAN Via IPMI ${vlan_id_for_ipmi} |
George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 69 | |
| 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 Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 74 | Valid Value lan_config['802.1q VLAN ID'] ['${vlan_id_for_ipmi}'] |
George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 75 | Valid Value lan_config['IP Address'] ["${ip}"] |
| 76 | |
| 77 | |
| 78 | Create 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 Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 81 | [Setup] Create VLAN ${vlan_id_for_rest} |
George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 82 | |
Anvesh Kumar Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 83 | Create VLAN Via IPMI ${vlan_id_for_ipmi} |
George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 84 | |
| 85 | ${lan_config}= Get LAN Print Dict ${CHANNEL_NUMBER} ipmi_cmd_type=inband |
Anvesh Kumar Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 86 | Valid Value lan_config['802.1q VLAN ID'] ['${vlan_id_for_ipmi}'] |
George Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 87 | |
| 88 | |
Anvesh Kumar Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 89 | Create VLAN Via IPMI And Verify |
Anvesh Kumar Rayankula | 74ed739 | 2020-02-10 01:00:11 -0600 | [diff] [blame] | 90 | [Documentation] Create and verify VLAN via IPMI. |
| 91 | [Tags] Create_VLAN_Via_IPMI_And_Verify |
Anvesh Kumar Rayankula | 74ed739 | 2020-02-10 01:00:11 -0600 | [diff] [blame] | 92 | |
Anvesh Kumar Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 93 | Create VLAN Via IPMI ${vlan_id_for_ipmi} |
Anvesh Kumar Rayankula | 74ed739 | 2020-02-10 01:00:11 -0600 | [diff] [blame] | 94 | |
| 95 | ${lan_config}= Get LAN Print Dict ${CHANNEL_NUMBER} ipmi_cmd_type=inband |
Anvesh Kumar Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 96 | Valid Value lan_config['802.1q VLAN ID'] ['${vlan_id_for_ipmi}'] |
Anvesh Kumar Rayankula | 74ed739 | 2020-02-10 01:00:11 -0600 | [diff] [blame] | 97 | 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 Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 101 | Test Disabling Of VLAN Via IPMI |
Anvesh Kumar Rayankula | 74ed739 | 2020-02-10 01:00:11 -0600 | [diff] [blame] | 102 | [Documentation] Disable VLAN and verify via IPMI. |
Anvesh Kumar Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 103 | [Tags] Test_Disabling_Of_VLAN_Via_IPMI |
Anvesh Kumar Rayankula | 74ed739 | 2020-02-10 01:00:11 -0600 | [diff] [blame] | 104 | |
Anvesh Kumar Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 105 | Create VLAN Via IPMI ${vlan_id_for_ipmi} |
Anvesh Kumar Rayankula | 74ed739 | 2020-02-10 01:00:11 -0600 | [diff] [blame] | 106 | Create VLAN Via IPMI off |
| 107 | |
Anvesh Kumar Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 108 | ${lan_config}= Get LAN Print Dict ${CHANNEL_NUMBER} ipmi_cmd_type=inband |
Anvesh Kumar Rayankula | 74ed739 | 2020-02-10 01:00:11 -0600 | [diff] [blame] | 109 | Valid Value lan_config['802.1q VLAN ID'] ['Disabled'] |
| 110 | |
| 111 | |
Anvesh Kumar Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 112 | Create 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 Keishing | 364e93d | 2020-03-05 04:31:49 -0600 | [diff] [blame] | 124 | *** Keywords *** |
| 125 | |
| 126 | Create 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 | |
| 137 | Set 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 | |
| 157 | Restore 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 | |
| 167 | Suite 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 Rayankula | e354c1c | 2020-03-09 06:01:13 -0500 | [diff] [blame^] | 180 | |
| 181 | |
| 182 | Test Teardown Execution |
| 183 | [Documentation] Test Teardown Execution. |
| 184 | |
| 185 | FFDC On Test Case Fail |
| 186 | Create VLAN Via IPMI off |
| 187 | Restore Configuration |
| 188 | |