Prashanth Katti | 884ee06 | 2017-03-16 05:05:03 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This program performs Factory data reset. |
| 3 | |
| 4 | Resource ../lib/ipmi_client.robot |
| 5 | Resource ../lib/utils.robot |
| 6 | Resource ../lib/connection_client.robot |
| 7 | Resource ../lib/oem/ibm/serial_console_client.robot |
| 8 | Library OperatingSystem |
| 9 | |
| 10 | Suite Setup Validate Setup |
| 11 | Suite Teardown Close All Connections |
| 12 | |
Sweta Potthuri | 5db43e4 | 2017-06-15 05:36:44 -0500 | [diff] [blame^] | 13 | Force Tags Factory_Reset |
| 14 | |
Prashanth Katti | 884ee06 | 2017-03-16 05:05:03 -0500 | [diff] [blame] | 15 | *** Test Cases *** |
| 16 | |
| 17 | Verify Factory Reset |
| 18 | [Documentation] Factory reset the system and verify if BMC is online. |
| 19 | [Tags] Verify_Factory_Reset |
| 20 | |
| 21 | # Factory reset erases user config settings which incldes IP, netmask |
| 22 | # gateway and route. Before running this test we are checking all these |
| 23 | # settings and checking whether ping works with BMC host. |
| 24 | # If factory reset is successful, ping to BMC host should fail as |
| 25 | # IP address is erased and comes up with zero_conf. |
| 26 | |
| 27 | Erase All Settings |
| 28 | ${status}= Run Keyword And Return Status Ping Host ${OPENBMC_HOST} |
| 29 | Should Be Equal ${status} False msg=Factory reset failed. |
| 30 | |
| 31 | Revert to Initial Setup And Verify |
| 32 | [Documentation] Revert to old setup. |
| 33 | [Tags] Revert_to_Initial_Setup_And_Verify |
| 34 | |
| 35 | # This test case restores old settings Viz IP address, netmask, gateway |
| 36 | # and route. Restoring is done through serial port console. |
| 37 | # If reverting to initial setup is successful, ping to BMC |
| 38 | # host should pass. |
| 39 | |
| 40 | Configure Initial Settings |
| 41 | Ping Host ${OPENBMC_HOST} |
| 42 | |
| 43 | *** Keywords *** |
| 44 | |
| 45 | Validate Setup |
| 46 | [Documentation] Validate setup. |
| 47 | |
| 48 | Open Connection And Log In |
| 49 | |
| 50 | # Check whether gateway IP is reachable. |
| 51 | Ping Host ${GW_IP} |
| 52 | Should Not Be Empty ${NET_MASK} msg=Netmask not provided. |
| 53 | |
| 54 | # Check whether serial console IP is reachable and responding |
| 55 | # to telnet command. |
| 56 | Open Telnet Connection to BMC Serial Console |
| 57 | |
| 58 | Erase All Settings |
| 59 | [Documentation] Factory reset the system. |
| 60 | |
| 61 | Run Dbus IPMI Raw Command 0x32 0xBA 00 00 |
| 62 | Run Dbus IPMI Raw Command 0x32 0x66 |