Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 3 | Documentation eSEL's Test cases. |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 4 | |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 5 | Resource ../lib/ipmi_client.robot |
| 6 | Resource ../lib/openbmc_ffdc.robot |
| 7 | Variables ../data/variables.py |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 8 | |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 9 | Suite Setup Open Connection And Log In |
| 10 | Suite Teardown Close All Connections |
| 11 | Test Teardown FFDC On Test Case Fail |
| 12 | |
| 13 | Force 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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 27 | |
| 28 | *** Test Cases *** |
| 29 | |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 30 | Verify 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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 51 | Test Wrong Reservation_ID |
George Keishing | cac24c7 | 2016-09-23 04:44:19 -0500 | [diff] [blame] | 52 | [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 Mills | 56b3289 | 2016-11-14 13:56:17 -0600 | [diff] [blame] | 57 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 58 | ${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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 61 | Run IPMI command 0x0a 0x42 |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 62 | ${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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 63 | Should Contain ${output} Reservation cancelled |
| 64 | |
| 65 | Test Correct Reservation_ID |
George Keishing | cac24c7 | 2016-09-23 04:44:19 -0500 | [diff] [blame] | 66 | [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 Mills | 56b3289 | 2016-11-14 13:56:17 -0600 | [diff] [blame] | 71 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 72 | Run IPMI command 0x0a 0x42 |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 73 | ${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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 77 | Should Be Empty ${output} |
| 78 | |
| 79 | Clear Test File |
| 80 | [Documentation] Clear /tmp/esel |
Sridevi Ramesh | 83f5c59 | 2017-01-20 04:35:13 -0600 | [diff] [blame] | 81 | [Tags] Clear_Test_File |
Gunnar Mills | 56b3289 | 2016-11-14 13:56:17 -0600 | [diff] [blame] | 82 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 83 | Execute Command rm /tmp/esel |
| 84 | Execute Command sync |
| 85 | |
| 86 | *** Keywords *** |
| 87 | |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 88 | Restart 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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 96 | Run IPMI Command Returned |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 97 | [Arguments] ${args} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 98 | ${output_1}= Execute Command /tmp/ipmitool -I dbus raw ${args} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 99 | [Return] ${output_1} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 100 | |
| 101 | Check IPMI Oempartialadd Reject |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 102 | [Arguments] ${args} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 103 | ${stdout} ${stderr} ${output_2}= Execute Command /tmp/ipmitool -I dbus raw ${args} return_stdout=True return_stderr= True return_rc=True |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 104 | [Return] ${stderr} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 105 | |
| 106 | Check IPMI Oempartialadd Accept |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 107 | [Arguments] ${args} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 108 | ${stdout} ${stderr} ${output_3}= Execute Command /tmp/ipmitool -I dbus raw ${args} return_stdout=True return_stderr= True return_rc=True |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 109 | Should Be Equal ${output_3} ${0} msg=${stderr} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 110 | [Return] ${stderr} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 111 | |