Naman Navin Hegde | 9e8c0d8 | 2019-08-11 15:22:44 -0500 | [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 | Library ../lib/ipmi_utils.py |
| 7 | Library ../lib/gen_robot_valid.py |
| 8 | |
| 9 | Test Teardown FFDC On Test Case Fail |
| 10 | |
| 11 | Force Tags IPMI_Network |
| 12 | |
| 13 | *** Variables *** |
| 14 | |
| 15 | ${initial_lan_config} &{EMPTY} |
| 16 | |
| 17 | |
| 18 | *** Test Cases *** |
| 19 | |
| 20 | Verify IPMI Inband Network Configuration |
| 21 | [Documentation] Verify BMC network configuration via inband IPMI. |
| 22 | [Tags] Verify_IPMI_Inband_Network_Configuration |
| 23 | [Teardown] Run Keywords Restore Configuration AND FFDC On Test Case Fail |
| 24 | |
| 25 | Redfish Power On |
| 26 | ${initial_lan_config}= Get LAN Print Dict inband |
| 27 | Set Suite Variable ${initial_lan_config} |
| 28 | |
| 29 | Set IPMI Inband Network Configuration 10.10.10.10 255.255.255.0 10.10.10.10 |
| 30 | Sleep 10 |
| 31 | |
| 32 | ${lan_print_output}= Get LAN Print Dict inband |
| 33 | Valid Value lan_print_output['IP Address'] ["10.10.10.10"] |
| 34 | Valid Value lan_print_output['Subnet Mask'] ["255.255.255.0"] |
| 35 | Valid Value lan_print_output['Default Gateway IP'] ["10.10.10.10"] |
| 36 | |
| 37 | |
| 38 | *** Keywords *** |
| 39 | |
| 40 | Set IPMI Inband Network Configuration |
| 41 | [Documentation] Run sequence of standard IPMI command in-band and set |
| 42 | ... the IP configuration. |
| 43 | [Arguments] ${ip} ${netmask} ${gateway} ${login}=${1} |
| 44 | |
| 45 | # Description of argument(s): |
| 46 | # ip The IP address to be set using ipmitool-inband. |
| 47 | # netmask The Netmask to be set using ipmitool-inband. |
| 48 | # gateway The Gateway address to be set using ipmitool-inband. |
| 49 | |
| 50 | Run Inband IPMI Standard Command |
| 51 | ... lan set 1 ipsrc static login_host=${login} |
| 52 | Run Inband IPMI Standard Command |
| 53 | ... lan set 1 ipaddr ${ip} login_host=${0} |
| 54 | Run Inband IPMI Standard Command |
| 55 | ... lan set 1 netmask ${netmask} login_host=${0} |
| 56 | Run Inband IPMI Standard Command |
| 57 | ... lan set 1 defgw ipaddr ${gateway} login_host=${0} |
| 58 | |
| 59 | |
| 60 | Restore Configuration |
| 61 | [Documentation] Restore the configuration to its pre-test state |
| 62 | |
| 63 | ${length}= Get Length ${initial_lan_config} |
| 64 | Return From Keyword If ${length} == ${0} |
| 65 | |
| 66 | Set IPMI Inband Network Configuration ${initial_lan_config['IP Address']} |
| 67 | ... ${initial_lan_config['Subnet Mask']} |
| 68 | ... ${initial_lan_config['Default Gateway IP']} login=${0} |