blob: ffccdee639db5317b00743a626ba2515ba6adeac [file] [log] [blame]
George Keishing0fff68a2017-04-27 22:25:49 -05001*** Settings ***
2Documentation 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 Keishing91c852f2017-05-03 02:48:21 -05006Library ../lib/gen_robot_keyword.py
7Resource ../extended/obmc_boot_test_resource.robot
George Keishing0fff68a2017-04-27 22:25:49 -05008Resource ../lib/utils.robot
George Keishing91c852f2017-05-03 02:48:21 -05009Resource ../lib/state_manager.robot
George Keishing0fff68a2017-04-27 22:25:49 -050010
11*** Variables ***
12
13*** Keywords ***
14
15Execute Command On OS
16 [Documentation] Execute given command on OS and return output.
17 [Arguments] ${command}
George Keishing91c852f2017-05-03 02:48:21 -050018 # Description of argument(s):
19 # command Shell command to be executed on OS.
George Keishing0fff68a2017-04-27 22:25:49 -050020 ${stdout} ${stderr}= Execute Command ${command} return_stderr=True
21 Should Be Empty ${stderr}
22 [Return] ${stdout}
23
24
25Login To OS
26 [Documentation] Login to OS Host.
27 [Arguments] ${os_host}=${OS_HOST} ${os_username}=${OS_USERNAME}
28 ... ${os_password}=${OS_PASSWORD}
George Keishing91c852f2017-05-03 02:48:21 -050029 # 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 Keishing0fff68a2017-04-27 22:25:49 -050033
George Keishing91c852f2017-05-03 02:48:21 -050034 Ping Host ${os_host}
George Keishing0fff68a2017-04-27 22:25:49 -050035 Open Connection ${os_host}
George Keishing91c852f2017-05-03 02:48:21 -050036 Login ${os_username} ${os_password}
37
38
George Keishing88366b32017-05-12 13:50:48 -050039Tool 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 Keishing91c852f2017-05-03 02:48:21 -050044 Login To OS
George Keishing88366b32017-05-12 13:50:48 -050045 ${output}= Execute Command On OS which ${tool_name}
46 Should Contain ${output} ${tool_name}
47 ... msg=Please install ${tool_name} tool.
George Keishing91c852f2017-05-03 02:48:21 -050048
49
50Boot To OS
51 [Documentation] Boot host OS.
52 Run Key OBMC Boot Test \ REST Power On
53
54
55Power Off Host
56 [Documentation] Power off host.
57 Run Key OBMC Boot Test \ REST Power Off
George Keishing0fff68a2017-04-27 22:25:49 -050058
George Keishing6fec3ab2017-05-05 10:45:08 -050059
60File 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 Keishing8740a0c2017-05-13 07:19:16 -050070
71Is 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>