blob: 16d284aab0ba773f2a4504ed5d6158c45cb2ce02 [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
2
3Documentation This suite is for testing esel's mechanism of checking Reservation_ID.
4
George Keishingd55a4be2016-08-26 03:28:17 -05005Resource ../lib/ipmi_client.robot
6Resource ../lib/openbmc_ffdc.robot
Chris Austenb29d2e82016-06-07 12:25:35 -05007
8Suite Setup Open Connection And Log In
9Suite Teardown Close All Connections
Gunnar Millseac1af22016-11-14 15:30:09 -060010Test Teardown FFDC On Test Case Fail
Chris Austenb29d2e82016-06-07 12:25:35 -050011
12*** Test Cases ***
13
14Test Wrong Reservation_ID
George Keishingcac24c72016-09-23 04:44:19 -050015 [Documentation] This testcase is to test BMC can handle multi-requestor's
16 ... oem partial add command with incorrect reservation id.
17 ... It simulates sending partial add command with fake content
18 ... and wrong Reservation ID. This command will be rejected.
19 [Tags] Test_Wrong_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -060020
Gunnar Mills1cd544d2016-12-06 11:19:22 -060021 ${rev_id_1}= Run IPMI Command Returned 0x0a 0x42
22 ${rev_id_ls}= Get Substring ${rev_id_1} 1 3
23 ${rev_id_ms}= Get Substring ${rev_id_1} -2
Chris Austenb29d2e82016-06-07 12:25:35 -050024 Run IPMI command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -060025 ${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 -050026 Should Contain ${output} Reservation cancelled
27
28Test Correct Reservation_ID
George Keishingcac24c72016-09-23 04:44:19 -050029 [Documentation] This testcase is to test BMC can handle multi-requestor's
30 ... oem partial add command with correct reservation id. It
31 ... simulates sending partial add command with fake content
32 ... and correct Reservation ID. This command will be accepted.
33 [Tags] Test_Correct_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -060034
Chris Austenb29d2e82016-06-07 12:25:35 -050035 Run IPMI command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -060036 ${rev_id_2}= Run IPMI Command Returned 0x0a 0x42
37 ${rev_id_ls}= Get Substring ${rev_id_2} 1 3
38 ${rev_id_ms}= Get Substring ${rev_id_2} -2
39 ${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 -050040 Should Be Empty ${output}
41
42Clear Test File
43 [Documentation] Clear /tmp/esel
Gunnar Mills56b32892016-11-14 13:56:17 -060044
Chris Austenb29d2e82016-06-07 12:25:35 -050045 Execute Command rm /tmp/esel
46 Execute Command sync
47
48*** Keywords ***
49
50Run IPMI Command Returned
Gunnar Mills38032802016-12-12 13:43:40 -060051 [Arguments] ${args}
Gunnar Mills1cd544d2016-12-06 11:19:22 -060052 ${output_1}= Execute Command /tmp/ipmitool -I dbus raw ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -050053 [return] ${output_1}
54
55Check IPMI Oempartialadd Reject
Gunnar Mills38032802016-12-12 13:43:40 -060056 [Arguments] ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -050057 ${stdout} ${stderr} ${output_2}= Execute Command /tmp/ipmitool -I dbus raw ${args} return_stdout=True return_stderr= True return_rc=True
58 [return] ${stderr}
59
60Check IPMI Oempartialadd Accept
Gunnar Mills38032802016-12-12 13:43:40 -060061 [Arguments] ${args}
Gunnar Mills1cd544d2016-12-06 11:19:22 -060062 ${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 -050063 Should Be Equal ${output_3} ${0} msg=${stderr}
64 [return] ${stderr}
65