blob: a9262a3ec29c6103f92cbd950a990e83369acd33 [file] [log] [blame]
Rahul Maheshwari712baaf2019-07-29 23:52:36 -05001*** Settings ***
2
3Documentation Module to test IPMI SEL functionality.
4Resource ../lib/ipmi_client.robot
5Resource ../lib/openbmc_ffdc.robot
Tony Lee160aa872020-02-12 16:11:39 +08006Variables ../data/ipmi_raw_cmd_table.py
Rahul Maheshwari712baaf2019-07-29 23:52:36 -05007
8Test Teardown FFDC On Test Case Fail
9
Tony Lee21e5d902020-04-28 09:28:00 +080010*** Variables ***
11
12${sensor_number} 0x17
13
Tony Lee160aa872020-02-12 16:11:39 +080014
Rahul Maheshwari712baaf2019-07-29 23:52:36 -050015*** Test Cases ***
16
17Verify IPMI SEL Version
18 [Documentation] Verify IPMI SEL's version info.
19 [Tags] Verify_IPMI_SEL_Version
20 ${version_info}= Get IPMI SEL Setting Version
21 ${setting_status}= Fetch From Left ${version_info} (
22 ${setting_status}= Evaluate $setting_status.replace(' ','')
23
24 Should Be True ${setting_status} >= 1.5
25 Should Contain ${version_info} v2 compliant case_insensitive=True
26
27
28Verify Empty SEL
George Keishingd3498672022-04-08 09:00:42 -050029 [Documentation] Verify IPMI sel clear command clears the SEL entry.
Rahul Maheshwari712baaf2019-07-29 23:52:36 -050030 [Tags] Verify_Empty_SEL
George Keishingdc656672020-02-25 07:45:16 -060031
George Keishing3c230882022-04-29 03:20:24 -050032 # Generate an error log and verify there is one at least.
George Keishingd3498672022-04-08 09:00:42 -050033 Create Test PEL Log
34 ${resp}= Run IPMI Standard Command sel elist last 1
35 Log To Console ${resp}
36
37 Should Contain Any ${resp} system hardware failure Asserted
38 ... msg=Add SEL Entry failed.
39
40 # Send SEL clear command and verify if it really clears up the SEL entry.
Rahul Maheshwari712baaf2019-07-29 23:52:36 -050041 Run IPMI Standard Command sel clear
George Keishingdc656672020-02-25 07:45:16 -060042 Sleep 5s
Rahul Maheshwari712baaf2019-07-29 23:52:36 -050043
44 ${resp}= Run IPMI Standard Command sel list
45 Should Contain ${resp} SEL has no entries case_insensitive=True
46
Tony Lee160aa872020-02-12 16:11:39 +080047
48Verify Add SEL Entry
49 [Documentation] Verify add SEL entry.
50 [Tags] Verify_Add_SEL_Entry
51 [Teardown] Run Keywords FFDC On Test Case Fail AND Run IPMI Standard Command sel clear
52
53 Run IPMI Standard Command sel clear
54 Sleep 5s
55
George Keishingbd8d6ba2021-11-17 01:53:51 -060056 # The IPMI raw command to generate Temp sensor error is no longer working.
57 # Our aim is to check if the SEL command is listed in IPMI or not.
58 # Original keyword "Create SEL" for reference
59 Create Test PEL Log
60
Tony Lee160aa872020-02-12 16:11:39 +080061 # Get last SEL entry.
62 ${resp}= Run IPMI Standard Command sel elist last 1
George Keishingbd8d6ba2021-11-17 01:53:51 -060063 # output:
64 # 1 | 11/17/2021 | 07:49:20 | System Event #0x01 | Undetermined system hardware failure | Asserted
65 Run Keywords Should Contain ${resp} system hardware failure AND
66 ... Should Contain ${resp} Asserted msg=Add SEL Entry failed.
Tony Lee160aa872020-02-12 16:11:39 +080067
68
69Verify Reserve SEL
70 [Documentation] Verify reserve SEL.
71 [Tags] Verify_Reserve_SEL
72
73 ${resp}= Run IPMI Standard Command
74 ... raw ${IPMI_RAW_CMD['SEL_entry']['Reserve'][0]}
75 ${reserve_id}= Split String ${resp}
76
77 # Execute clear SEL raw command with Reservation ID.
78 # Command will not execute unless the correct Reservation ID value is provided.
79 Run IPMI Standard Command
80 ... raw 0x0a 0x47 0x${reserve_id[0]} 0x${reserve_id[1]} 0x43 0x4c 0x52 0xaa
81
82
83*** Keywords ***
84
85Create SEL
86 [Documentation] Create a SEL.
87
88 # Create a SEL.
89 # Example:
90 # a | 02/14/2020 | 01:16:58 | Temperature #0x17 | | Asserted
Tony Lee21e5d902020-04-28 09:28:00 +080091 Run IPMI Command
92 ... 0x0a 0x44 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x04 0x01 ${sensor_number} 0x00 0xa0 0x04 0x07