blob: ed0fdc408742ed7991102eb0d2fac305ecf8805a [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
7Variables ../data/variables.py
Chris Austenb29d2e82016-06-07 12:25:35 -05008
George Keishing505d5b42017-02-21 11:01:54 -06009Suite Setup Open Connection And Log In
10Suite Teardown Close All Connections
11Test Teardown FFDC On Test Case Fail
12
13Force Tags eSEL_Logging
14
15*** Variables ***
16
17${RESERVE_ID} raw 0x0a 0x42
18${RAW_PREFIX} raw 0x32 0xf0 0x
19
20${RAW_SUFFIX} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00
21... 0xdf 0x00 0x00 0x00 0x00 0x20 0x00 0x04 0x12 0x35 0x6f 0xaa 0x00 0x00
22
23${RAW_SEL_COMMIT} raw 0x0a 0x44 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x20
24... 0x00 0x04 0x12 0x35 0x6f 0x02 0x00 0x01
25
26${LOGGING_SERVICE} xyz.openbmc_project.Logging.service
Chris Austenb29d2e82016-06-07 12:25:35 -050027
28*** Test Cases ***
29
George Keishing505d5b42017-02-21 11:01:54 -060030Verify eSEL Using REST
31 [Documentation] Generate eSEL log and Verify using REST.
32 [setup] Restart Logging Service
33 [Tags] Verify_eSEL_Using_REST
34
35 # Prior eSEL log shouldn't exist
36 ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1}
37 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
38
39 Open Connection And Log In
40 ${Resv_id}= Run Dbus IPMI Standard Command ${RESERVE_ID}
41 ${cmd}= Catenate
42 ... ${RAW_PREFIX}${Resv_id.strip().rsplit(' ', 1)[0]} ${RAW_SUFFIX}
43 Run Dbus IPMI Standard Command ${cmd}
44 Run Dbus IPMI Standard Command ${RAW_SEL_COMMIT}
45
46 # New eSEL log should exist
47 ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1}
48 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
49
50
Chris Austenb29d2e82016-06-07 12:25:35 -050051Test Wrong Reservation_ID
George Keishingcac24c72016-09-23 04:44:19 -050052 [Documentation] This testcase is to test BMC can handle multi-requestor's
53 ... oem partial add command with incorrect reservation id.
54 ... It simulates sending partial add command with fake content
55 ... and wrong Reservation ID. This command will be rejected.
56 [Tags] Test_Wrong_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -060057
Gunnar Mills1cd544d2016-12-06 11:19:22 -060058 ${rev_id_1}= Run IPMI Command Returned 0x0a 0x42
59 ${rev_id_ls}= Get Substring ${rev_id_1} 1 3
60 ${rev_id_ms}= Get Substring ${rev_id_1} -2
Chris Austenb29d2e82016-06-07 12:25:35 -050061 Run IPMI command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -060062 ${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 -050063 Should Contain ${output} Reservation cancelled
64
65Test Correct Reservation_ID
George Keishingcac24c72016-09-23 04:44:19 -050066 [Documentation] This testcase is to test BMC can handle multi-requestor's
67 ... oem partial add command with correct reservation id. It
68 ... simulates sending partial add command with fake content
69 ... and correct Reservation ID. This command will be accepted.
70 [Tags] Test_Correct_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -060071
Chris Austenb29d2e82016-06-07 12:25:35 -050072 Run IPMI command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -060073 ${rev_id_2}= Run IPMI Command Returned 0x0a 0x42
74 ${rev_id_ls}= Get Substring ${rev_id_2} 1 3
75 ${rev_id_ms}= Get Substring ${rev_id_2} -2
76 ${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 -050077 Should Be Empty ${output}
78
79Clear Test File
80 [Documentation] Clear /tmp/esel
Sridevi Ramesh83f5c592017-01-20 04:35:13 -060081 [Tags] Clear_Test_File
Gunnar Mills56b32892016-11-14 13:56:17 -060082
Chris Austenb29d2e82016-06-07 12:25:35 -050083 Execute Command rm /tmp/esel
84 Execute Command sync
85
86*** Keywords ***
87
George Keishing505d5b42017-02-21 11:01:54 -060088Restart Logging Service
89 [Documentation] Restart Logging to clear eSEL log.
90 ${MainPID} ${stderr}= Execute Command
91 ... systemctl restart ${LOGGING_SERVICE} return_stderr=True
92 Should Be Empty ${stderr}
93
94 Sleep 10s reason=Wait for service to restart properly.
95
Chris Austenb29d2e82016-06-07 12:25:35 -050096Run IPMI Command Returned
Gunnar Mills38032802016-12-12 13:43:40 -060097 [Arguments] ${args}
Gunnar Mills1cd544d2016-12-06 11:19:22 -060098 ${output_1}= Execute Command /tmp/ipmitool -I dbus raw ${args}
Gunnar Millsc9ea9362016-12-13 16:21:13 -060099 [Return] ${output_1}
Chris Austenb29d2e82016-06-07 12:25:35 -0500100
101Check IPMI Oempartialadd Reject
Gunnar Mills38032802016-12-12 13:43:40 -0600102 [Arguments] ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500103 ${stdout} ${stderr} ${output_2}= Execute Command /tmp/ipmitool -I dbus raw ${args} return_stdout=True return_stderr= True return_rc=True
Gunnar Millsc9ea9362016-12-13 16:21:13 -0600104 [Return] ${stderr}
Chris Austenb29d2e82016-06-07 12:25:35 -0500105
106Check IPMI Oempartialadd Accept
Gunnar Mills38032802016-12-12 13:43:40 -0600107 [Arguments] ${args}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600108 ${stdout} ${stderr} ${output_3}= Execute Command /tmp/ipmitool -I dbus raw ${args} return_stdout=True return_stderr= True return_rc=True
Chris Austenb29d2e82016-06-07 12:25:35 -0500109 Should Be Equal ${output_3} ${0} msg=${stderr}
Gunnar Millsc9ea9362016-12-13 16:21:13 -0600110 [Return] ${stderr}
Chris Austenb29d2e82016-06-07 12:25:35 -0500111