blob: 621179d4d7ea794c2b7c54f5dbb9eabd90b61fb6 [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
61
62 Power Off Host
63
64 Set Boot Policy PERMANENT
65
66 Set Boot Device CDROM
67
68 Power On Host
69
70 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
71 Should Be Equal ${boot} PERMANENT
72
73 ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags
74 Should Be Equal ${flag} CDROM
75
76Onetime boot order after warm reset
77 [Documentation] This testcase is to verify that boot policy and order does not change
78 ... after warm reset on a system with onetime boot policy.
79
80 Power On Host
81
82 Set Boot Policy ONETIME
83
84 Set Boot Device Network
85
86 Trigger Warm Reset
87
88 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
89 Should Be Equal ${boot} ONETIME
90
91 ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags
92 Should Be Equal ${flag} Network
93
94Permanent boot order after warm reset
95 [Documentation] This testcase is to verify that boot policy and order does not change
96 ... after warm reset on a system with permanent boot policy.
97
98 Power On Host
99
100 Set Boot Policy PERMANENT
101
102 Set Boot Device CDROM
103
104 Trigger Warm Reset
105
106 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
107 Should Be Equal ${boot} PERMANENT
108
109 ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags
110 Should Be Equal ${flag} CDROM
111
112Set boot policy to invalid value
113 [Documentation] This testcase is to verify that proper error message is prompted
114 ... when invalid value to provided to boot policy.
115
116 Set Boot Policy abc
117
118 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
119 Should Be Not Equal ${boot} abc
120
121*** Keywords ***
122
123Set Boot Policy
124 [Arguments] ${args}
125 ${bootpolicy} = Set Variable ${args}
126 ${valueDict} = create dictionary data=${bootpolicy}
127 Write Attribute /org/openbmc/settings/host0 boot_policy data=${valueDict}
128
129Set Boot Device
130 [Arguments] ${args}
131 ${bootDevice} = Set Variable ${args}
132 ${valueDict} = create dictionary data=${bootDevice}
133 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}