| George Keishing | d54591a | 2018-07-10 13:05:14 -0500 | [diff] [blame] | 1 | *** Settings *** | 
 | 2 | Documentation   Factory reset BMC and set the network config back. | 
 | 3 |  | 
 | 4 | # robot -v OPENBMC_HOST:xx.xx.xx.233 -v SUBNET_MASK:22 -v BMC_GW:xx.xx.xx.1 | 
 | 5 | # -v OPENBMC_SERIAL_HOST:xx.xx.xx.152 -v OPENBMC_SERIAL_PORT:2002 | 
 | 6 | # -v OPENBMC_MODEL:witherspoon factory_reset.robot | 
 | 7 |  | 
| Steven Sombar | 217402f | 2019-02-19 13:16:25 -0600 | [diff] [blame] | 8 | Resource     ../lib/resource.robot | 
 | 9 | Resource     ../lib/serial_connection/serial_console_client.robot | 
 | 10 | Library      ../lib/bmc_ssh_utils.py | 
| George Keishing | d54591a | 2018-07-10 13:05:14 -0500 | [diff] [blame] | 11 |  | 
 | 12 | Test Setup   Test Setup Execution | 
 | 13 |  | 
 | 14 | *** Variables *** | 
 | 15 |  | 
 | 16 | ${CMD_STATIC_IPV4_PREFIX}    busctl call  xyz.openbmc_project.Network | 
 | 17 | ...  /xyz/openbmc_project/network/eth0 xyz.openbmc_project.Network.IP.Create IP | 
 | 18 | ...  ssys "xyz.openbmc_project.Network.IP.Protocol.IPv4" | 
 | 19 |  | 
 | 20 | ${CMD_STATIS_GW_PREFIX}      busctl set-property xyz.openbmc_project.Network | 
 | 21 | ...  /xyz/openbmc_project/network/config | 
 | 22 | ...  xyz.openbmc_project.Network.SystemConfiguration DefaultGateway s | 
 | 23 |  | 
 | 24 |  | 
 | 25 | *** Test Cases *** | 
 | 26 |  | 
 | 27 | Factory Reset BMC | 
 | 28 |     [Documentation]  Factory reset BMC and verify BMC comes back online. | 
| Sridevi Ramesh | b0208f2 | 2025-02-17 04:38:17 -0600 | [diff] [blame] | 29 |     [Tags]  Factory_Reset_BMC | 
| George Keishing | d54591a | 2018-07-10 13:05:14 -0500 | [diff] [blame] | 30 |  | 
 | 31 |     BMC Execute Command  /usr/bin/hostnamectl set-hostname ${OPENBMC_MODEL} | 
 | 32 |     BMC Execute Command  /sbin/fw_setenv rwreset true | 
 | 33 |     Execute Command On Serial Console  reboot -f | 
 | 34 |  | 
 | 35 |     Sleep  4min | 
 | 36 |  | 
 | 37 |     ${cmd_ip}=  Catenate  ${CMD_STATIC_IPV4_PREFIX} ${OPENBMC_HOST} | 
 | 38 |     ...  ${SUBNET_MASK} ${BMC_GW} | 
 | 39 |     Execute Command On Serial Console  ${cmd_ip} | 
 | 40 |  | 
 | 41 |     ${cmd_gw}=  Catenate  ${CMD_STATIS_GW_PREFIX}  ${BMC_GW} | 
 | 42 |     Execute Command On Serial Console  ${cmd_gw} | 
 | 43 |  | 
 | 44 |  | 
 | 45 | *** Keywords *** | 
 | 46 |  | 
 | 47 | Test Setup Execution | 
 | 48 |     [Documentation]  Check if parameters are provided. | 
| Sridevi Ramesh | b0208f2 | 2025-02-17 04:38:17 -0600 | [diff] [blame] | 49 |  | 
| George Keishing | d54591a | 2018-07-10 13:05:14 -0500 | [diff] [blame] | 50 |     Should Not Be Empty   ${OPENBMC_SERIAL_HOST} | 
 | 51 |     Should Not Be Empty   ${OPENBMC_SERIAL_PORT} | 
 | 52 |     Should Not Be Empty   ${OPENBMC_MODEL} | 
 | 53 |     Should Not Be Empty   ${SUBNET_MASK} | 
 | 54 |     Should Not Be Empty   ${BMC_GW} |