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 |
George Keishing | d55a4be | 2016-08-26 03:28:17 -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 |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 12 | Test Teardown Log FFDC |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 13 | |
| 14 | *** Variables *** |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 15 | |
| 16 | *** Test Cases *** |
| 17 | |
| 18 | Set Onetime boot policy using REST |
| 19 | [Documentation] This testcase is to set onetime boot policy using REST |
| 20 | ... URI and then verify using REST API and ipmitool.\n |
George Keishing | 314cf85 | 2016-08-26 09:02:16 -0500 | [diff] [blame] | 21 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 22 | Set Boot Policy ONETIME |
| 23 | |
| 24 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
| 25 | Should Be Equal ${boot} ONETIME |
| 26 | ${output} = Run IPMI Standard command chassis bootparam get 5 |
| 27 | Should Contain ${output} Options apply to only next boot |
| 28 | |
| 29 | Set Permanent boot policy using REST |
| 30 | [Documentation] This testcase is to set permanent boot policy using REST |
| 31 | ... URI and then verify using REST API and ipmitool.\n |
| 32 | |
| 33 | Set Boot Policy PERMANENT |
| 34 | |
| 35 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
| 36 | Should Be Equal ${boot} PERMANENT |
| 37 | ${output} = Run IPMI Standard command chassis bootparam get 5 |
| 38 | Should Contain ${output} Options apply to all future boots |
| 39 | |
| 40 | Set Onetime boot policy using IPMITOOL |
| 41 | [Documentation] This testcase is to set boot policy to onetime boot using ipmitool |
| 42 | ... and then verify using REST URI and ipmitool.\n |
| 43 | |
| 44 | Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00 |
| 45 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
| 46 | Should Be Equal ${boot} ONETIME |
| 47 | ${output} = Run IPMI Standard command chassis bootparam get 5 |
| 48 | Should Contain ${output} Options apply to only next boot |
George Keishing | 314cf85 | 2016-08-26 09:02:16 -0500 | [diff] [blame] | 49 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 50 | Set Permanent boot policy using IPMITOOL |
| 51 | [Documentation] This testcase is to set boot policy to permanent using ipmitool |
| 52 | ... and then verify using REST URI and ipmitool. |
| 53 | |
| 54 | Run IPMI command 0x0 0x8 0x05 0xC0 0x00 0x00 0x00 0x00 |
| 55 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
| 56 | Should Be Equal ${boot} PERMANENT |
| 57 | ${output} = Run IPMI Standard command chassis bootparam get 5 |
| 58 | Should Contain ${output} Options apply to all future boots |
| 59 | |
| 60 | Boot order with permanent boot policy |
| 61 | [Documentation] This testcase is to verify that boot order does not change |
| 62 | ... after first boot when boot policy set to permanent |
causten | 147f575 | 2016-08-11 16:24:45 -0500 | [diff] [blame] | 63 | [Tags] chassisboot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 64 | |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 65 | Initiate Power Off |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 66 | |
| 67 | Set Boot Policy PERMANENT |
| 68 | |
| 69 | Set Boot Device CDROM |
| 70 | |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 71 | Initiate Power On |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 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 | |
| 79 | Onetime 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 | |
causten | 147f575 | 2016-08-11 16:24:45 -0500 | [diff] [blame] | 83 | [Tags] chassisboot |
| 84 | |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 85 | Initiate Power On |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 86 | |
| 87 | Set Boot Policy ONETIME |
| 88 | |
| 89 | Set Boot Device Network |
| 90 | |
| 91 | Trigger Warm Reset |
| 92 | |
| 93 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
| 94 | Should Be Equal ${boot} ONETIME |
| 95 | |
| 96 | ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags |
| 97 | Should Be Equal ${flag} Network |
| 98 | |
| 99 | Permanent boot order after warm reset |
George Keishing | 314cf85 | 2016-08-26 09:02:16 -0500 | [diff] [blame] | 100 | [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] | 101 | ... after warm reset on a system with permanent boot policy. |
causten | 147f575 | 2016-08-11 16:24:45 -0500 | [diff] [blame] | 102 | [Tags] chassisboot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 103 | |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 104 | Initiate Power On |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 105 | |
| 106 | Set Boot Policy PERMANENT |
| 107 | |
| 108 | Set Boot Device CDROM |
| 109 | |
| 110 | Trigger Warm Reset |
| 111 | |
| 112 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
| 113 | Should Be Equal ${boot} PERMANENT |
| 114 | |
| 115 | ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags |
| 116 | Should Be Equal ${flag} CDROM |
George Keishing | 314cf85 | 2016-08-26 09:02:16 -0500 | [diff] [blame] | 117 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 118 | Set boot policy to invalid value |
George Keishing | 314cf85 | 2016-08-26 09:02:16 -0500 | [diff] [blame] | 119 | [Documentation] This testcase is to verify that proper error message is prompted |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 120 | ... when invalid value to provided to boot policy. |
George Keishing | 314cf85 | 2016-08-26 09:02:16 -0500 | [diff] [blame] | 121 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 122 | Set Boot Policy abc |
| 123 | |
| 124 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
George Keishing | 314cf85 | 2016-08-26 09:02:16 -0500 | [diff] [blame] | 125 | Should Not Be Equal ${boot} abc |
| 126 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 127 | *** Keywords *** |
| 128 | |
| 129 | Set Boot Policy |
| 130 | [Arguments] ${args} |
| 131 | ${bootpolicy} = Set Variable ${args} |
| 132 | ${valueDict} = create dictionary data=${bootpolicy} |
| 133 | Write Attribute /org/openbmc/settings/host0 boot_policy data=${valueDict} |
| 134 | |
| 135 | Set Boot Device |
| 136 | [Arguments] ${args} |
| 137 | ${bootDevice} = Set Variable ${args} |
| 138 | ${valueDict} = create dictionary data=${bootDevice} |
| 139 | Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict} |