blob: b6528c7a0cd6eeb044338cb62949bf6cb478b9dd [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 ***
14${SYSTEM_SHUTDOWN_TIME} ${5}
15${WAIT_FOR_POWER_OPERATION} 30sec
16
17*** Test Cases ***
18
19Set Onetime boot policy using REST
20 [Documentation] This testcase is to set onetime boot policy using REST
21 ... URI and then verify using REST API and ipmitool.\n
22
23 Set Boot Policy ONETIME
24
25 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
26 Should Be Equal ${boot} ONETIME
27 ${output} = Run IPMI Standard command chassis bootparam get 5
28 Should Contain ${output} Options apply to only next boot
29
30Set Permanent boot policy using REST
31 [Documentation] This testcase is to set permanent boot policy using REST
32 ... URI and then verify using REST API and ipmitool.\n
33
34 Set Boot Policy PERMANENT
35
36 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
37 Should Be Equal ${boot} PERMANENT
38 ${output} = Run IPMI Standard command chassis bootparam get 5
39 Should Contain ${output} Options apply to all future boots
40
41Set Onetime boot policy using IPMITOOL
42 [Documentation] This testcase is to set boot policy to onetime boot using ipmitool
43 ... and then verify using REST URI and ipmitool.\n
44
45 Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
46 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
47 Should Be Equal ${boot} ONETIME
48 ${output} = Run IPMI Standard command chassis bootparam get 5
49 Should Contain ${output} Options apply to only next boot
50
51Set Permanent boot policy using IPMITOOL
52 [Documentation] This testcase is to set boot policy to permanent using ipmitool
53 ... and then verify using REST URI and ipmitool.
54
55 Run IPMI command 0x0 0x8 0x05 0xC0 0x00 0x00 0x00 0x00
56 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
57 Should Be Equal ${boot} PERMANENT
58 ${output} = Run IPMI Standard command chassis bootparam get 5
59 Should Contain ${output} Options apply to all future boots
60
61Boot order with permanent boot policy
62 [Documentation] This testcase is to verify that boot order does not change
63 ... after first boot when boot policy set to permanent
64
65 Power Off Host
66
67 Set Boot Policy PERMANENT
68
69 Set Boot Device CDROM
70
71 Power On Host
72
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
83 Power On Host
84
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.
100
101 Power On Host
102
103 Set Boot Policy PERMANENT
104
105 Set Boot Device CDROM
106
107 Trigger Warm Reset
108
109 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
110 Should Be Equal ${boot} PERMANENT
111
112 ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags
113 Should Be Equal ${flag} CDROM
114
115Set boot policy to invalid value
116 [Documentation] This testcase is to verify that proper error message is prompted
117 ... when invalid value to provided to boot policy.
118
119 Set Boot Policy abc
120
121 ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy
122 Should Be Not Equal ${boot} abc
123
124*** Keywords ***
125
126Set Boot Policy
127 [Arguments] ${args}
128 ${bootpolicy} = Set Variable ${args}
129 ${valueDict} = create dictionary data=${bootpolicy}
130 Write Attribute /org/openbmc/settings/host0 boot_policy data=${valueDict}
131
132Set Boot Device
133 [Arguments] ${args}
134 ${bootDevice} = Set Variable ${args}
135 ${valueDict} = create dictionary data=${bootDevice}
136 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}