Sunil M | e5db44c | 2017-04-25 10:03:10 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Update BMC MAC address with input MAC. |
| 3 | |
| 4 | Library ../lib/gen_robot_keyword.py |
| 5 | Resource ../lib/utils.robot |
| 6 | Resource ../extended/obmc_boot_test_resource.robot |
| 7 | |
| 8 | *** Variables *** |
| 9 | |
| 10 | # MAC input from Jenkins job. |
| 11 | ${MAC_ADDRESS} ${EMPTY} |
| 12 | |
| 13 | *** Test Cases *** |
| 14 | |
| 15 | Check And Reset MAC |
| 16 | [Documentation] Update BMC with user input MAC address. |
| 17 | |
| 18 | Should Not Be Empty ${MAC_ADDRESS} |
| 19 | Open Connection And Log In |
| 20 | ${bmc_mac_addr}= Execute Command On BMC cat /sys/class/net/eth0/address |
| 21 | Run Keyword If '${MAC_ADDRESS}' != '${bmc_mac_addr}' |
| 22 | ... Set MAC Address |
| 23 | |
| 24 | *** Keywords *** |
| 25 | |
| 26 | Set MAC Address |
| 27 | [Documentation] Update eth0 with input MAC address. |
| 28 | |
| 29 | Write fw_setenv ethaddr ${MAC_ADDRESS} |
| 30 | Run Key U OBMC Boot Test \ OBMC Reboot (off) |
| 31 | ${bmc_mac_addr}= Execute Command On BMC cat /sys/class/net/eth0/address |
| 32 | Should Be Equal ${bmc_mac_addr} ${MAC_ADDRESS} |