blob: 32e2477614e531909f64eea8d00c5c173dabfdfc [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
2
3Documentation This testsuite is for testing boot policy function.
4
George Keishing4d6c1da2016-07-15 05:51:22 -05005Resource ../lib/rest_client.robot
6Resource ../lib/ipmi_client.robot
7Resource ../lib/utils.robot
George Keishingd55a4be2016-08-26 03:28:17 -05008Resource ../lib/openbmc_ffdc.robot
Chris Austenb29d2e82016-06-07 12:25:35 -05009
George Keishing4d6c1da2016-07-15 05:51:22 -050010Suite Setup Open Connection And Log In
11Suite Teardown Close All Connections
George Keishingd55a4be2016-08-26 03:28:17 -050012Test Teardown Log FFDC
Chris Austenb29d2e82016-06-07 12:25:35 -050013
14*** Variables ***
Chris Austenb29d2e82016-06-07 12:25:35 -050015
16*** Test Cases ***
17
18Set Onetime boot policy using REST
19 [Documentation] This testcase is to set onetime boot policy using REST
20 ... URI and then verify using REST API and ipmitool.\n
George Keishing314cf852016-08-26 09:02:16 -050021
Chris Austenb29d2e82016-06-07 12:25:35 -050022 Set Boot Policy ONETIME
23
24 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
25 Should Be Equal ${boot} ONETIME
26 ${output} = Run IPMI Standard command chassis bootparam get 5
27 Should Contain ${output} Options apply to only next boot
28
29Set Permanent boot policy using REST
30 [Documentation] This testcase is to set permanent boot policy using REST
31 ... URI and then verify using REST API and ipmitool.\n
32
33 Set Boot Policy PERMANENT
34
35 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
36 Should Be Equal ${boot} PERMANENT
37 ${output} = Run IPMI Standard command chassis bootparam get 5
38 Should Contain ${output} Options apply to all future boots
39
40Set Onetime boot policy using IPMITOOL
41 [Documentation] This testcase is to set boot policy to onetime boot using ipmitool
42 ... and then verify using REST URI and ipmitool.\n
43
44 Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
45 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
46 Should Be Equal ${boot} ONETIME
47 ${output} = Run IPMI Standard command chassis bootparam get 5
48 Should Contain ${output} Options apply to only next boot
George Keishing314cf852016-08-26 09:02:16 -050049
Chris Austenb29d2e82016-06-07 12:25:35 -050050Set Permanent boot policy using IPMITOOL
51 [Documentation] This testcase is to set boot policy to permanent using ipmitool
52 ... and then verify using REST URI and ipmitool.
53
54 Run IPMI command 0x0 0x8 0x05 0xC0 0x00 0x00 0x00 0x00
55 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
56 Should Be Equal ${boot} PERMANENT
57 ${output} = Run IPMI Standard command chassis bootparam get 5
58 Should Contain ${output} Options apply to all future boots
59
60Boot order with permanent boot policy
61 [Documentation] This testcase is to verify that boot order does not change
62 ... after first boot when boot policy set to permanent
causten147f5752016-08-11 16:24:45 -050063 [Tags] chassisboot
Chris Austenb29d2e82016-06-07 12:25:35 -050064
root442f0ef2016-08-04 20:23:05 +000065 Initiate Power Off
Chris Austenb29d2e82016-06-07 12:25:35 -050066
67 Set Boot Policy PERMANENT
68
69 Set Boot Device CDROM
70
root442f0ef2016-08-04 20:23:05 +000071 Initiate Power On
Chris Austenb29d2e82016-06-07 12:25:35 -050072
73 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
74 Should Be Equal ${boot} PERMANENT
75
76 ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags
77 Should Be Equal ${flag} CDROM
78
79Onetime boot order after warm reset
80 [Documentation] This testcase is to verify that boot policy and order does not change
81 ... after warm reset on a system with onetime boot policy.
82
causten147f5752016-08-11 16:24:45 -050083 [Tags] chassisboot
84
root442f0ef2016-08-04 20:23:05 +000085 Initiate Power On
Chris Austenb29d2e82016-06-07 12:25:35 -050086
87 Set Boot Policy ONETIME
88
89 Set Boot Device Network
90
91 Trigger Warm Reset
92
93 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
94 Should Be Equal ${boot} ONETIME
95
96 ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags
97 Should Be Equal ${flag} Network
98
99Permanent boot order after warm reset
George Keishing314cf852016-08-26 09:02:16 -0500100 [Documentation] This testcase is to verify that boot policy and order does not change
Chris Austenb29d2e82016-06-07 12:25:35 -0500101 ... after warm reset on a system with permanent boot policy.
causten147f5752016-08-11 16:24:45 -0500102 [Tags] chassisboot
Chris Austenb29d2e82016-06-07 12:25:35 -0500103
root442f0ef2016-08-04 20:23:05 +0000104 Initiate Power On
Chris Austenb29d2e82016-06-07 12:25:35 -0500105
106 Set Boot Policy PERMANENT
107
108 Set Boot Device CDROM
109
110 Trigger Warm Reset
111
112 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
113 Should Be Equal ${boot} PERMANENT
114
115 ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags
116 Should Be Equal ${flag} CDROM
George Keishing314cf852016-08-26 09:02:16 -0500117
Chris Austenb29d2e82016-06-07 12:25:35 -0500118Set boot policy to invalid value
George Keishing314cf852016-08-26 09:02:16 -0500119 [Documentation] This testcase is to verify that proper error message is prompted
Chris Austenb29d2e82016-06-07 12:25:35 -0500120 ... when invalid value to provided to boot policy.
George Keishing314cf852016-08-26 09:02:16 -0500121
Chris Austenb29d2e82016-06-07 12:25:35 -0500122 Set Boot Policy abc
123
124 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
George Keishing314cf852016-08-26 09:02:16 -0500125 Should Not Be Equal ${boot} abc
126
Chris Austenb29d2e82016-06-07 12:25:35 -0500127*** Keywords ***
128
129Set Boot Policy
130 [Arguments] ${args}
131 ${bootpolicy} = Set Variable ${args}
132 ${valueDict} = create dictionary data=${bootpolicy}
133 Write Attribute /org/openbmc/settings/host0 boot_policy data=${valueDict}
134
135Set Boot Device
136 [Arguments] ${args}
137 ${bootDevice} = Set Variable ${args}
138 ${valueDict} = create dictionary data=${bootDevice}
139 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}