blob: 09620a64bc76223aa89a361ad07fe676eb3e6b09 [file] [log] [blame]
George Keishing4d9b7e12019-03-26 02:03:47 -05001*** Settings ***
George Keishing6a69d262019-04-03 03:45:27 -05002Documentation Test BMC using https://github.com/DMTF/Redfish-Usecase-Checkers
3... DMTF tool.
George Keishing4d9b7e12019-03-26 02:03:47 -05004
George Keishing6a69d262019-04-03 03:45:27 -05005Library OperatingSystem
6Library ../../lib/state.py
7Resource ../../lib/dmtf_tools_utils.robot
8Resource ../../lib/openbmc_ffdc.robot
George Keishing4d9b7e12019-03-26 02:03:47 -05009
George Keishing6a69d262019-04-03 03:45:27 -050010Test Setup Test Setup Execution
11Test Teardown Test Teardown Execution
George Keishing4d9b7e12019-03-26 02:03:47 -050012
13*** Variables ***
14
George Keishing6a69d262019-04-03 03:45:27 -050015${DEFAULT_PYTHON} python3
George Keishing4d9b7e12019-03-26 02:03:47 -050016
George Keishing6a69d262019-04-03 03:45:27 -050017${rsv_github_url} https://github.com/DMTF/Redfish-Usecase-Checkers.git
18${rsv_dir_path} Redfish-Usecase-Checkers
George Keishing4d9b7e12019-03-26 02:03:47 -050019
George Keishing6a69d262019-04-03 03:45:27 -050020${command_account} ${DEFAULT_PYTHON} ${rsv_dir_path}${/}account_management/account_management.py
21... -r ${OPENBMC_HOST} -u ${OPENBMC_USERNAME}
22... -p ${OPENBMC_PASSWORD} -S Always -d ${EXECDIR}${/}logs${/} -v
23
24${command_power_control} ${DEFAULT_PYTHON} ${rsv_dir_path}${/}power_control/power_control.py
25... -r ${OPENBMC_HOST} -u ${OPENBMC_USERNAME}
26... -p ${OPENBMC_PASSWORD} -S Always --F
27
28${power_on_timeout} 15 mins
29${power_off_timeout} 15 mins
30${state_change_timeout} 3 mins
George Keishing4d9b7e12019-03-26 02:03:47 -050031
32*** Test Case ***
33
34Test BMC Redfish Account Management
35 [Documentation] Check Account Management with a Redfish interface.
36 [Tags] Test_BMC_Redfish_Account_Management
37
38 ${output}= Run DMTF Tool ${rsv_dir_path} ${command_account}
39
40 ${output}= Shell Cmd cat ${EXECDIR}${/}logs${/}results.json
41 Log ${output}
42
George Keishing6a69d262019-04-03 03:45:27 -050043
44Test BMC Redfish Boot Host And ForceOff
45 [Documentation] Boot host and ForceOff.
46 [Tags] Test_BMC_Redfish_Boot_Host_And_ForceOff
47
48 DMTF Power On
49 DMTF Hard Power Off
50
51
52Test BMC Redfish Boot Host And GracefulShutdown
53 [Documentation] Boot host and issue GracefulShutdown.
54 [Tags] Test_BMC_Redfish_Boot_Host_And_GracefulShutdown
55
56 DMTF Power On
57 DMTF Power Off
58
59
George Keishing4d9b7e12019-03-26 02:03:47 -050060*** Keywords ***
61
62Test Setup Execution
63 [Documentation] Do test case setup tasks.
64
George Keishing6a69d262019-04-03 03:45:27 -050065 Printn
George Keishing4d9b7e12019-03-26 02:03:47 -050066 Download DMTF Tool ${rsv_dir_path} ${rsv_github_url}
67
George Keishing6a69d262019-04-03 03:45:27 -050068 ${status} ${state}= Run Keyword And Ignore Error
69 ... Check State standby_match_state
70 Return From Keyword If '${status}' == 'PASS'
71 DMTF Power Off
72
73
George Keishing4d9b7e12019-03-26 02:03:47 -050074Test Teardown Execution
75 [Documentation] Do the post-test teardown.
76
George Keishing6a69d262019-04-03 03:45:27 -050077 Printn
George Keishing4d9b7e12019-03-26 02:03:47 -050078 FFDC On Test Case Fail
George Keishing6a69d262019-04-03 03:45:27 -050079
80
81DMTF Power On
82 [Documentation] Power the BMC machine on via DMTF tools.
83
84 Print Timen Doing "DMTF Power On".
85
86 ${state}= Get State
87 ${match_state}= Anchor State ${state}
88 Run DMTF Tool ${rsv_dir_path} ${command_power_control} On
89 ${state}= Wait State ${match_state} wait_time=${state_change_timeout} interval=10 seconds invert=1
90 ${state}= Wait State os_running_match_state wait_time=${power_on_timeout} interval=10 seconds
91
92 [Return] ${state}
93
94
95DMTF Power Off
96 [Documentation] Power the BMC machine off via DMTF tools.
97
98 Print Timen Doing "DMTF Hard Power Off".
99
100 ${state}= Get State
101 ${match_state}= Anchor State ${state}
102 Run DMTF Tool ${rsv_dir_path} ${command_power_control} GracefulShutdown
103 ${state}= Wait State ${match_state} wait_time=${state_change_timeout} interval=10 seconds invert=1
104 ${state}= Wait State standby_match_state wait_time=${power_off_timeout} interval=10 seconds
105
106 [Return] ${state}
107
108
109DMTF Hard Power Off
110 [Documentation] Power the BMC machine off via DMTF tools.
111
112 Print Timen Doing "DMTF Hard Power Off".
113
114 ${state}= Get State
115 ${match_state}= Anchor State ${state}
116 Run DMTF Tool ${rsv_dir_path} ${command_power_control} ForceOff
117 ${state}= Wait State ${match_state} wait_time=${state_change_timeout} interval=10 seconds invert=1
118 ${state}= Wait State standby_match_state wait_time=${power_off_timeout} interval=10 seconds
119
120 [Return] ${state}