blob: 91a665de2223f63ff36f25a90131f40b26af4119 [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
Sivas SRRe1143ae2016-08-26 22:31:02 -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
Sivas SRRe1143ae2016-08-26 22:31:02 -050012Test Setup Initialize DBUS cmd "boot_policy"
Gunnar Millseac1af22016-11-14 15:30:09 -060013Test Teardown FFDC On Test Case Fail
Chris Austenb29d2e82016-06-07 12:25:35 -050014
15*** Variables ***
Chris Austenb29d2e82016-06-07 12:25:35 -050016
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
George Keishing314cf852016-08-26 09:02:16 -050022
Chris Austenb29d2e82016-06-07 12:25:35 -050023 Set Boot Policy ONETIME
24
Gunnar Mills1cd544d2016-12-06 11:19:22 -060025 ${boot}= Read Attribute /org/openbmc/settings/host0 boot_policy
Chris Austenb29d2e82016-06-07 12:25:35 -050026 Should Be Equal ${boot} ONETIME
Sivas SRRe1143ae2016-08-26 22:31:02 -050027 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
28 Should Be Empty ${stderr}
29 Should Contain ${output} ONETIME
Chris Austenb29d2e82016-06-07 12:25:35 -050030
31Set Permanent boot policy using REST
32 [Documentation] This testcase is to set permanent boot policy using REST
33 ... URI and then verify using REST API and ipmitool.\n
34
35 Set Boot Policy PERMANENT
36
Gunnar Mills1cd544d2016-12-06 11:19:22 -060037 ${boot}= Read Attribute /org/openbmc/settings/host0 boot_policy
Chris Austenb29d2e82016-06-07 12:25:35 -050038 Should Be Equal ${boot} PERMANENT
Sivas SRRe1143ae2016-08-26 22:31:02 -050039 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
40 Should Be Empty ${stderr}
41 Should Contain ${output} PERMANENT
Chris Austenb29d2e82016-06-07 12:25:35 -050042
43Set Onetime boot policy using IPMITOOL
44 [Documentation] This testcase is to set boot policy to onetime boot using ipmitool
45 ... and then verify using REST URI and ipmitool.\n
46
47 Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00
Gunnar Mills1cd544d2016-12-06 11:19:22 -060048 ${boot}= Read Attribute /org/openbmc/settings/host0 boot_policy
Chris Austenb29d2e82016-06-07 12:25:35 -050049 Should Be Equal ${boot} ONETIME
Sivas SRRe1143ae2016-08-26 22:31:02 -050050 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
51 Should Be Empty ${stderr}
52 Should Contain ${output} ONETIME
George Keishing314cf852016-08-26 09:02:16 -050053
Chris Austenb29d2e82016-06-07 12:25:35 -050054Set Permanent boot policy using IPMITOOL
55 [Documentation] This testcase is to set boot policy to permanent using ipmitool
56 ... and then verify using REST URI and ipmitool.
57
58 Run IPMI command 0x0 0x8 0x05 0xC0 0x00 0x00 0x00 0x00
Gunnar Mills1cd544d2016-12-06 11:19:22 -060059 ${boot}= Read Attribute /org/openbmc/settings/host0 boot_policy
Chris Austenb29d2e82016-06-07 12:25:35 -050060 Should Be Equal ${boot} PERMANENT
Sivas SRRe1143ae2016-08-26 22:31:02 -050061 ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True
62 Should Be Empty ${stderr}
63 Should Contain ${output} PERMANENT
Chris Austenb29d2e82016-06-07 12:25:35 -050064
65Boot order with permanent boot policy
66 [Documentation] This testcase is to verify that boot order does not change
67 ... after first boot when boot policy set to permanent
causten147f5752016-08-11 16:24:45 -050068 [Tags] chassisboot
Chris Austenb29d2e82016-06-07 12:25:35 -050069
root442f0ef2016-08-04 20:23:05 +000070 Initiate Power Off
Chris Austenb29d2e82016-06-07 12:25:35 -050071
72 Set Boot Policy PERMANENT
73
74 Set Boot Device CDROM
75
root442f0ef2016-08-04 20:23:05 +000076 Initiate Power On
Chris Austenb29d2e82016-06-07 12:25:35 -050077
Gunnar Mills1cd544d2016-12-06 11:19:22 -060078 ${boot}= Read Attribute /org/openbmc/settings/host0 boot_policy
Chris Austenb29d2e82016-06-07 12:25:35 -050079 Should Be Equal ${boot} PERMANENT
80
Gunnar Mills1cd544d2016-12-06 11:19:22 -060081 ${flag}= Read Attribute /org/openbmc/settings/host0 boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -050082 Should Be Equal ${flag} CDROM
83
84Onetime boot order after warm reset
85 [Documentation] This testcase is to verify that boot policy and order does not change
86 ... after warm reset on a system with onetime boot policy.
Rahul Maheshwari08fd6172016-09-21 12:04:43 -050087 ... Existing Issue: https://github.com/openbmc/openbmc/issues/519
88 [Tags] chassisboot known_issue
causten147f5752016-08-11 16:24:45 -050089
root442f0ef2016-08-04 20:23:05 +000090 Initiate Power On
Chris Austenb29d2e82016-06-07 12:25:35 -050091
92 Set Boot Policy ONETIME
93
94 Set Boot Device Network
95
96 Trigger Warm Reset
97
Gunnar Mills1cd544d2016-12-06 11:19:22 -060098 ${boot}= Read Attribute /org/openbmc/settings/host0 boot_policy
Chris Austenb29d2e82016-06-07 12:25:35 -050099 Should Be Equal ${boot} ONETIME
100
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600101 ${flag}= Read Attribute /org/openbmc/settings/host0 boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -0500102 Should Be Equal ${flag} Network
103
104Permanent boot order after warm reset
George Keishing314cf852016-08-26 09:02:16 -0500105 [Documentation] This testcase is to verify that boot policy and order does not change
Chris Austenb29d2e82016-06-07 12:25:35 -0500106 ... after warm reset on a system with permanent boot policy.
Rahul Maheshwari08fd6172016-09-21 12:04:43 -0500107 ... Existing Issue: https://github.com/openbmc/openbmc/issues/519
108 [Tags] chassisboot known_issue
Chris Austenb29d2e82016-06-07 12:25:35 -0500109
root442f0ef2016-08-04 20:23:05 +0000110 Initiate Power On
Chris Austenb29d2e82016-06-07 12:25:35 -0500111
112 Set Boot Policy PERMANENT
113
114 Set Boot Device CDROM
115
116 Trigger Warm Reset
117
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600118 ${boot}= Read Attribute /org/openbmc/settings/host0 boot_policy
Chris Austenb29d2e82016-06-07 12:25:35 -0500119 Should Be Equal ${boot} PERMANENT
120
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600121 ${flag}= Read Attribute /org/openbmc/settings/host0 boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -0500122 Should Be Equal ${flag} CDROM
George Keishing314cf852016-08-26 09:02:16 -0500123
Chris Austenb29d2e82016-06-07 12:25:35 -0500124Set boot policy to invalid value
George Keishing5f62a4a2016-11-16 02:09:17 -0600125 [Documentation] This testcase verify that the boot policy doesn't get
126 ... updated with invalid policy supplied by user.
127 [Tags] Set_boot_policy_to_invalid_value
George Keishing314cf852016-08-26 09:02:16 -0500128
George Keishing5f62a4a2016-11-16 02:09:17 -0600129 Run Keyword and Ignore Error Set Boot Policy abc
Chris Austenb29d2e82016-06-07 12:25:35 -0500130
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600131 ${boot}= Read Attribute /org/openbmc/settings/host0 boot_policy
George Keishing314cf852016-08-26 09:02:16 -0500132 Should Not Be Equal ${boot} abc
133
Chris Austenb29d2e82016-06-07 12:25:35 -0500134*** Keywords ***
135
136Set Boot Policy
137 [Arguments] ${args}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600138 ${bootpolicy}= Set Variable ${args}
139 ${valueDict}= create dictionary data=${bootpolicy}
Chris Austenb29d2e82016-06-07 12:25:35 -0500140 Write Attribute /org/openbmc/settings/host0 boot_policy data=${valueDict}
141
142Set Boot Device
143 [Arguments] ${args}
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600144 ${bootDevice}= Set Variable ${args}
145 ${valueDict}= create dictionary data=${bootDevice}
Chris Austenb29d2e82016-06-07 12:25:35 -0500146 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
Sivas SRRe1143ae2016-08-26 22:31:02 -0500147
148
149