blob: 8e78b7af562f4ab839d0129c0881d9ad0048e529 [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
Sweta Potthurib2c50f12017-06-28 03:53:30 -05009Resource ../lib/boot_utils.robot
Steven Sombara3f04392018-10-01 15:38:21 -050010Resource ../lib/esel_utils.robot
Chris Austenb29d2e82016-06-07 12:25:35 -050011
Steven Sombarfac31e92017-12-15 09:40:34 -060012Suite Setup Suite Setup Execution
13Suite Teardown Suite Teardown Execution
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
23${LOGGING_SERVICE} xyz.openbmc_project.Logging.service
Chris Austenb29d2e82016-06-07 12:25:35 -050024
George Keishing616c2782017-02-23 13:04:04 -060025${ESEL_DATA} ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00
26
Chris Austenb29d2e82016-06-07 12:25:35 -050027*** Test Cases ***
28
George Keishing505d5b42017-02-21 11:01:54 -060029Verify eSEL Using REST
George Keishing616c2782017-02-23 13:04:04 -060030 [Documentation] Generate eSEL log and verify using REST.
George Keishing505d5b42017-02-21 11:01:54 -060031 [Tags] Verify_eSEL_Using_REST
32
George Keishing616c2782017-02-23 13:04:04 -060033 Create eSEL
George Keishing505d5b42017-02-21 11:01:54 -060034 # New eSEL log should exist
Sweta Potthuri85c36c12017-07-03 05:30:44 -050035 ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}/list
George Keishing505d5b42017-02-21 11:01:54 -060036 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
37
George Keishing616c2782017-02-23 13:04:04 -060038Verify eSEL Entries Using REST
39 [Documentation] Verify that eSEL entries have data.
George Keishing616c2782017-02-23 13:04:04 -060040 [Tags] Verify_eSEL_Entries_Using_REST
Sridevi Ramesh87be0642017-05-19 01:20:50 -050041
George Keishing616c2782017-02-23 13:04:04 -060042 Create eSEL
43 Verify eSEL Entries
44
George Keishing146da7e2018-04-20 10:35:55 -050045Verify eSEL Description And EntryID Using REST
46 [Documentation] Create eSEL log and verify "Description" and "EntryID"
47 ... are not empty via REST.
48 [Tags] Verify_eSEL_Description_And_EntryID_Using_REST
49
50 # {
51 # "AdditionalData": [
52 # "CALLOUT_INVENTORY_PATH=",
53 # "ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00",
54 # "_PID=1175"
55 # ],
56 # "Description": "An error was detected with the base platform,
57 # but was not able to be deciphered. Contact your next level of support.",
58 # "EventID": "FQPSPAA0011M",
59 # "Id": 1,
60 # "Message": "org.open_power.Host.Error.Event",
61 # "Resolved": 0,
62 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
63 # "Timestamp": 1524233022072,
64 # "associations": [
65 # [
66 # "callout",
67 # "fault",
68 # ""
69 # ]
70 # ]
71
72 Create eSEL
73
74 ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
75 ${desc}= Read Attribute ${elog_entry[0]} Description
76 Should Not Be Empty ${desc} msg=${desc} is not populated.
77
78 ${event_id}= Read Attribute ${elog_entry[0]} EventID
79 Should Not Be Equal ${event_id} ${None}
80 ... msg=${event_id} is populated default "None".
81
George Keishing616c2782017-02-23 13:04:04 -060082
83Verify Multiple eSEL Using REST
George Keishing3d14cfa2017-03-06 02:49:49 -060084 [Documentation] Generate multiple eSEL log and verify using REST.
George Keishing616c2782017-02-23 13:04:04 -060085 [Tags] Verify_Multiple_eSEL_Using_REST
Sridevi Ramesh87be0642017-05-19 01:20:50 -050086
George Keishing616c2782017-02-23 13:04:04 -060087 Create eSEL
88 Create eSEL
89 ${entries}= Count eSEL Entries
George Keishing9f398742017-11-23 02:42:33 -060090 # 1 eSEL creates 1 error log and 1 association.
91 Should Be Equal As Integers ${entries} ${4}
George Keishing616c2782017-02-23 13:04:04 -060092
George Keishing3d14cfa2017-03-06 02:49:49 -060093Check eSEL AdditionalData
94 [Documentation] Generate eSEL log and verify AdditionalData is
95 ... not empty.
George Keishing3d14cfa2017-03-06 02:49:49 -060096 [Tags] Check_eSEL_AdditionalData
Sridevi Ramesh87be0642017-05-19 01:20:50 -050097
George Keishing3d14cfa2017-03-06 02:49:49 -060098 Create eSEL
Sweta Potthuri85c36c12017-07-03 05:30:44 -050099 ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
100 ${resp}= OpenBMC Get Request ${elog_entry[0]}
George Keishing3d14cfa2017-03-06 02:49:49 -0600101 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
102 ${jsondata}= To JSON ${resp.content}
103 # "/xyz/openbmc_project/logging/entry/1": {
104 # "Timestamp": 1487743771812,
105 # "AdditionalData": [],
106 # "Message": "org.open_power.Error.Host.Event.Event",
107 # "Id": 1,
108 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Emergency"
109 # }
110 Should Not Be Empty ${jsondata["data"]["AdditionalData"]}
111
Chris Austenb29d2e82016-06-07 12:25:35 -0500112Test Wrong Reservation_ID
Steven Sombara3f04392018-10-01 15:38:21 -0500113 [Documentation] This testcase is to test BMC can handle multi-requestor's
114 ... oem partial add command with incorrect reservation id.
115 ... It simulates sending partial add command with fake content
116 ... and wrong Reservation ID. This command will be rejected.
George Keishingcac24c72016-09-23 04:44:19 -0500117 [Tags] Test_Wrong_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -0600118
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500119 ${rev_id_1}= Run Inband IPMI Raw Command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600120 ${rev_id_ls}= Get Substring ${rev_id_1} 1 3
121 ${rev_id_ms}= Get Substring ${rev_id_1} -2
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500122 Run Inband IPMI Raw Command 0x0a 0x42
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500123 ${output}= Check IPMI OEMpartialadd Reject
124 ... 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 -0500125 Should Contain ${output} Reservation cancelled
126
127Test Correct Reservation_ID
Steven Sombara3f04392018-10-01 15:38:21 -0500128 [Documentation] This testcase is to test BMC can handle multi-requestor's
129 ... oem partial add command with correct reservation id. It
130 ... simulates sending partial add command with fake content
131 ... and correct Reservation ID. This command will be accepted.
George Keishingcac24c72016-09-23 04:44:19 -0500132 [Tags] Test_Correct_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -0600133
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500134 Run Inband IPMI Raw Command 0x0a 0x42
135 ${rev_id_2}= Run Inband IPMI Raw Command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600136 ${rev_id_ls}= Get Substring ${rev_id_2} 1 3
137 ${rev_id_ms}= Get Substring ${rev_id_2} -2
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500138 ${output}= Check IPMI OEMpartialadd Accept
139 ... 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 -0500140 Should Be Empty ${output}
141
Steven Sombara3f04392018-10-01 15:38:21 -0500142
Chris Austenb29d2e82016-06-07 12:25:35 -0500143*** Keywords ***
144
George Keishing616c2782017-02-23 13:04:04 -0600145
Steven Sombarfac31e92017-12-15 09:40:34 -0600146Suite Teardown Execution
George Keishing616c2782017-02-23 13:04:04 -0600147 [Documentation] Cleanup test logs and connection.
George Keishing616c2782017-02-23 13:04:04 -0600148 Close All Connections
149
150
George Keishing505d5b42017-02-21 11:01:54 -0600151Restart Logging Service
152 [Documentation] Restart Logging to clear eSEL log.
153 ${MainPID} ${stderr}= Execute Command
154 ... systemctl restart ${LOGGING_SERVICE} return_stderr=True
155 Should Be Empty ${stderr}
156
157 Sleep 10s reason=Wait for service to restart properly.
158
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500159
Chris Austenb29d2e82016-06-07 12:25:35 -0500160Run IPMI Command Returned
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500161 [Documentation] Run the IPMI command and return the output.
Gunnar Mills38032802016-12-12 13:43:40 -0600162 [Arguments] ${args}
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500163 ${output_1}= Execute Command /tmp/ipmitool -I dbus raw ${args}
Gunnar Millsc9ea9362016-12-13 16:21:13 -0600164 [Return] ${output_1}
Chris Austenb29d2e82016-06-07 12:25:35 -0500165
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500166
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500167Check IPMI OEMpartialadd Reject
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500168 [Documentation] Check if IPMI rejects the OEM partial add command.
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500169 [Arguments] ${args}
170 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
171 ${stdout} ${stderr} ${output_2}= Execute Command ipmitool raw ${args}
172 ... return_stdout=True return_stderr=True return_rc=True
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500173 [Return] ${stderr}
Chris Austenb29d2e82016-06-07 12:25:35 -0500174
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500175
Steven Sombarfac31e92017-12-15 09:40:34 -0600176Suite Setup Execution
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500177 [Documentation] Validates input parameters & check if HOST OS is up.
178
179 Should Not Be Empty
180 ... ${OS_HOST} msg=You must provide DNS name/IP of the OS host.
181 Should Not Be Empty
182 ... ${OS_USERNAME} msg=You must provide OS host user name.
183 Should Not Be Empty
184 ... ${OS_PASSWORD} msg=You must provide OS host user password.
185
Sweta Potthurib2c50f12017-06-28 03:53:30 -0500186 # Boot to OS.
187 REST Power On
188
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500189 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
190 Open Connection And Log In
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500191
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500192
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500193Check IPMI OEMpartialadd Accept
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500194 [Documentation] Check if IPMI accepts the OEM partial add command.
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500195 [Arguments] ${args}
196 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
197 ${stdout} ${stderr} ${output_3}= Execute Command ipmitool raw ${args}
198 ... return_stdout=True return_stderr=True return_rc=True
199 Should Be Equal ${output_3} ${0} msg=${stderr}
Steven Sombara3f04392018-10-01 15:38:21 -0500200 [Return] ${stderr}