blob: bbe3f81b13d1e865a8433907d7e16349d85ea82c [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}
manashsarmaa053fb32020-06-08 08:43:32 -050022... -p ${OPENBMC_PASSWORD} -S Always -d ${EXECDIR}${/}logs${/}
George Keishing6a69d262019-04-03 03:45:27 -050023
24${command_power_control} ${DEFAULT_PYTHON} ${rsv_dir_path}${/}power_control/power_control.py
25... -r ${OPENBMC_HOST} -u ${OPENBMC_USERNAME}
manashsarmaa053fb32020-06-08 08:43:32 -050026... -p ${OPENBMC_PASSWORD} -S Always
George Keishing6a69d262019-04-03 03:45:27 -050027
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
manashsarmaa053fb32020-06-08 08:43:32 -050038 ${output}= Run DMTF Tool ${rsv_dir_path} ${command_account} check_error=1
George Keishing4d9b7e12019-03-26 02:03:47 -050039
40 ${output}= Shell Cmd cat ${EXECDIR}${/}logs${/}results.json
41 Log ${output}
42
manashsarmaa053fb32020-06-08 08:43:32 -050043 ${json}= OperatingSystem.Get File ${EXECDIR}${/}logs${/}results.json
44
45 ${object}= Evaluate json.loads('''${json}''') json
46
47 ${result_list}= Set Variable ${object["TestResults"]}
48
49 @{failed_tc_list}= Create List
50
51 FOR ${result} IN @{result_list}
52 ${rc}= evaluate 'ErrorMessages'=='${result}'
53 ${num}= Run Keyword If ${rc} == False Set Variable ${result_list["${result}"]["fail"]}
54 Run Keyword If ${num} != None and ${num} > 0 Append To List ${failed_tc_list} ${result}
55 END
56
57 Should Be Empty ${failed_tc_list} Failed test cases are ${failed_tc_list}
58
George Keishing6a69d262019-04-03 03:45:27 -050059
Peter D Phan1c5d3252021-12-30 12:53:49 -060060Test BMC Redfish Power Control Usecase
61 [Documentation] Power Control Usecase Test.
George Keishinge23afb52022-03-17 08:25:49 -050062 [Tags] Test_BMC_Redfish_Power_Control_Usecase
George Keishing6a69d262019-04-03 03:45:27 -050063
Peter D Phan1c5d3252021-12-30 12:53:49 -060064 DMTF Power
George Keishing6a69d262019-04-03 03:45:27 -050065
66
George Keishing4d9b7e12019-03-26 02:03:47 -050067*** Keywords ***
68
69Test Setup Execution
70 [Documentation] Do test case setup tasks.
71
George Keishing6a69d262019-04-03 03:45:27 -050072 Printn
George Keishing4d9b7e12019-03-26 02:03:47 -050073 Download DMTF Tool ${rsv_dir_path} ${rsv_github_url}
74
George Keishing6a69d262019-04-03 03:45:27 -050075
George Keishing4d9b7e12019-03-26 02:03:47 -050076Test Teardown Execution
77 [Documentation] Do the post-test teardown.
78
George Keishing6a69d262019-04-03 03:45:27 -050079 Printn
George Keishing4d9b7e12019-03-26 02:03:47 -050080 FFDC On Test Case Fail
George Keishing6a69d262019-04-03 03:45:27 -050081
82
Peter D Phan1c5d3252021-12-30 12:53:49 -060083DMTF Power
George Keishing6a69d262019-04-03 03:45:27 -050084 [Documentation] Power the BMC machine on via DMTF tools.
85
Peter D Phan1c5d3252021-12-30 12:53:49 -060086 Print Timen Doing "DMTF Power".
George Keishing6a69d262019-04-03 03:45:27 -050087
Peter D Phan1c5d3252021-12-30 12:53:49 -060088 Run DMTF Tool ${rsv_dir_path} ${command_power_control}