blob: a640d93de4e1993ee1d238932da11b04bfc5398a [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
2
George Keishing505d5b42017-02-21 11:01:54 -06003Documentation eSEL's Test cases.
Chris Austenb29d2e82016-06-07 12:25:35 -05004
George Keishing505d5b42017-02-21 11:01:54 -06005Resource ../lib/ipmi_client.robot
6Resource ../lib/openbmc_ffdc.robot
Sweta Potthurifc9cfd72017-05-10 11:58:13 -05007Resource ../lib/utils.robot
George Keishing505d5b42017-02-21 11:01:54 -06008Variables ../data/variables.py
Sridevi Ramesh87be0642017-05-19 01:20:50 -05009Resource ../lib/utils.robot
Sweta Potthurib2c50f12017-06-28 03:53:30 -050010Resource ../lib/boot_utils.robot
Chris Austenb29d2e82016-06-07 12:25:35 -050011
Sridevi Ramesh87be0642017-05-19 01:20:50 -050012Suite Setup eSEL Test SetUp
George Keishing616c2782017-02-23 13:04:04 -060013Suite Teardown Test Cleanup On Exit
George Keishing505d5b42017-02-21 11:01:54 -060014Test Teardown FFDC On Test Case Fail
George Keishing9af2df02017-10-30 02:16:18 -050015Test Setup Delete All Error Logs
George Keishing505d5b42017-02-21 11:01:54 -060016
17Force Tags eSEL_Logging
18
19*** Variables ***
20
Sweta Potthuriaf741cb2017-07-04 09:41:17 -050021${stack_mode} skip
George Keishing505d5b42017-02-21 11:01:54 -060022${RESERVE_ID} raw 0x0a 0x42
George Keishing9af2df02017-10-30 02:16:18 -050023${RAW_PREFIX} raw 0x3a 0xf0 0x
George Keishing505d5b42017-02-21 11:01:54 -060024
25${RAW_SUFFIX} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00
George Keishing9af2df02017-10-30 02:16:18 -050026... 0xdf 0x00 0x00 0x00 0x00 0x20 0x00 0x04 0x12 0x35 0x6f 0xaa 0x00 0x00
George Keishing505d5b42017-02-21 11:01:54 -060027
28${RAW_SEL_COMMIT} raw 0x0a 0x44 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x20
George Keishingaf190192017-08-18 14:58:07 -050029... 0x00 0x04 0x12 0xA6 0x6f 0x02 0x00 0x01
George Keishing505d5b42017-02-21 11:01:54 -060030
31${LOGGING_SERVICE} xyz.openbmc_project.Logging.service
Chris Austenb29d2e82016-06-07 12:25:35 -050032
George Keishing616c2782017-02-23 13:04:04 -060033${ESEL_DATA} ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00
34
Chris Austenb29d2e82016-06-07 12:25:35 -050035*** Test Cases ***
36
George Keishing505d5b42017-02-21 11:01:54 -060037Verify eSEL Using REST
George Keishing616c2782017-02-23 13:04:04 -060038 [Documentation] Generate eSEL log and verify using REST.
George Keishing505d5b42017-02-21 11:01:54 -060039 [Tags] Verify_eSEL_Using_REST
40
George Keishing616c2782017-02-23 13:04:04 -060041 Create eSEL
George Keishing505d5b42017-02-21 11:01:54 -060042 # New eSEL log should exist
Sweta Potthuri85c36c12017-07-03 05:30:44 -050043 ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}/list
George Keishing505d5b42017-02-21 11:01:54 -060044 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
45
George Keishing616c2782017-02-23 13:04:04 -060046Verify eSEL Entries Using REST
47 [Documentation] Verify that eSEL entries have data.
George Keishing616c2782017-02-23 13:04:04 -060048 [Tags] Verify_eSEL_Entries_Using_REST
Sridevi Ramesh87be0642017-05-19 01:20:50 -050049
George Keishing616c2782017-02-23 13:04:04 -060050 Create eSEL
51 Verify eSEL Entries
52
53
54Verify Multiple eSEL Using REST
George Keishing3d14cfa2017-03-06 02:49:49 -060055 [Documentation] Generate multiple eSEL log and verify using REST.
George Keishing616c2782017-02-23 13:04:04 -060056 [Tags] Verify_Multiple_eSEL_Using_REST
Sridevi Ramesh87be0642017-05-19 01:20:50 -050057
George Keishing616c2782017-02-23 13:04:04 -060058 Create eSEL
59 Create eSEL
60 ${entries}= Count eSEL Entries
61 Should Be Equal As Integers ${entries} ${2}
62
George Keishing3d14cfa2017-03-06 02:49:49 -060063Check eSEL AdditionalData
64 [Documentation] Generate eSEL log and verify AdditionalData is
65 ... not empty.
George Keishing3d14cfa2017-03-06 02:49:49 -060066 [Tags] Check_eSEL_AdditionalData
Sridevi Ramesh87be0642017-05-19 01:20:50 -050067
George Keishing3d14cfa2017-03-06 02:49:49 -060068 Create eSEL
Sweta Potthuri85c36c12017-07-03 05:30:44 -050069 ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
70 ${resp}= OpenBMC Get Request ${elog_entry[0]}
George Keishing3d14cfa2017-03-06 02:49:49 -060071 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
72 ${jsondata}= To JSON ${resp.content}
73 # "/xyz/openbmc_project/logging/entry/1": {
74 # "Timestamp": 1487743771812,
75 # "AdditionalData": [],
76 # "Message": "org.open_power.Error.Host.Event.Event",
77 # "Id": 1,
78 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Emergency"
79 # }
80 Should Not Be Empty ${jsondata["data"]["AdditionalData"]}
81
Chris Austenb29d2e82016-06-07 12:25:35 -050082Test Wrong Reservation_ID
George Keishingcac24c72016-09-23 04:44:19 -050083 [Documentation] This testcase is to test BMC can handle multi-requestor's
84 ... oem partial add command with incorrect reservation id.
85 ... It simulates sending partial add command with fake content
86 ... and wrong Reservation ID. This command will be rejected.
87 [Tags] Test_Wrong_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -060088
Sweta Potthurifc9cfd72017-05-10 11:58:13 -050089 ${rev_id_1}= Run Inband IPMI Raw Command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -060090 ${rev_id_ls}= Get Substring ${rev_id_1} 1 3
91 ${rev_id_ms}= Get Substring ${rev_id_1} -2
Sweta Potthurifc9cfd72017-05-10 11:58:13 -050092 Run Inband IPMI Raw Command 0x0a 0x42
George Keishing7d2e5512017-11-06 02:10:04 -060093 ${output}= Check IPMI OEMpartialadd Reject 0x3a 0xf0 0x${rev_id_ls} 0x${rev_id_ms} 0 0 0 0 0 1 2 3 4 5 6 7 8 9 0xa 0xb 0xc 0xd 0xe 0xf
Chris Austenb29d2e82016-06-07 12:25:35 -050094 Should Contain ${output} Reservation cancelled
95
96Test Correct Reservation_ID
George Keishingcac24c72016-09-23 04:44:19 -050097 [Documentation] This testcase is to test BMC can handle multi-requestor's
98 ... oem partial add command with correct reservation id. It
99 ... simulates sending partial add command with fake content
100 ... and correct Reservation ID. This command will be accepted.
101 [Tags] Test_Correct_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -0600102
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500103 Run Inband IPMI Raw Command 0x0a 0x42
104 ${rev_id_2}= Run Inband IPMI Raw Command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600105 ${rev_id_ls}= Get Substring ${rev_id_2} 1 3
106 ${rev_id_ms}= Get Substring ${rev_id_2} -2
George Keishing7d2e5512017-11-06 02:10:04 -0600107 ${output}= Check IPMI OEMpartialadd Accept 0x3a 0xf0 0x${rev_id_ls} 0x${rev_id_ms} 0 0 0 0 0 1 2 3 4 5 6 7 8 9 0xa 0xb 0xc 0xd 0xe 0xf
Chris Austenb29d2e82016-06-07 12:25:35 -0500108 Should Be Empty ${output}
109
Chris Austenb29d2e82016-06-07 12:25:35 -0500110*** Keywords ***
111
George Keishing616c2782017-02-23 13:04:04 -0600112Create eSEL
113 [Documentation] Create an eSEL.
114 Open Connection And Log In
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500115 ${Resv_id}= Run Inband IPMI Standard Command ${RESERVE_ID}
George Keishing616c2782017-02-23 13:04:04 -0600116 ${cmd}= Catenate
117 ... ${RAW_PREFIX}${Resv_id.strip().rsplit(' ', 1)[0]} ${RAW_SUFFIX}
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500118 Run Inband IPMI Standard Command ${cmd}
119 Run Inband IPMI Standard Command ${RAW_SEL_COMMIT}
George Keishing616c2782017-02-23 13:04:04 -0600120
George Keishing616c2782017-02-23 13:04:04 -0600121Count eSEL Entries
122 [Documentation] Count eSEL entries logged.
123 ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}
124 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
125 ${jsondata}= To JSON ${resp.content}
126 ${count}= Get Length ${jsondata["data"]}
127 [Return] ${count}
128
George Keishing616c2782017-02-23 13:04:04 -0600129Verify eSEL Entries
130 [Documentation] Verify eSEL entries logged.
Sweta Potthuri85c36c12017-07-03 05:30:44 -0500131 ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
132 ${resp}= OpenBMC Get Request ${elog_entry[0]}
George Keishing616c2782017-02-23 13:04:04 -0600133 # "data": {
134 # "AdditionalData": [
135 # "ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00 "
136 # ],
137 # "Id": 1,
138 # "Message": "org.open_power.Error.Host.Event.Event",
139 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Emergency",
140 # "Timestamp": 1485904869061
141 # }
Sweta Potthuri85c36c12017-07-03 05:30:44 -0500142 ${entry_id}= Read Attribute ${elog_entry[0]} message
143 Should Be Equal ${entry_id}
Rahul Maheshwarib8cd1f92017-09-26 22:19:35 -0500144 ... org.open_power.Host.Event.Error.Event
Sweta Potthuri85c36c12017-07-03 05:30:44 -0500145 ${entry_id}= Read Attribute ${elog_entry[0]} Severity
146 Should Be Equal ${entry_id}
147 ... xyz.openbmc_project.Logging.Entry.Level.Error
George Keishing616c2782017-02-23 13:04:04 -0600148
149Test Cleanup On Exit
150 [Documentation] Cleanup test logs and connection.
George Keishing616c2782017-02-23 13:04:04 -0600151 Close All Connections
152
153
George Keishing505d5b42017-02-21 11:01:54 -0600154Restart Logging Service
155 [Documentation] Restart Logging to clear eSEL log.
156 ${MainPID} ${stderr}= Execute Command
157 ... systemctl restart ${LOGGING_SERVICE} return_stderr=True
158 Should Be Empty ${stderr}
159
160 Sleep 10s reason=Wait for service to restart properly.
161
Chris Austenb29d2e82016-06-07 12:25:35 -0500162Run IPMI Command Returned
Gunnar Mills38032802016-12-12 13:43:40 -0600163 [Arguments] ${args}
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500164 ${output_1}= Execute Command /tmp/ipmitool -I dbus raw ${args}
Gunnar Millsc9ea9362016-12-13 16:21:13 -0600165 [Return] ${output_1}
Chris Austenb29d2e82016-06-07 12:25:35 -0500166
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500167Check IPMI OEMpartialadd Reject
168 [Arguments] ${args}
169 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
170 ${stdout} ${stderr} ${output_2}= Execute Command ipmitool raw ${args}
171 ... return_stdout=True return_stderr=True return_rc=True
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500172 [Return] ${stderr}
Chris Austenb29d2e82016-06-07 12:25:35 -0500173
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500174eSEL Test SetUp
175 [Documentation] Validates input parameters & check if HOST OS is up.
176
177 Should Not Be Empty
178 ... ${OS_HOST} msg=You must provide DNS name/IP of the OS host.
179 Should Not Be Empty
180 ... ${OS_USERNAME} msg=You must provide OS host user name.
181 Should Not Be Empty
182 ... ${OS_PASSWORD} msg=You must provide OS host user password.
183
Sweta Potthurib2c50f12017-06-28 03:53:30 -0500184 # Boot to OS.
185 REST Power On
186
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500187 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
188 Open Connection And Log In
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500189
190Check IPMI OEMpartialadd Accept
191 [Arguments] ${args}
192 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
193 ${stdout} ${stderr} ${output_3}= Execute Command ipmitool raw ${args}
194 ... return_stdout=True return_stderr=True return_rc=True
195 Should Be Equal ${output_3} ${0} msg=${stderr}
196 [Return] ${stderr}
197