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 | |
George Keishing | 88366b3 | 2017-05-12 13:50:48 -0500 | [diff] [blame^] | 39 | Tool Exist |
| 40 | [Documentation] Check whether given tool is installed on OS. |
| 41 | [Arguments] ${tool_name} |
| 42 | # Description of argument(s): |
| 43 | # tool_name Tool name whose existence is to be checked. |
George Keishing | 91c852f | 2017-05-03 02:48:21 -0500 | [diff] [blame] | 44 | Login To OS |
George Keishing | 88366b3 | 2017-05-12 13:50:48 -0500 | [diff] [blame^] | 45 | ${output}= Execute Command On OS which ${tool_name} |
| 46 | Should Contain ${output} ${tool_name} |
| 47 | ... msg=Please install ${tool_name} tool. |
George Keishing | 91c852f | 2017-05-03 02:48:21 -0500 | [diff] [blame] | 48 | |
| 49 | |
| 50 | Boot To OS |
| 51 | [Documentation] Boot host OS. |
| 52 | Run Key OBMC Boot Test \ REST Power On |
| 53 | |
| 54 | |
| 55 | Power Off Host |
| 56 | [Documentation] Power off host. |
| 57 | Run Key OBMC Boot Test \ REST Power Off |
George Keishing | 0fff68a | 2017-04-27 22:25:49 -0500 | [diff] [blame] | 58 | |
George Keishing | 6fec3ab | 2017-05-05 10:45:08 -0500 | [diff] [blame] | 59 | |
| 60 | File Exist On OS |
| 61 | [Documentation] Check if the given file path exist on OS. |
| 62 | [Arguments] ${file_path} |
| 63 | # Description of argument(s): |
| 64 | # file_path Absolute file path. |
| 65 | |
| 66 | Login To OS |
| 67 | ${out}= Execute Command On OS ls ${file_path} |
| 68 | Log To Console \n File Exist: ${out} |
| 69 | |
George Keishing | 8740a0c | 2017-05-13 07:19:16 -0500 | [diff] [blame] | 70 | |
| 71 | Is HTX Running |
| 72 | [Documentation] Check if the HTX exerciser is currently running. |
| 73 | |
| 74 | ${status}= Execute Command On OS htxcmdline -status |
| 75 | Should Not Contain ${status} Daemon state is <IDLE> |