George Keishing | 0fff68a | 2017-04-27 22:25:49 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Keywords for system related test. This is a subset of the |
| 3 | ... utils.robot. This resource file keywords is specifically |
| 4 | ... define for system test use cases. |
| 5 | |
George Keishing | 91c852f | 2017-05-03 02:48:21 -0500 | [diff] [blame] | 6 | Library ../lib/gen_robot_keyword.py |
| 7 | Resource ../extended/obmc_boot_test_resource.robot |
George Keishing | 0fff68a | 2017-04-27 22:25:49 -0500 | [diff] [blame] | 8 | Resource ../lib/utils.robot |
George Keishing | 91c852f | 2017-05-03 02:48:21 -0500 | [diff] [blame] | 9 | Resource ../lib/state_manager.robot |
George Keishing | 0fff68a | 2017-04-27 22:25:49 -0500 | [diff] [blame] | 10 | |
| 11 | *** Variables *** |
| 12 | |
| 13 | *** Keywords *** |
| 14 | |
| 15 | Execute Command On OS |
| 16 | [Documentation] Execute given command on OS and return output. |
| 17 | [Arguments] ${command} |
George Keishing | 91c852f | 2017-05-03 02:48:21 -0500 | [diff] [blame] | 18 | # Description of argument(s): |
| 19 | # command Shell command to be executed on OS. |
George Keishing | 0fff68a | 2017-04-27 22:25:49 -0500 | [diff] [blame] | 20 | ${stdout} ${stderr}= Execute Command ${command} return_stderr=True |
| 21 | Should Be Empty ${stderr} |
| 22 | [Return] ${stdout} |
| 23 | |
| 24 | |
| 25 | Login To OS |
| 26 | [Documentation] Login to OS Host. |
| 27 | [Arguments] ${os_host}=${OS_HOST} ${os_username}=${OS_USERNAME} |
| 28 | ... ${os_password}=${OS_PASSWORD} |
George Keishing | 91c852f | 2017-05-03 02:48:21 -0500 | [diff] [blame] | 29 | # Description of argument(s): |
| 30 | # os_host IP address of the OS Host. |
| 31 | # os_username OS Host Login user name. |
| 32 | # os_password OS Host Login passwrd. |
George Keishing | 0fff68a | 2017-04-27 22:25:49 -0500 | [diff] [blame] | 33 | |
George Keishing | 91c852f | 2017-05-03 02:48:21 -0500 | [diff] [blame] | 34 | Ping Host ${os_host} |
George Keishing | 0fff68a | 2017-04-27 22:25:49 -0500 | [diff] [blame] | 35 | Open Connection ${os_host} |
George Keishing | 91c852f | 2017-05-03 02:48:21 -0500 | [diff] [blame] | 36 | Login ${os_username} ${os_password} |
| 37 | |
| 38 | |
| 39 | HTX Tool Exist |
| 40 | [Documentation] Check whether HTX exerciser is installed on OS. |
| 41 | Login To OS |
| 42 | ${output}= Execute Command On OS which htxcmdline |
| 43 | Should Contain ${output} htxcmdline |
| 44 | ... msg=Please install HTX exerciser. |
| 45 | |
| 46 | |
| 47 | Boot To OS |
| 48 | [Documentation] Boot host OS. |
| 49 | Run Key OBMC Boot Test \ REST Power On |
| 50 | |
| 51 | |
| 52 | Power Off Host |
| 53 | [Documentation] Power off host. |
| 54 | Run Key OBMC Boot Test \ REST Power Off |
George Keishing | 0fff68a | 2017-04-27 22:25:49 -0500 | [diff] [blame] | 55 | |
George Keishing | 6fec3ab | 2017-05-05 10:45:08 -0500 | [diff] [blame] | 56 | |
| 57 | File Exist On OS |
| 58 | [Documentation] Check if the given file path exist on OS. |
| 59 | [Arguments] ${file_path} |
| 60 | # Description of argument(s): |
| 61 | # file_path Absolute file path. |
| 62 | |
| 63 | Login To OS |
| 64 | ${out}= Execute Command On OS ls ${file_path} |
| 65 | Log To Console \n File Exist: ${out} |
| 66 | |
George Keishing | 8740a0c | 2017-05-13 07:19:16 -0500 | [diff] [blame] | 67 | |
| 68 | Is HTX Running |
| 69 | [Documentation] Check if the HTX exerciser is currently running. |
| 70 | |
| 71 | ${status}= Execute Command On OS htxcmdline -status |
| 72 | Should Not Contain ${status} Daemon state is <IDLE> |