Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation This testsuite is for testing boot policy function. |
| 4 | |
George Keishing | 4d6c1da | 2016-07-15 05:51:22 -0500 | [diff] [blame] | 5 | Resource ../lib/rest_client.robot |
| 6 | Resource ../lib/ipmi_client.robot |
| 7 | Resource ../lib/utils.robot |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 8 | Resource ../lib/openbmc_ffdc.robot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 9 | |
George Keishing | 4d6c1da | 2016-07-15 05:51:22 -0500 | [diff] [blame] | 10 | Suite Setup Open Connection And Log In |
| 11 | Suite Teardown Close All Connections |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 12 | Test Setup Initialize DBUS cmd "boot_policy" |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 13 | Test Teardown Log FFDC |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 14 | |
| 15 | *** Variables *** |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 16 | |
| 17 | *** Test Cases *** |
| 18 | |
| 19 | Set 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 Keishing | 314cf85 | 2016-08-26 09:02:16 -0500 | [diff] [blame] | 22 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 23 | Set Boot Policy ONETIME |
| 24 | |
| 25 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
| 26 | Should Be Equal ${boot} ONETIME |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 27 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 28 | Should Be Empty ${stderr} |
| 29 | Should Contain ${output} ONETIME |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 30 | |
| 31 | Set 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 | |
| 37 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
| 38 | Should Be Equal ${boot} PERMANENT |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 39 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 40 | Should Be Empty ${stderr} |
| 41 | Should Contain ${output} PERMANENT |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 42 | |
| 43 | Set 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 |
| 48 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
| 49 | Should Be Equal ${boot} ONETIME |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 50 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 51 | Should Be Empty ${stderr} |
| 52 | Should Contain ${output} ONETIME |
George Keishing | 314cf85 | 2016-08-26 09:02:16 -0500 | [diff] [blame] | 53 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 54 | Set 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 |
| 59 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
| 60 | Should Be Equal ${boot} PERMANENT |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 61 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 62 | Should Be Empty ${stderr} |
| 63 | Should Contain ${output} PERMANENT |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 64 | |
| 65 | Boot 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 |
causten | 147f575 | 2016-08-11 16:24:45 -0500 | [diff] [blame] | 68 | [Tags] chassisboot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 69 | |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 70 | Initiate Power Off |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 71 | |
| 72 | Set Boot Policy PERMANENT |
| 73 | |
| 74 | Set Boot Device CDROM |
| 75 | |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 76 | Initiate Power On |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 77 | |
| 78 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
| 79 | Should Be Equal ${boot} PERMANENT |
| 80 | |
| 81 | ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags |
| 82 | Should Be Equal ${flag} CDROM |
| 83 | |
| 84 | Onetime 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 Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 87 | ... Existing Issue: https://github.com/openbmc/openbmc/issues/519 |
| 88 | [Tags] chassisboot known_issue |
causten | 147f575 | 2016-08-11 16:24:45 -0500 | [diff] [blame] | 89 | |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 90 | Initiate Power On |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 91 | |
| 92 | Set Boot Policy ONETIME |
| 93 | |
| 94 | Set Boot Device Network |
| 95 | |
| 96 | Trigger Warm Reset |
| 97 | |
| 98 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
| 99 | Should Be Equal ${boot} ONETIME |
| 100 | |
| 101 | ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags |
| 102 | Should Be Equal ${flag} Network |
| 103 | |
| 104 | Permanent boot order after warm reset |
George Keishing | 314cf85 | 2016-08-26 09:02:16 -0500 | [diff] [blame] | 105 | [Documentation] This testcase is to verify that boot policy and order does not change |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 106 | ... after warm reset on a system with permanent boot policy. |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 107 | ... Existing Issue: https://github.com/openbmc/openbmc/issues/519 |
| 108 | [Tags] chassisboot known_issue |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 109 | |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 110 | Initiate Power On |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 111 | |
| 112 | Set Boot Policy PERMANENT |
| 113 | |
| 114 | Set Boot Device CDROM |
| 115 | |
| 116 | Trigger Warm Reset |
| 117 | |
| 118 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
| 119 | Should Be Equal ${boot} PERMANENT |
| 120 | |
| 121 | ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags |
| 122 | Should Be Equal ${flag} CDROM |
George Keishing | 314cf85 | 2016-08-26 09:02:16 -0500 | [diff] [blame] | 123 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 124 | Set boot policy to invalid value |
George Keishing | 314cf85 | 2016-08-26 09:02:16 -0500 | [diff] [blame] | 125 | [Documentation] This testcase is to verify that proper error message is prompted |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 126 | ... when invalid value to provided to boot policy. |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 127 | ... Existing Issue: https://github.com/openbmc/openbmc/issues/552 |
| 128 | [Tags] known_issue |
George Keishing | 314cf85 | 2016-08-26 09:02:16 -0500 | [diff] [blame] | 129 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 130 | Set Boot Policy abc |
| 131 | |
| 132 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
George Keishing | 314cf85 | 2016-08-26 09:02:16 -0500 | [diff] [blame] | 133 | Should Not Be Equal ${boot} abc |
| 134 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 135 | *** Keywords *** |
| 136 | |
| 137 | Set Boot Policy |
| 138 | [Arguments] ${args} |
| 139 | ${bootpolicy} = Set Variable ${args} |
| 140 | ${valueDict} = create dictionary data=${bootpolicy} |
| 141 | Write Attribute /org/openbmc/settings/host0 boot_policy data=${valueDict} |
| 142 | |
| 143 | Set Boot Device |
| 144 | [Arguments] ${args} |
| 145 | ${bootDevice} = Set Variable ${args} |
| 146 | ${valueDict} = create dictionary data=${bootDevice} |
| 147 | Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict} |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 148 | |
| 149 | |
| 150 | |