blob: ec54604f6c069a9c5de8a5a557e22c60903eee70 [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
Sridevi Ramesh87be0642017-05-19 01:20:50 -050015Test Setup Delete Error logs
George Keishing505d5b42017-02-21 11:01:54 -060016
17Force Tags eSEL_Logging
18
19*** Variables ***
20
21${RESERVE_ID} raw 0x0a 0x42
22${RAW_PREFIX} raw 0x32 0xf0 0x
23
24${RAW_SUFFIX} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00
25... 0xdf 0x00 0x00 0x00 0x00 0x20 0x00 0x04 0x12 0x35 0x6f 0xaa 0x00 0x00
26
27${RAW_SEL_COMMIT} raw 0x0a 0x44 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x20
28... 0x00 0x04 0x12 0x35 0x6f 0x02 0x00 0x01
29
30${LOGGING_SERVICE} xyz.openbmc_project.Logging.service
Chris Austenb29d2e82016-06-07 12:25:35 -050031
George Keishing616c2782017-02-23 13:04:04 -060032${ESEL_DATA} ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00
33
Chris Austenb29d2e82016-06-07 12:25:35 -050034*** Test Cases ***
35
George Keishing505d5b42017-02-21 11:01:54 -060036Verify eSEL Using REST
George Keishing616c2782017-02-23 13:04:04 -060037 [Documentation] Generate eSEL log and verify using REST.
George Keishing505d5b42017-02-21 11:01:54 -060038 [Tags] Verify_eSEL_Using_REST
39
George Keishing616c2782017-02-23 13:04:04 -060040 # Prior eSEL log shouldn't exist.
George Keishing505d5b42017-02-21 11:01:54 -060041 ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1}
42 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
George Keishing616c2782017-02-23 13:04:04 -060043 Create eSEL
George Keishing505d5b42017-02-21 11:01:54 -060044 # New eSEL log should exist
45 ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1}
46 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
47
48
George Keishing616c2782017-02-23 13:04:04 -060049Verify eSEL Entries Using REST
50 [Documentation] Verify that eSEL entries have data.
George Keishing616c2782017-02-23 13:04:04 -060051 [Tags] Verify_eSEL_Entries_Using_REST
Sridevi Ramesh87be0642017-05-19 01:20:50 -050052
George Keishing616c2782017-02-23 13:04:04 -060053 Create eSEL
54 Verify eSEL Entries
55
56
57Verify Multiple eSEL Using REST
George Keishing3d14cfa2017-03-06 02:49:49 -060058 [Documentation] Generate multiple eSEL log and verify using REST.
George Keishing616c2782017-02-23 13:04:04 -060059 [Tags] Verify_Multiple_eSEL_Using_REST
Sridevi Ramesh87be0642017-05-19 01:20:50 -050060
George Keishing616c2782017-02-23 13:04:04 -060061 Create eSEL
62 Create eSEL
63 ${entries}= Count eSEL Entries
64 Should Be Equal As Integers ${entries} ${2}
65
66
George Keishing3d14cfa2017-03-06 02:49:49 -060067Check eSEL AdditionalData
68 [Documentation] Generate eSEL log and verify AdditionalData is
69 ... not empty.
George Keishing3d14cfa2017-03-06 02:49:49 -060070 [Tags] Check_eSEL_AdditionalData
Sridevi Ramesh87be0642017-05-19 01:20:50 -050071
George Keishing3d14cfa2017-03-06 02:49:49 -060072 Create eSEL
73 ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1}
74 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
75 ${jsondata}= To JSON ${resp.content}
76 # "/xyz/openbmc_project/logging/entry/1": {
77 # "Timestamp": 1487743771812,
78 # "AdditionalData": [],
79 # "Message": "org.open_power.Error.Host.Event.Event",
80 # "Id": 1,
81 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Emergency"
82 # }
83 Should Not Be Empty ${jsondata["data"]["AdditionalData"]}
84
Chris Austenb29d2e82016-06-07 12:25:35 -050085Test Wrong Reservation_ID
George Keishingcac24c72016-09-23 04:44:19 -050086 [Documentation] This testcase is to test BMC can handle multi-requestor's
87 ... oem partial add command with incorrect reservation id.
88 ... It simulates sending partial add command with fake content
89 ... and wrong Reservation ID. This command will be rejected.
90 [Tags] Test_Wrong_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -060091
Sweta Potthurifc9cfd72017-05-10 11:58:13 -050092 ${rev_id_1}= Run Inband IPMI Raw Command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -060093 ${rev_id_ls}= Get Substring ${rev_id_1} 1 3
94 ${rev_id_ms}= Get Substring ${rev_id_1} -2
Sweta Potthurifc9cfd72017-05-10 11:58:13 -050095 Run Inband IPMI Raw Command 0x0a 0x42
96 ${output}= Check IPMI OEMpartialadd Reject 0x32 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 -050097 Should Contain ${output} Reservation cancelled
98
99Test Correct Reservation_ID
George Keishingcac24c72016-09-23 04:44:19 -0500100 [Documentation] This testcase is to test BMC can handle multi-requestor's
101 ... oem partial add command with correct reservation id. It
102 ... simulates sending partial add command with fake content
103 ... and correct Reservation ID. This command will be accepted.
104 [Tags] Test_Correct_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -0600105
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500106 Run Inband IPMI Raw Command 0x0a 0x42
107 ${rev_id_2}= Run Inband IPMI Raw Command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600108 ${rev_id_ls}= Get Substring ${rev_id_2} 1 3
109 ${rev_id_ms}= Get Substring ${rev_id_2} -2
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500110 ${output}= Check IPMI OEMpartialadd Accept 0x32 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 -0500111 Should Be Empty ${output}
112
113Clear Test File
114 [Documentation] Clear /tmp/esel
Sridevi Ramesh83f5c592017-01-20 04:35:13 -0600115 [Tags] Clear_Test_File
Gunnar Mills56b32892016-11-14 13:56:17 -0600116
Chris Austenb29d2e82016-06-07 12:25:35 -0500117 Execute Command rm /tmp/esel
118 Execute Command sync
119
120*** Keywords ***
121
George Keishing616c2782017-02-23 13:04:04 -0600122Create eSEL
123 [Documentation] Create an eSEL.
124 Open Connection And Log In
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500125 ${Resv_id}= Run Inband IPMI Standard Command ${RESERVE_ID}
George Keishing616c2782017-02-23 13:04:04 -0600126 ${cmd}= Catenate
127 ... ${RAW_PREFIX}${Resv_id.strip().rsplit(' ', 1)[0]} ${RAW_SUFFIX}
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500128 Run Inband IPMI Standard Command ${cmd}
129 Run Inband IPMI Standard Command ${RAW_SEL_COMMIT}
George Keishing616c2782017-02-23 13:04:04 -0600130
131
132Count eSEL Entries
133 [Documentation] Count eSEL entries logged.
134 ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}
135 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
136 ${jsondata}= To JSON ${resp.content}
137 ${count}= Get Length ${jsondata["data"]}
138 [Return] ${count}
139
140
141Verify eSEL Entries
142 [Documentation] Verify eSEL entries logged.
143 ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1}
144 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
145 ${jsondata}= To JSON ${resp.content}
146 # "data": {
147 # "AdditionalData": [
148 # "ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00 "
149 # ],
150 # "Id": 1,
151 # "Message": "org.open_power.Error.Host.Event.Event",
152 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Emergency",
153 # "Timestamp": 1485904869061
154 # }
155
156 Should Be Equal As Integers ${jsondata["data"]["Id"]} ${1}
157 Should Be Equal As Strings
158 ... ${jsondata["data"]["AdditionalData"][0].rstrip()} ${ESEL_DATA}
159
160
161Test Cleanup On Exit
162 [Documentation] Cleanup test logs and connection.
George Keishing616c2782017-02-23 13:04:04 -0600163 Close All Connections
164
165
George Keishing505d5b42017-02-21 11:01:54 -0600166Restart Logging Service
167 [Documentation] Restart Logging to clear eSEL log.
168 ${MainPID} ${stderr}= Execute Command
169 ... systemctl restart ${LOGGING_SERVICE} return_stderr=True
170 Should Be Empty ${stderr}
171
172 Sleep 10s reason=Wait for service to restart properly.
173
Chris Austenb29d2e82016-06-07 12:25:35 -0500174Run IPMI Command Returned
Gunnar Mills38032802016-12-12 13:43:40 -0600175 [Arguments] ${args}
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500176 ${output_1}= Execute Command /tmp/ipmitool -I dbus raw ${args}
Gunnar Millsc9ea9362016-12-13 16:21:13 -0600177 [Return] ${output_1}
Chris Austenb29d2e82016-06-07 12:25:35 -0500178
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500179Check IPMI OEMpartialadd Reject
180 [Arguments] ${args}
181 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
182 ${stdout} ${stderr} ${output_2}= Execute Command ipmitool raw ${args}
183 ... return_stdout=True return_stderr=True return_rc=True
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500184 [Return] ${stderr}
Chris Austenb29d2e82016-06-07 12:25:35 -0500185
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500186eSEL Test SetUp
187 [Documentation] Validates input parameters & check if HOST OS is up.
188
189 Should Not Be Empty
190 ... ${OS_HOST} msg=You must provide DNS name/IP of the OS host.
191 Should Not Be Empty
192 ... ${OS_USERNAME} msg=You must provide OS host user name.
193 Should Not Be Empty
194 ... ${OS_PASSWORD} msg=You must provide OS host user password.
195
Sweta Potthurib2c50f12017-06-28 03:53:30 -0500196 # Boot to OS.
197 REST Power On
198
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500199 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
200 Open Connection And Log In
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500201
202Check IPMI OEMpartialadd Accept
203 [Arguments] ${args}
204 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
205 ${stdout} ${stderr} ${output_3}= Execute Command ipmitool raw ${args}
206 ... return_stdout=True return_stderr=True return_rc=True
207 Should Be Equal ${output_3} ${0} msg=${stderr}
208 [Return] ${stderr}
209