blob: 51c1f54a7959af6f00915bdae2184c9d017a31fc [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
Chris Austenb29d2e82016-06-07 12:25:35 -05008
George Keishing4d6c1da2016-07-15 05:51:22 -05009Suite Setup Open Connection And Log In
10Suite Teardown Close All Connections
Chris Austenb29d2e82016-06-07 12:25:35 -050011
12*** Variables ***
Chris Austenb29d2e82016-06-07 12:25:35 -050013
14*** Test Cases ***
15
16Set Onetime boot policy using REST
17 [Documentation] This testcase is to set onetime boot policy using REST
18 ... URI and then verify using REST API and ipmitool.\n
19
20 Set Boot Policy ONETIME
21
22 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
23 Should Be Equal ${boot} ONETIME
24 ${output} = Run IPMI Standard command chassis bootparam get 5
25 Should Contain ${output} Options apply to only next boot
26
27Set Permanent boot policy using REST
28 [Documentation] This testcase is to set permanent boot policy using REST
29 ... URI and then verify using REST API and ipmitool.\n
30
31 Set Boot Policy PERMANENT
32
33 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
34 Should Be Equal ${boot} PERMANENT
35 ${output} = Run IPMI Standard command chassis bootparam get 5
36 Should Contain ${output} Options apply to all future boots
37
38Set Onetime boot policy using IPMITOOL
39 [Documentation] This testcase is to set boot policy to onetime boot using ipmitool
40 ... and then verify using REST URI and ipmitool.\n
41
42 Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
43 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
44 Should Be Equal ${boot} ONETIME
45 ${output} = Run IPMI Standard command chassis bootparam get 5
46 Should Contain ${output} Options apply to only next boot
47
48Set Permanent boot policy using IPMITOOL
49 [Documentation] This testcase is to set boot policy to permanent using ipmitool
50 ... and then verify using REST URI and ipmitool.
51
52 Run IPMI command 0x0 0x8 0x05 0xC0 0x00 0x00 0x00 0x00
53 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
54 Should Be Equal ${boot} PERMANENT
55 ${output} = Run IPMI Standard command chassis bootparam get 5
56 Should Contain ${output} Options apply to all future boots
57
58Boot order with permanent boot policy
59 [Documentation] This testcase is to verify that boot order does not change
60 ... after first boot when boot policy set to permanent
causten147f5752016-08-11 16:24:45 -050061 [Tags] chassisboot
Chris Austenb29d2e82016-06-07 12:25:35 -050062
root442f0ef2016-08-04 20:23:05 +000063 Initiate Power Off
Chris Austenb29d2e82016-06-07 12:25:35 -050064
65 Set Boot Policy PERMANENT
66
67 Set Boot Device CDROM
68
root442f0ef2016-08-04 20:23:05 +000069 Initiate Power On
Chris Austenb29d2e82016-06-07 12:25:35 -050070
71 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
72 Should Be Equal ${boot} PERMANENT
73
74 ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags
75 Should Be Equal ${flag} CDROM
76
77Onetime boot order after warm reset
78 [Documentation] This testcase is to verify that boot policy and order does not change
79 ... after warm reset on a system with onetime boot policy.
80
causten147f5752016-08-11 16:24:45 -050081 [Tags] chassisboot
82
root442f0ef2016-08-04 20:23:05 +000083 Initiate Power On
Chris Austenb29d2e82016-06-07 12:25:35 -050084
85 Set Boot Policy ONETIME
86
87 Set Boot Device Network
88
89 Trigger Warm Reset
90
91 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
92 Should Be Equal ${boot} ONETIME
93
94 ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags
95 Should Be Equal ${flag} Network
96
97Permanent boot order after warm reset
98 [Documentation] This testcase is to verify that boot policy and order does not change
99 ... after warm reset on a system with permanent boot policy.
causten147f5752016-08-11 16:24:45 -0500100 [Tags] chassisboot
Chris Austenb29d2e82016-06-07 12:25:35 -0500101
root442f0ef2016-08-04 20:23:05 +0000102 Initiate Power On
Chris Austenb29d2e82016-06-07 12:25:35 -0500103
104 Set Boot Policy PERMANENT
105
106 Set Boot Device CDROM
107
108 Trigger Warm Reset
109
110 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
111 Should Be Equal ${boot} PERMANENT
112
113 ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags
114 Should Be Equal ${flag} CDROM
115
116Set boot policy to invalid value
117 [Documentation] This testcase is to verify that proper error message is prompted
118 ... when invalid value to provided to boot policy.
119
120 Set Boot Policy abc
121
122 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
123 Should Be Not Equal ${boot} abc
124
125*** Keywords ***
126
127Set Boot Policy
128 [Arguments] ${args}
129 ${bootpolicy} = Set Variable ${args}
130 ${valueDict} = create dictionary data=${bootpolicy}
131 Write Attribute /org/openbmc/settings/host0 boot_policy data=${valueDict}
132
133Set Boot Device
134 [Arguments] ${args}
135 ${bootDevice} = Set Variable ${args}
136 ${valueDict} = create dictionary data=${bootDevice}
137 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}