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 |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 8 | |
George Keishing | 4d6c1da | 2016-07-15 05:51:22 -0500 | [diff] [blame] | 9 | Suite Setup Open Connection And Log In |
| 10 | Suite Teardown Close All Connections |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 11 | |
| 12 | *** Variables *** |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 13 | |
| 14 | *** Test Cases *** |
| 15 | |
| 16 | Set 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 | |
| 27 | Set 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 | |
| 38 | Set 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 | |
| 48 | Set 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 | |
| 58 | Boot 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 |
causten | 147f575 | 2016-08-11 16:24:45 -0500 | [diff] [blame] | 61 | [Tags] chassisboot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 62 | |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 63 | Initiate Power Off |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 64 | |
| 65 | Set Boot Policy PERMANENT |
| 66 | |
| 67 | Set Boot Device CDROM |
| 68 | |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 69 | Initiate Power On |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 70 | |
| 71 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
| 72 | Should Be Equal ${boot} PERMANENT |
| 73 | |
| 74 | ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags |
| 75 | Should Be Equal ${flag} CDROM |
| 76 | |
| 77 | Onetime boot order after warm reset |
| 78 | [Documentation] This testcase is to verify that boot policy and order does not change |
| 79 | ... after warm reset on a system with onetime boot policy. |
| 80 | |
causten | 147f575 | 2016-08-11 16:24:45 -0500 | [diff] [blame] | 81 | [Tags] chassisboot |
| 82 | |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 83 | Initiate Power On |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 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 | |
| 97 | Permanent 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. |
causten | 147f575 | 2016-08-11 16:24:45 -0500 | [diff] [blame] | 100 | [Tags] chassisboot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 101 | |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 102 | Initiate Power On |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 103 | |
| 104 | Set Boot Policy PERMANENT |
| 105 | |
| 106 | Set Boot Device CDROM |
| 107 | |
| 108 | Trigger Warm Reset |
| 109 | |
| 110 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
| 111 | Should Be Equal ${boot} PERMANENT |
| 112 | |
| 113 | ${flag} = Read Attribute /org/openbmc/settings/host0 boot_flags |
| 114 | Should Be Equal ${flag} CDROM |
| 115 | |
| 116 | Set boot policy to invalid value |
| 117 | [Documentation] This testcase is to verify that proper error message is prompted |
| 118 | ... when invalid value to provided to boot policy. |
| 119 | |
| 120 | Set Boot Policy abc |
| 121 | |
| 122 | ${boot} = Read Attribute /org/openbmc/settings/host0 boot_policy |
| 123 | Should Be Not Equal ${boot} abc |
| 124 | |
| 125 | *** Keywords *** |
| 126 | |
| 127 | Set Boot Policy |
| 128 | [Arguments] ${args} |
| 129 | ${bootpolicy} = Set Variable ${args} |
| 130 | ${valueDict} = create dictionary data=${bootpolicy} |
| 131 | Write Attribute /org/openbmc/settings/host0 boot_policy data=${valueDict} |
| 132 | |
| 133 | Set Boot Device |
| 134 | [Arguments] ${args} |
| 135 | ${bootDevice} = Set Variable ${args} |
| 136 | ${valueDict} = create dictionary data=${bootDevice} |
| 137 | Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict} |