blob: 19637eb6f25bf4c981cea256eab795b680251008 [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
2
3Documentation This testsuite is for testing boot policy function.
4
5Resource ../lib/rest_client.robot
6Resource ../lib/ipmi_client.robot
7Resource ../lib/utils.robot
8
9Suite Setup Open Connection And Log In
10Suite Teardown Close All Connections
11
12
13*** Variables ***
Chris Austenb29d2e82016-06-07 12:25:35 -050014
15*** Test Cases ***
16
17Set Onetime boot policy using REST
18 [Documentation] This testcase is to set onetime boot policy using REST
19 ... URI and then verify using REST API and ipmitool.\n
20
21 Set Boot Policy ONETIME
22
23 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
24 Should Be Equal ${boot} ONETIME
25 ${output} = Run IPMI Standard command chassis bootparam get 5
26 Should Contain ${output} Options apply to only next boot
27
28Set Permanent boot policy using REST
29 [Documentation] This testcase is to set permanent boot policy using REST
30 ... URI and then verify using REST API and ipmitool.\n
31
32 Set Boot Policy PERMANENT
33
34 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
35 Should Be Equal ${boot} PERMANENT
36 ${output} = Run IPMI Standard command chassis bootparam get 5
37 Should Contain ${output} Options apply to all future boots
38
39Set Onetime boot policy using IPMITOOL
40 [Documentation] This testcase is to set boot policy to onetime boot using ipmitool
41 ... and then verify using REST URI and ipmitool.\n
42
43 Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
44 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
45 Should Be Equal ${boot} ONETIME
46 ${output} = Run IPMI Standard command chassis bootparam get 5
47 Should Contain ${output} Options apply to only next boot
48
49Set Permanent boot policy using IPMITOOL
50 [Documentation] This testcase is to set boot policy to permanent using ipmitool
51 ... and then verify using REST URI and ipmitool.
52
53 Run IPMI command 0x0 0x8 0x05 0xC0 0x00 0x00 0x00 0x00
54 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
55 Should Be Equal ${boot} PERMANENT
56 ${output} = Run IPMI Standard command chassis bootparam get 5
57 Should Contain ${output} Options apply to all future boots
58
59Boot order with permanent boot policy
60 [Documentation] This testcase is to verify that boot order does not change
61 ... after first boot when boot policy set to permanent
62
63 Power Off Host
64
65 Set Boot Policy PERMANENT
66
67 Set Boot Device CDROM
68
69 Power On Host
70
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
81 Power On Host
82
83 Set Boot Policy ONETIME
84
85 Set Boot Device Network
86
87 Trigger Warm Reset
88
89 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
90 Should Be Equal ${boot} ONETIME
91
92 ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags
93 Should Be Equal ${flag} Network
94
95Permanent boot order after warm reset
96 [Documentation] This testcase is to verify that boot policy and order does not change
97 ... after warm reset on a system with permanent boot policy.
98
99 Power On Host
100
101 Set Boot Policy PERMANENT
102
103 Set Boot Device CDROM
104
105 Trigger Warm Reset
106
107 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
108 Should Be Equal ${boot} PERMANENT
109
110 ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags
111 Should Be Equal ${flag} CDROM
112
113Set boot policy to invalid value
114 [Documentation] This testcase is to verify that proper error message is prompted
115 ... when invalid value to provided to boot policy.
116
117 Set Boot Policy abc
118
119 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
120 Should Be Not Equal ${boot} abc
121
122*** Keywords ***
123
124Set Boot Policy
125 [Arguments] ${args}
126 ${bootpolicy} = Set Variable ${args}
127 ${valueDict} = create dictionary data=${bootpolicy}
128 Write Attribute /org/openbmc/settings/host0 boot_policy data=${valueDict}
129
130Set Boot Device
131 [Arguments] ${args}
132 ${bootDevice} = Set Variable ${args}
133 ${valueDict} = create dictionary data=${bootDevice}
134 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}